Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes come out empty #7

Closed
KTibow opened this issue Dec 22, 2021 · 2 comments
Closed

Classes come out empty #7

KTibow opened this issue Dec 22, 2021 · 2 comments

Comments

@KTibow
Copy link

KTibow commented Dec 22, 2021

I was trying to deobfuscate/decompile a mod obfuscated with Branchlock, but all the classes are pretty much empty. For example, here's the original file:

    package SBToolkit.utils;

import java.lang.management.ManagementFactory;
import java.util.List;

// $FF: synthetic class
public class GuiEnums {
   // $FF: synthetic field
   BRANCHLOCK_DOT_NET_DEMO;

   private static final String[] o;

   static {
      char[] var0 = "\u0e75ฒó\u0016\u0004\u0086(úทòv\u0000ทÙ:òณ(¥¿¦)ù=ฒ.®WU\u0086&ท\u0006º|ณüÑ}ûû(úผç ®y(.¬\u0001ณÛ{¤U§s_ฒ\u008by¢£!ûท®{¡ฐ()«Vฒ\u009d\u0014¼\u007fฒ¢Ùr£ùpทü  ผf*%þQ^ÜsถPúทV¢\u008cถ¯ºผç¢ÿsÿ~}\"ผJT\u0089\u007f©Q\u00ad,ผçÙrþ¬hó¿ฒh®;u8¯ทQ\u008a%ณV©iV¾\u008c!ฒ¦m\u00adü£sฒ9 &²\t\u0013ผf¨Püx\u0004£Úผçû~¿»¤{óณ4x®\u0016\u0011Ñ.ผJø,\u0003»\u009c)¥ฒ{§¦¦j¹ผ4z\u00ad\u0003\u000f\u0080>§ผç(\t¥\u0086'û¯ณûÿ¤pùrrณòP\u0000ßs¨\u0002ท,\u0002ûณsÿ )üû®ผç*x ¢\u0005\u000eÝผçRø-\u0000©\u0084!ผç(¦¨úwûsณf¯\u0000\u0002ß:½ทø`\bณÝ#¡®.«óท}¡{ผzû\u0006\f\u0082(«^ผ4RþÝ/® ,ณû«tü!-%ท\u0003PÙณçRþ R¨\u008fผç©uýøüz ผ4~û\f\u0017\u0081( ณût\u0004¢\u0083; ผ4 òý!¢| ".toCharArray();
      int var1 = 36 << 15646;
      StackTraceElement var2;
      int var3 = (var2 = (new Throwable()).getStackTrace()[Integer.parseInt("1i", 30) << 764]).getMethodName().hashCode() & 67107840 >>> 3402;
      char[] var4 = var2.getClassName().toCharArray();
      int var10001 = 4 << 12382;
      ++var1;
      o = new String[var0[var10001] ^ 1962934272 >>> 5335 ^ var3];
      int var5 = 112 >>> 12807;

      do {
         int var11;
         char[] var6 = new char[var11 = var0[var1++] ^ Integer.parseInt("1c8p0", 27) >>> 5004 ^ var3];
         int var7 = Integer.parseInt("31", 33) << 6174;

         while(var11 > 0) {
            int var8 = var0[var1];
            switch(var4[var1 % var4.length] ^ 4928 >>> 8742) {
            case 8:
            case 10:
            case 25:
            case 32:
            case 35:
            case 36:
            case 99:
               var8 ^= -300442147 ^ -300442345;
               break;
            case 15:
            case 38:
            case 62:
               var8 ^= 75 << 4704;
               break;
            case 30:
            case 56:
               var8 ^= Integer.parseInt("613", 23) >>> 15943;
               break;
            case 33:
               var8 ^= 1792232422 - Integer.parseInt("1ld6inu", 32);
               break;
            case 34:
            case 57:
               var8 ^= 412 >>> Integer.parseInt("ahf", 25);
            }

            while(true) {
               var6[var7] = (char)var8;

               try {
                  ++var7;
                  ++var1;
                  --var11;
               } catch (Throwable var10) {
                  break;
               }

               var8 ^= Integer.parseInt("613", 23) >>> 15943;
            }
         }

         o[var5++] = (new String(var6)).intern();
      } while(var1 < var0.length);

      try {
         List var10000 = ManagementFactory.getRuntimeMXBean().getInputArguments();
         var10001 = 0;

         while(true) {
            int var10002 = var10000.get(var10001).hashCode();
            if (var10002 != (1341451842 ^ Integer.parseInt(o[19 << Integer.parseInt("55c", 20)], 21)) >>> (101 << 12838))
            if (var10002 != (-1941740282 >>> 7041 << 1967769672 + -1967758216) + (Integer.parseInt(o[51 << 12672], 27) >>> 7364 << (193 << Integer.parseInt(o[Integer.parseInt("1", 30) << 640], 26))))
            if (var10002 != ((-1058256410 ^ -582754445) + (400532296 ^ -2097370880) >>> (1106581659 << Integer.parseInt(o[Integer.parseInt("-2000000", 32) >>> 10107], 23)) + (Integer.parseInt(o[12 << 13889], 30) << 8065)) + ((-1214656099 ^ -1321590486) << (-1793535292 ^ -1793524959) >>> (Integer.parseInt(o[73400320 >>> 11701], 25) << 11392) + (-2027844875 << 640)))
            if (var10002 != (1629933517 + Integer.parseInt(o[19 << 15073], 22) ^ 496541744 >>> 10593) << (1170769647 ^ Integer.parseInt(o[4 << 14145], 29)) + (910616422 ^ -416841214))
            if (var10002 != ((-762425971 ^ 1581267973 ^ 1239398174 - 917057608) >>> (1184763693 << 3392) - (296188099 << 6754) << ((-270404608 ^ 1558574080) >>> (8487936 >>> 13290) >>> ((260673205 ^ 260679524) << 172295172 - Integer.parseInt(o[2 << 2465], 26))) >>> (Integer.parseInt(o[Integer.parseInt("7", 22) << 11008], 20) - 1647417108 ^ 68070542 << 14565) + (2041531381 + 1138302894 << (Integer.parseInt(o[23 << Integer.parseInt("12ik", 22)], 25) << 8546)) - (-1229629453 >>> 992 >>> -1954169108 - Integer.parseInt(o[14 << 15873], 33) >>> (Integer.parseInt(o[81920 >>> 9740], 20) + 224745957 << (1290983801 ^ 1290991832)))) - ((-1496289095 - -325455930 << 1284784494 + Integer.parseInt(o[Integer.parseInt("5md1hg4", 26) >>> 1914], 22) << (Integer.parseInt(o[15728640 >>> Integer.parseInt("2k5", 23)], 30) + 1635191862 >>> (923 << 13986)) << (100360921 - -1047232402 - (1139073643 << 13472) >>> (-1959701876 >>> Integer.parseInt(o[73728 >>> Integer.parseInt("8ad", 31)], 32)) + (1045646556 - -2081696808))) - (877845708 + Integer.parseInt(o[Integer.parseInt("cf6", 22) >>> 15659], 32) - (Integer.parseInt(o[23 << 14689], 21) ^ -125632459) + (1546693659 << 4257) + (-218456307 << 5536) ^ (-1356830108 >>> 7456 >>> (Integer.parseInt(o[13 << 3873], 35) ^ Integer.parseInt(o[12320768 >>> 11794], 32))) - ((1986313568 ^ Integer.parseInt(o[3 << 9986], 32)) << (441376 >>> Integer.parseInt(o[Integer.parseInt("h", 24) << 2784], 24))))))
            if (var10002 != ((-1820095320 >>> 15521) - (Integer.parseInt(o[Integer.parseInt("57", 21) << 1084], 27) + -723413053) << (-901369272 - Integer.parseInt(o[5 << 13315], 27) ^ 2064042221 - -2024159655) >>> (-1068296593 << Integer.parseInt(o[5242880 >>> Integer.parseInt("1b6", 30)], 26) << Integer.parseInt(o[Integer.parseInt("f", 28) << 416], 24) - -757868520) - (2142451234 + 1139976043 ^ 33260481 << Integer.parseInt(o[92274688 >>> Integer.parseInt("gq9", 27)], 22)) ^ (-1385703124 >>> 15264 >>> (1975938188 ^ 1975931341) >>> ((Integer.parseInt(o[21 << 7104], 32) ^ -1380436829) << (336 << 1027))) + (Integer.parseInt(o[Integer.parseInt("28", 25) >>> 11809], 32) >>> 6113 << (126 << 8039) << -307782093 - -1929557673 + (-841447757 ^ 1384991478)) ^ (551156235 << 13024 << -1859882795 - -1859888365 >>> (961179349 << 12288) - (41042589 + 920136215)) - (Integer.parseInt(o[49 << Integer.parseInt("ji8", 22)], 29) - -551602985 + (-549021835 << 10336) - (2065186611 << 14144 << (Integer.parseInt(o[Integer.parseInt("l", 27) << Integer.parseInt("999", 24)], 35) << Integer.parseInt(o[72 >>> Integer.parseInt("c42", 32)], 28)))) ^ (336332750 - 2117027884 >>> 1246166548 + -1246151123) - (1808218867 << 14593 >>> (Integer.parseInt(o[31 << 4480], 31) ^ 335887562)) >>> Integer.parseInt(o[41 << 4352], 35) + Integer.parseInt(o[6784 >>> Integer.parseInt("eh", 29)], 21) - (1789730060 + -1479208432) - (-1173283880 >>> Integer.parseInt(o[12 << 16162], 34) << -757126911 + Integer.parseInt(o[11 << 2465], 31))))
            if (var10002 != ((Integer.parseInt(o[13 << 5122], 26) ^ 964052381) >>> -1358095573 - Integer.parseInt(o[16 << 14369], 31)) + (1849997620 >>> 770 << (-1342177280 >>> 7990)) - ((-1278808508 + Integer.parseInt(o[2424832 >>> 13808], 21) >>> (8549 << Integer.parseInt(o[5 << 12865], 21))) + ((-2122352760 ^ 1214725822) - (Integer.parseInt(o[33 << Integer.parseInt("jag", 26)], 27) + -659478777))) + ((44405227 << 6437 >>> (16652 >>> 1090) ^ -1274864727 - Integer.parseInt(o[Integer.parseInt("p9ir7c", 28) >>> Integer.parseInt("12l1", 24)], 23) - (-1809378215 >>> 544)) - ((-1972402531 >>> Integer.parseInt(o[4 >>> Integer.parseInt("1181", 24)], 34) << (-1954545664 >>> 9138)) + (2080972237 << 15744) + (423887319 << Integer.parseInt(o[Integer.parseInt("4i2jij", 25) >>> 4308], 32)))) - (((Integer.parseInt(o[9 << 4160], 30) << Integer.parseInt(o[469762048 >>> 4505], 27)) + (-716438985 ^ Integer.parseInt(o[327155712 >>> 3255], 22)) << (-1493875696 ^ -1893314008) - (1921978159 - Integer.parseInt(o[Integer.parseInt("3", 24) << 4065], 24))) - ((Integer.parseInt(o[1114112 >>> 12943], 26) >>> 5953 ^ 2101713350 - 1574751055) - (687302598 + Integer.parseInt(o[25 << 7776], 31) << (1116084910 ^ 1116083086))) << ((-190354705 ^ -1740677006 ^ -724953910 ^ Integer.parseInt(o[Integer.parseInt("170", 25) >>> 196], 23)) + (866788441 ^ -1973398771 ^ -569231015 + -73836666) ^ Integer.parseInt(o[1409024 >>> 11311], 22) + Integer.parseInt(o[1509949440 >>> 5849], 21) >>> (155 << 7781) ^ -1960178448 - -1963444871 << 1241531687 - 1241531009)))
            ++var10001;
         }
      } catch (IndexOutOfBoundsException var9) {
      }
   }

   public static enum SettingsSections {
      // $FF: synthetic field
      MAIN(Utils.iota("setting_section_enum", true)),
      // $FF: synthetic field
      index;

      // $FF: synthetic method
      private SettingsSections(int index) {
         this.index = index;
      }
   }

   public static enum GuiTypes {
      // $FF: synthetic field
      SETTINGS,
      // $FF: synthetic field
      NONE;
   }
}

But it turns into this decompiled:

//Deobfuscated with https://github.com/SimplyProgrammer/Minecraft-Deobfuscator3000 using mappings "/home/kendell/Downloads/MCP-1.8.9-master/conf"!

//Decompiled by Procyon!

package SBToolkit.utils;

import java.lang.management.*;
import java.util.*;

public class GuiEnums
{
    private static final String[] o;
}
@SimplyProgrammer
Copy link
Owner

Hi!
Hmm I have to say that your source code is a bit... interesting I would say but yea it should be able to work with it without a problem... I will try to fix this in some future releases, it looks like to be some sort of problem with static initialization block.
But until then only thing you can do is predecompile it with external decompiler such as http://www.javadecompilers.com/
and deobfuscate the decompiled version afterwards. Just like it used to be before 1.2.0...

@KTibow
Copy link
Author

KTibow commented Mar 21, 2022

Hmm I have to say that your source code is a bit... interesting I would say

I know, it's a rat lol

Anyway thanks for letting me know, I'm not that interested in continuing work on deobfuscating it right now, but hopefully this helps someone else. Closing for now.

@KTibow KTibow closed this as completed Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants