Status of "strong" modding?

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    Oo source code! I want to ask, but... not gonna ask...
     
    Joined
    Jul 28, 2013
    Messages
    12
    Reaction score
    0
    • Legacy Citizen 2
    • Legacy Citizen
    That's decompiled java sourcecode? How does the decompiler know about method and variable names? Does the java compiler leave them in? And if yes, what for?

    And about EA stealing the sourcecode: There is no way a large publisher would steal sourcecode. Hiring some developers and redeveloping it would probably still be cheaper than a lawsuite and especially the following bad press. EA might be pretty hated among gamers, but they are not that stupid.
     

    Reilly Reese

    #1 Top Forum Poster & Raiben Jackpot Winner
    Joined
    Oct 13, 2013
    Messages
    5,140
    Reaction score
    1,365
    • Legacy Citizen 8
    • Thinking Positive
    • Purchased!
    That's decompiled java sourcecode? How does the decompiler know about method and variable names? Does the java compiler leave them in? And if yes, what for?

    And about EA stealing the sourcecode: There is no way a large publisher would steal sourcecode. Hiring some developers and redeveloping it would probably still be cheaper than a lawsuite and especially the following bad press. EA might be pretty hated among gamers, but they are not that stupid.
    They've stolen a game before you know...
     
    Joined
    Jun 29, 2013
    Messages
    144
    Reaction score
    64
    • Modder
    • Legacy Citizen 4
    • Purchased!
    Pls. Deobfusating stuff is not that hard. There are a lot of deobfuscators available.


    That's more than enough.
    This part of code is not obfuscated, obfuscated part are translated with letters to replace functions name and variable, not all classes are obfus. You've got all functions but not there name, this is a greate problem to understand and invoke them
     
    Joined
    Jan 24, 2016
    Messages
    49
    Reaction score
    20
    This part of code is not obfuscated, obfuscated part are translated with letters to replace functions name and variable, not all classes are obfus. You've got all functions but not there name, this is a greate problem to understand and invoke them
    This is one of the files in obfuscated directory. I assume it is obfuscated after all.
     
    Joined
    Jun 29, 2013
    Messages
    144
    Reaction score
    64
    • Modder
    • Legacy Citizen 4
    • Purchased!
    This is one of the files in obfuscated directory. I assume it is obfuscated after all.
    In many case you 've got this kind of code
    Code:
    /*
    * Decompiled with CFR 0_110.
    */
    package obfuscated;
    
    import java.util.Random;
    import obfuscated.aoi;
    import org.schema.common.FastMath;
    
    public final class aom
    extends aoi {
        private short a;
        private short b;
        private short c;
    
        public aom(short s2, short s3, short s4) {
            this.a = s2;
            this.b = s3;
            this.c = s4;
        }
    
        private void a(long l2, int n2, int n3, short[] arrs, double d2, double d3, double d4, float f2, float f3, float f4, int n4, int n5, double d5, Random random) {
            block0 : do {
                int n6;
                boolean bl2;
                double d6 = (n2 << 4) + 8;
                double d7 = (n3 << 4) + 8;
                float f5 = 0.0f;
                float f6 = 0.0f;
                Random random2 = new Random(l2);
                if (n5 <= 0) {
                    n6 = (this.a << 4) - 16;
                    n5 = n6 - random2.nextInt(n6 / 4);
                }
                n6 = 0;
                if (n4 == -1) {
                    n4 = n5 / 2;
                    n6 = 1;
                }
                int n7 = random2.nextInt(n5 / 2) + n5 / 4;
                boolean bl3 = bl2 = random2.nextInt(6) == 0;
                while (n4 < n5) {
                    double d8 = 1.5 + (double)(FastMath.l((float)n4 * 3.1415927f / (float)n5) * f2);
                    double d9 = d8 * d5;
                    float f7 = FastMath.g(f4);
                    float f8 = FastMath.l(f4);
                    d2 += (double)(FastMath.g(f3) * f7);
                    d3 += (double)f8;
                    d4 += (double)(FastMath.l(f3) * f7);
                    f4 = bl2 ? (f4 *= 0.92f) : (f4 *= 0.7f);
                    f4 += f6 * 0.1f;
                    f3 += f5 * 0.1f;
                    f6 *= 0.9f;
                    f5 *= 0.75f;
                    f6 += (random2.nextFloat() - random2.nextFloat()) * random2.nextFloat() * 2.0f;
                    f5 += (random2.nextFloat() - random2.nextFloat()) * random2.nextFloat() * 4.0f;
                    if (n6 == 0 && n4 == n7 && f2 > 1.0f && n5 > 0) {
                        this.a(random2.nextLong(), n2, n3, arrs, d2, d3, d4, random2.nextFloat() * 0.5f + 0.5f, f3 - 1.5707964f, f4 / 3.0f, n4, n5, 1.0, random);
                        d5 = 1.0;
                        f4 /= 3.0f;
                        f3 += 1.5707964f;
                        f2 = random2.nextFloat() * 0.5f + 0.5f;
                        l2 = random2.nextLong();
                        continue block0;
                    }
                    if (n6 != 0 || random2.nextInt(4) != 0) {
                        double d10 = d2 - d6;
                        double d11 = d4 - d7;
                        double d12 = n5 - n4;
                        double d13 = f2 + 2.0f + 16.0f;
                        if (d10 * d10 + d11 * d11 - d12 * d12 > d13 * d13) {
                            return;
                        }
                        if (d2 >= d6 - 16.0 - d8 * 2.0 && d4 >= d7 - 16.0 - d8 * 2.0 && d2 <= d6 + 16.0 + d8 * 2.0 && d4 <= d7 + 16.0 + d8 * 2.0) {
                            int n8;
                            int n9;
                            d10 = (int)(d2 - d8) - (n2 << 4) - 1;
                            int n10 = (int)(d2 + d8) - (n2 << 4) + 1;
                            d11 = (int)(d3 - d9) - 1;
                            int n11 = (int)(d3 + d9) + 1;
                            d12 = (int)(d4 - d8) - (n3 << 4) - 1;
                            int n12 = (int)(d4 + d8) - (n3 << 4) + 1;
                            d10 = Math.max(0.0, d10);
                            n10 = Math.min(16, n10);
                            d11 = Math.max(1.0, d11);
                            n11 = Math.min(60, n11);
                            d12 = Math.max(0.0, d12);
                            n12 = Math.min(16, n12);
                            int n13 = 0;
                            for (n9 = (int)d10; n13 == 0 && n9 < n10; ++n9) {
                                for (int i2 = (int)d12; n13 == 0 && i2 < n12; ++i2) {
                                    int n14 = n11 + 1;
                                    while (n13 == 0 && (double)n14 >= d11 - 1.0) {
                                        n8 = ((n9 << 4) + i2 << 6) + n14;
                                        if (n14 >= 0 && n14 < 64) {
                                            if (arrs[n8] == 86) {
                                                n13 = 1;
                                            }
                                            if ((double)n14 != d11 - 1.0 && (double)n9 != d10 && n9 != n10 - 1 && (double)i2 != d12 && i2 != n12 - 1) {
                                                n14 = (int)d11;
                                            }
                                        }
                                        --n14;
                                    }
                                }
                            }
                            if (n13 == 0) {
                                for (n9 = (int)d10; n9 < n10; ++n9) {
                                    double d14 = ((double)(n9 + (n2 << 4)) + 0.5 - d2) / d8;
                                    for (n8 = (int)d12; n8 < n12; ++n8) {
                                        double d15 = ((double)(n8 + (n3 << 4)) + 0.5 - d4) / d8;
                                        n13 = ((n9 << 4) + n8 << 6) + n11;
                                        boolean bl4 = false;
                                        if (d14 * d14 + d15 * d15 >= 1.0) continue;
                                        int n15 = n11 - 1;
                                        while ((double)n15 >= d11) {
                                            double d16 = ((double)n15 + 0.5 - d3) / d9;
                                            if (d16 > -0.6932488288173 && d14 * d14 + d16 * d16 + d15 * d15 < 1.0) {
                                                if (arrs[n13] == this.a) {
                                                    bl4 = true;
                                                }
                                                if (n15 < 10) {
                                                    arrs[n13] = this.c;
                                                } else {
                                                    arrs[n13] = this.b;
                                                    if (bl4 && arrs[n13 - 1] == this.b) {
                                                        arrs[n13 - 1] = this.b;
                                                    }
                                                }
                                            }
                                            --n13;
                                            --n15;
                                        }
                                    }
                                }
                                if (n6 != 0) break block0;
                            }
                        }
                    }
                    ++n4;
                }
                break block0;
                break;
            } while (true);
        }
    
        @Override
        protected final void a(int n2, int n3, int n4, int n5, short[] arrs, Random random) {
            int n6 = aom.a(random);
            n6 = aom.b(random) ? 0 : n6;
            for (int i2 = 0; i2 < n6; ++i2) {
                double d2 = aom.a(n2, random);
                double d3 = aom.a(random);
                double d4 = aom.b(n3, random);
                int n7 = 1;
                if (this.a(random)) {
                    Random random2 = random;
                    double d5 = d4;
                    double d6 = d3;
                    double d7 = d2;
                    short[] arrs2 = arrs;
                    this.a(random.nextLong(), n4, n5, arrs2, d7, d6, d5, 1.0f + random2.nextFloat() * 6.0f, 0.0f, 0.0f, -1, -1, 0.5, random2);
                    n7 = 1 + random.nextInt(4);
                }
                for (int i3 = 0; i3 < n7; ++i3) {
                    Random random3 = random;
                    this.a(random.nextLong(), n4, n5, arrs, d2, d3, d4, aom.b(random), 6.2831855f * random3.nextFloat(), aom.a(random), 0, 0, 1.0, random);
                }
            }
        }
    }
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    Does the java compiler leave them in? And if yes, what for?
    I know this is a very late response, but information is information and cannot hurt.
    The java compiler leaves class, variable and function names in the compiled class files, not because the JVM needs it to run the code, but because there is the library/package java.lang.reflect, which provides the ability to call/read/set any constructor, method or variable of any loaded class, if you know the class's name, and the variable's/method's name, and also the parameters of the method/constructor. Of course, for non-static variables and methods an object of the class has ot be provided for context, but that is besides the point. java.lang.reflect works in runtime and not on compile time, because the the classes you are using java.lang.reflect on may not be available at compiletime, but potentially at runtime.