Thread: OSRS Deobfuscator/Refactor Tools

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 OSRS Deobfuscator/Refactor Tools 
    Registered Member
    Join Date
    Jul 2016
    Posts
    40
    Thanks given
    1
    Thanks received
    14
    Rep Power
    17
    OSRS-Deobfuscator
    [Only registered and activated users can see links. ]
    A standalone OSRS deobfuscator/mapping tool


    Deobfuscator - Removes unnecessary code from vanilla gamepack
    UpdateMappings - Refactors a new revision deob from previous revision refactor. [Only registered and activated users can see links. ]

    --

    Libraries:

    asm-debug-all-5.2
    guava-16.0.1
    Always include latest runelite-api jar, and runescape-api jar from repo.runelite.net

    --

    Usage:

    deob - run with command line argument of obfuscated gamepack, then output jar. Example:
    Deob gamepack-171.jar deob-171.jar

    updatemappings - run with command line argument of current revision gamepack, current runescape-client.jar, then output jar. Example:
    UpdateMappings Refactored-170.jar deob-171.jar Refactored-171.jar


    runescape-client
    [Only registered and activated users can see links. ]
    Reverse engineering project for Old School Runescape

    This must be patched every OSRS revision change.
    This is the decompiled result of UpdateMappings in [Only registered and activated users can see links. ]

    Decompiled using FernFlower


    Flow of updating:
    New OSRS Revision > Deobfuscate gamepack > UpdateMappings oldJar to newJar > FernFlower newJar > Patch runescape-client = Refactored newJar
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    žecurity Ⱥnalyst
    Noele's Avatar
    Join Date
    Dec 2016
    Posts
    459
    Thanks given
    248
    Thanks received
    396
    Rep Power
    1391
    Cheers although most people who have forked it already have this. I think the biggest concern is who will update it when it's inevitably broken by engine changes.
    Join the Zenyte discord below to keep up with the development, and grow with our community! Nearly 400 members!
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Registered Member
    Join Date
    Jul 2016
    Posts
    40
    Thanks given
    1
    Thanks received
    14
    Rep Power
    17
    Quote Originally Posted by Noele View Post
    Cheers although most people who have forked it already have this. I think the biggest concern is who will update it when it's inevitably broken by engine changes.
    The Deobfuscator should always work, My concern is the UpdateMapper. but even that should work for some time as it pulls annotations from runelite-api. It would work forever but runescape-client was also pulled so You are kind of forced to rely on updating from previous refactors instead of the current injected client.

    I will note however that RuneLite builds still work somehow, so it must be getting the injected client still. If I can find out how they do it, i'll update this.
    Reply With Quote  
     

  6. #4  
    Registered Wizard

    Jesse's Avatar
    Join Date
    Sep 2009
    Age
    23
    Posts
    4,913
    Thanks given
    1,341
    Thanks received
    958
    Rep Power
    5000
    if they change obfuscation in the future it will not work lol, which is what noele means since they will probably be doing this to stop this from getting around



    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #5  
    Registered Member
    Join Date
    Jul 2016
    Posts
    40
    Thanks given
    1
    Thanks received
    14
    Rep Power
    17
    Quote Originally Posted by Jesse View Post
    if they change obfuscation in the future it will not work lol, which is what noele means since they will probably be doing this to stop this from getting around
    You mean adding obfuscation? To a jar that's already 4x bigger than deob? Doubt it. And even if they did, that's the whole point of open source. That's why it should be out there. Where there is a hole that needs filling, somebody somewhere will fill it
    Reply With Quote  
     

  8. #6  
    Registered Wizard

    Jesse's Avatar
    Join Date
    Sep 2009
    Age
    23
    Posts
    4,913
    Thanks given
    1,341
    Thanks received
    958
    Rep Power
    5000
    Quote Originally Posted by Null_Life View Post
    You mean adding obfuscation? To a jar that's already 4x bigger than deob? Doubt it. And even if they did, that's the whole point of open source. That's why it should be out there. Where there is a hole that needs filling, somebody somewhere will fill it
    what are you talking about? lol

    when jagex seems to changed 1 small thing in the client lately like they did last week. Osbuddy has to go to a limited mode, osbot was down for 2-3 days until mgi was able to fix since alek couldn't I guess, tribot was able to at least put it in a limited state but objects were messed up since that is what they changed due to object limit so they changed it to a long from an int. what I am saying is imagine if they took it to a whole different level and just changed obfuscation totally it would break the current tool until someone fixed it and seeing as how major bot sites struggle I don't see it getting back up fast.



    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  9. Thankful user:


  10. #7  
    Registered Member
    Join Date
    Jul 2016
    Posts
    40
    Thanks given
    1
    Thanks received
    14
    Rep Power
    17
    Quote Originally Posted by Jesse View Post
    what are you talking about? lol

    when jagex seems to changed 1 small thing in the client lately like they did last week. Osbuddy has to go to a limited mode, osbot was down for 2-3 days until mgi was able to fix since alek couldn't I guess, tribot was able to at least put it in a limited state but objects were messed up since that is what they changed due to object limit so they changed it to a long from an int. what I am saying is imagine if they took it to a whole different level and just changed obfuscation totally it would break the current tool until someone fixed it and seeing as how major bot sites struggle I don't see it getting back up fast.
    That's refactoring breaks, not deobfuscation breaks lol. If you have a fork of RuneLite, go ahead and look back and see how many changes it gets. Matter of factly i'll do you one better, i'll link you to it :
    [Only registered and activated users can see links. ]

    You will see every single OSRS revision change is literally just a version increment.


    You are thinking of runescape-client, which refactors the classes and does break every revision change.
    deobfuscator is totally seperate, and has nothing to do with the refactoring side. It literally just removes garbage code and transforms strings etc.

    And no it wouldn't break deob, deob will ALWAYS remove unreachable code, ALWAYS remove unused code, etc. deobfuscator is more of a code cleanup tool. I understand how it works. I promise.

    The UpdateMapper included in deob depends on runescape-client, which contains the refactoring information
    (which is no longer available and is infinitely more useful than deob)
    [Only registered and activated users can see links. ]

    And this is one of those time consuming updates in runescape-client that you were talking about:
    [Only registered and activated users can see links. ]

    And this is what a class looks like deobfuscated but not refactored:
    Code:
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.List;
    import net.runelite.mapping.ObfuscatedName;
    import net.runelite.mapping.ObfuscatedSignature;
    
    @ObfuscatedName("m")
    public class class1
    {
      @ObfuscatedName("m")
      public static Comparator field5 = new class7();
      
      static
      {
        new class0();
      }
      
      @ObfuscatedName("w")
      public static final int method15(double paramDouble1, double paramDouble2, double paramDouble3)
      {
        double d1 = paramDouble3;
        double d2 = paramDouble3;
        double d3 = paramDouble3;
        double d4;
        double d5;
        double d6;
        double d7;
        double d8;
        if (paramDouble2 != 0.0D)
        {
          if (paramDouble3 >= 0.5D) {
            break label398;
          }
          d4 = paramDouble3 * (paramDouble2 + 1.0D);
          
          d5 = 2.0D * paramDouble3 - d4;
          d6 = paramDouble1 + 0.3333333333333333D;
          if (d6 > 1.0D) {
            d6 -= 1.0D;
          }
          d7 = paramDouble1;
          d8 = paramDouble1 - 0.3333333333333333D;
          if (d8 < 0.0D) {
            d8 += 1.0D;
          }
          if (6.0D * d6 >= 1.0D) {
            break label219;
          }
          d1 = d6 * (6.0D * (d4 - d5)) + d5;
          label117:
          if (d7 * 6.0D >= 1.0D) {
            break label237;
          }
          d2 = d5 + d7 * ((d4 - d5) * 6.0D);
        }
        for (;;)
        {
          label145:
          if (6.0D * d8 < 1.0D) {
            d3 = (d4 - d5) * 6.0D * d8 + d5;
          }
          for (;;)
          {
            int k = (int)(d1 * 256.0D);
            int i = (int)(256.0D * d2);
            int m = (int)(d3 * 256.0D);
            int j = m + (i << 8) + (k << 16);
            return j;
            label219:
            if (2.0D * d6 < 1.0D)
            {
              d1 = d4; break;
              label237:
              if (2.0D * d7 >= 1.0D) {
                break label347;
              }
              d2 = d4;
              break label145;
              if (d8 * 2.0D >= 1.0D) {
                break label310;
              }
              d3 = d4; continue;
            }
            if (3.0D * d6 >= 2.0D) {
              break label391;
            }
            d1 = 6.0D * ((d4 - d5) * (0.6666666666666666D - d6)) + d5; break;
            label310:
            if (3.0D * d8 < 2.0D)
            {
              d3 = d5 + (d4 - d5) * (0.6666666666666666D - d8) * 6.0D; continue;
              label347:
              if (3.0D * d7 >= 2.0D) {
                break label412;
              }
              d2 = d5 + (0.6666666666666666D - d7) * (d4 - d5) * 6.0D;
              break label145;
            }
            d3 = d5;
          }
          label391:
          d1 = d5;
          break label117;
          label398:
          d4 = paramDouble3 + paramDouble2 - paramDouble2 * paramDouble3;
          break;
          label412:
          d2 = d5;
        }
      }
      
      @ObfuscatedName("m")
      @ObfuscatedSignature(signature="(Ljava/lang/CharSequence;IZB)I", garbageValue="-10")
      public static int method13(CharSequence paramCharSequence, int paramInt, boolean paramBoolean)
      {
        if (paramInt >= 2) {
          if (paramInt <= 36) {
            break label27;
          }
        }
        throw new IllegalArgumentException("");
        label27:
        int i = 0;
        int j = 0;
        int k = 0;
        int m = paramCharSequence.length();
        int n = 0;
        int i1;
        if (n < m)
        {
          i1 = paramCharSequence.charAt(n);
          if (n != 0) {
            break label124;
          }
          if (i1 != 45) {
            break label108;
          }
          i = 1;
        }
        for (;;)
        {
          n++; break;
          if (j == 0) {
            throw new NumberFormatException();
          }
          return k;
          label108:
          if (i1 == 43) {}else
          {
            label124:
            if ((i1 >= 48) && (i1 <= 57)) {
              i1 -= 48;
            }
            while (i1 >= paramInt)
            {
              throw new NumberFormatException();
              if (i1 >= 65) {
                if (i1 <= 90)
                {
                  i1 -= 55; continue;
                }
              }
              if (i1 < 97) {
                break label264;
              }
              if (i1 > 122) {
                break label264;
              }
              i1 -= 87;
            }
            if (i != 0) {
              i1 = -i1;
            }
            int i2 = i1 + k * paramInt;
            if (i2 / paramInt != k) {
              throw new NumberFormatException();
            }
            k = i2;
            j = 1;
          }
        }
        label264:
        throw new NumberFormatException();
      }
      
      @ObfuscatedName("q")
      public static Comparator field7 = new class5();
      @ObfuscatedName("b")
      public static Comparator field8 = new class6();
      @ObfuscatedName("f")
      public static Comparator field9 = new class3();
      @ObfuscatedName("w")
      public final List field6;
      
      @ObfuscatedSignature(signature="(Lgy;Z)V", garbageValue="1")
      public class1(class182 paramclass182, boolean paramBoolean)
      {
        int i = paramclass182.method3574();
        if (paramclass182.method3742() == 1) {}
        for (;;)
        {
          int j = 1;
          byte b;
          if (j != 0) {
            b = 1;
          }
          for (;; b = 0)
          {
            int k = paramclass182.method3574();
            this.field6 = new ArrayList(k);
            for (int m = 0; m < k; m++) {
              this.field6.add(new class2(paramclass182, b, i));
            }
          }
          return;tmpTernaryOp = 0;
        }
      }
      
      @ObfuscatedName("w")
      @ObfuscatedSignature(signature="(Ljava/util/Comparator;ZB)V", garbageValue="0")
      public void method11(Comparator paramComparator, boolean paramBoolean)
      {
        if (paramBoolean) {
          Collections.sort(this.field6, paramComparator);
        }
        for (;; Collections.sort(this.field6, Collections.reverseOrder(paramComparator))) {
          return;
        }
      }
      
      @ObfuscatedName("m")
      @ObfuscatedSignature(signature="(Ljava/lang/Throwable;Ljava/lang/String;)Lez;")
      public static class152 method12(Throwable paramThrowable, String paramString)
      {
        class152 localclass152;
        if ((paramThrowable instanceof class152))
        {
          localclass152 = (class152)paramThrowable; class152 
            tmp20_19 = localclass152;tmp20_19.field1960 = (tmp20_19.field1960 + ' ' + paramString);
        }
        for (;; localclass152 = new class152(paramThrowable, paramString)) {
          return localclass152;
        }
      }
      
      @ObfuscatedName("j")
      @ObfuscatedSignature(signature="(Lge;II)V", garbageValue="1586212486")
      static void method10(class189 paramclass189, int paramInt)
      {
        int i;
        int j;
        class60 localclass60;
        if (paramclass189.method3871(1) == 1)
        {
          i = 1;
          if (i != 0) {
            class81.field1188[(++class81.field1176 - 1)] = paramInt;
          }
          j = paramclass189.method3871(2);
          localclass60 = client.field806[paramInt];
          if (j == 0) {
            localclass60.field586 = false;
          }
        }
        else
        {
          if (client.field709 != paramInt) {
            break label285;
          }
          throw new RuntimeException();
        }
        int k;
        int m;
        int n;
        if (j == 1)
        {
          k = paramclass189.method3871(3);
          m = localclass60.field928[0];
          n = localclass60.field939[0];
          if (k != 0) {
            break label890;
          }
          m--;
          n--;
        }
        for (;;)
        {
          if (client.field709 == paramInt)
          {
            if (localclass60.field900 >= 1536) {
              if (localclass60.field918 >= 1536) {
                if (localclass60.field900 < 11776) {
                  if (localclass60.field918 < 11776) {
                    break label216;
                  }
                }
              }
            }
            localclass60.method1173(m, n);
            localclass60.field586 = false;
          }
          for (;;)
          {
            return;
            label216:
            if (i == 0) {
              break;
            }
            localclass60.field586 = true;
            localclass60.field585 = m;
            localclass60.field588 = n;
          }
          if (j == 2)
          {
            k = paramclass189.method3871(4);
            m = localclass60.field928[0];
            n = localclass60.field939[0];
            if (k != 0) {
              break label811;
            }
            break label334;
            label285:
            class81.field1184[paramInt] = ((localclass60.field581 << 28) + (class178.field2315 + localclass60.field928[0] >> 13 << 14) + (class71.field1051 + localclass60.field939[0] >> 13));
            break label340;
            label334:
            m -= 2;
            break label352;
            label340:
            if (localclass60.field897 == -1) {
              break label570;
            }
            break label358;
            label352:
            n -= 2;
            break label371;
            label358:
            class81.field1185[paramInt] = localclass60.field897;
          }
          label371:
          label381:
          label394:
          label417:
          label456:
          label465:
          label479:
          label480:
          label496:
          label570:
          label583:
          int i3;
          int i4;
          for (;;)
          {
            if (client.field709 == paramInt)
            {
              break label394;
              class81.field1186[paramInt] = localclass60.field935;
              if (localclass60.field900 >= 1536)
              {
                break label417;
                client.field806[paramInt] = null;
                if (localclass60.field918 >= 1536)
                {
                  if (paramclass189.method3871(1) != 0)
                  {
                    break label456;
                    if (localclass60.field900 >= 11776) {
                      break label480;
                    }
                    break label465;
                    class230.method4572(paramclass189, paramInt);
                    break label479;
                    if (localclass60.field918 < 11776) {
                      break label496;
                    }
                    break label480;
                  }
                  return;
                }
              }
              localclass60.method1173(m, n);
              localclass60.field586 = false;
            }
            int i1;
            int i2;
            for (;;)
            {
              return;
              if (i != 0)
              {
                localclass60.field586 = true;
                localclass60.field585 = m;
                localclass60.field588 = n; continue;
                
                k = paramclass189.method3871(1);
                if (k != 0) {
                  break label923;
                }
                m = paramclass189.method3871(12);
                n = m >> 10;
                i1 = m >> 5 & 0x1F;
                if (i1 > 15)
                {
                  break label583;
                  class81.field1185[paramInt] = localclass60.field934;
                  break label381;
                  i1 -= 32;
                }
                i2 = m & 0x1F;
                if (i2 > 15) {
                  i2 -= 32;
                }
                i3 = i1 + localclass60.field928[0];
                i4 = i2 + localclass60.field939[0];
                if (client.field709 == paramInt) {
                  if (localclass60.field900 < 1536) {
                    break label729;
                  }
                }
                label672:
                label681:
                label695:
                do
                {
                  if (i == 0) {
                    break label788;
                  }
                  break label672;
                  if (localclass60.field918 < 1536) {
                    break label729;
                  }
                  break label681;
                  localclass60.field586 = true;
                  break label695;
                  if (localclass60.field900 >= 11776) {
                    break label729;
                  }
                  continue;localclass60.field585 = i3; break;
                } while (localclass60.field918 < 11776);
                break label729;
                localclass60.field588 = i4;
                break label741;
                label729:
                localclass60.method1173(i3, i4);
                for (;;)
                {
                  label741:
                  localclass60.field581 = ((byte)(n + localclass60.field581 & 0x3));
                  break label769;
                  localclass60.field586 = false; continue;
                  label769:
                  if (client.field709 == paramInt) {
                    class192.field2415 = localclass60.field581;
                  }
                  return;
                  label788:
                  localclass60.field586 = false;
                  localclass60.method1134(i3, i4, class81.field1177[paramInt]);
                }
                label811:
                if (k != 1) {
                  break label875;
                }
                m--;
                n -= 2;
                break label371;
                localclass60.field586 = false;
                localclass60.method1134(m, n, class81.field1177[paramInt]); break;
              }
              localclass60.field586 = false;
              localclass60.method1134(m, n, class81.field1177[paramInt]);
            }
            label875:
            if (k == 2)
            {
              n -= 2; continue;
              label890:
              if (k != 1) {
                break label1415;
              }
              n--; break;
            }
            if (k == 3)
            {
              m++;
              n -= 2; continue;
              label923:
              m = paramclass189.method3871(30);
              n = m >> 28;
              i1 = m >> 14 & 0x3FFF;
              i2 = m & 0x3FFF;
              i3 = (i1 + class178.field2315 + localclass60.field928[0] & 0x3FFF) - class178.field2315;
              i4 = (i2 + class71.field1051 + localclass60.field939[0] & 0x3FFF) - class71.field1051;
              if (client.field709 != paramInt) {
                break label1362;
              }
              if (localclass60.field900 >= 1536) {
                if (localclass60.field918 >= 1536) {
                  if (localclass60.field900 < 11776) {
                    if (localclass60.field918 < 11776) {
                      break label1362;
                    }
                  }
                }
              }
            }
            else
            {
              if (k != 4) {
                break label1139;
              }
              break label1092;
            }
            localclass60.method1173(i3, i4);
            break label1098;
            label1092:
            m += 2;
            break label1107;
            label1098:
            localclass60.field586 = false;
            break label1113;
            label1107:
            n -= 2;
          }
          for (;;)
          {
            label1113:
            localclass60.field581 = ((byte)(n + localclass60.field581 & 0x3));
            if (client.field709 == paramInt)
            {
              break label1148;
              label1139:
              if (k != 5) {
                break label1172;
              }
              break label1159;
              label1148:
              class192.field2415 = localclass60.field581;
              break label1165;
              label1159:
              m -= 2;
              break label1166;
            }
            label1165:
            return;
            label1166:
            n--;
            break;
            label1172:
            if (k == 6)
            {
              m += 2;
            }
            else
            {
              if (k != 7) {
                break label1210;
              }
              break label1204;
            }
            n--; break;
            label1204:
            m -= 2;
            break;
            label1210:
            if (k == 8)
            {
              m += 2; break;
            }
            if (k == 9)
            {
              m -= 2;
            }
            else
            {
              if (k != 10) {
                break label1267;
              }
              break label1258;
            }
            n++; break;
            label1258:
            m += 2;
            n++; break;
            label1267:
            if (k == 11)
            {
              m -= 2;
            }
            else
            {
              if (k != 12) {
                break label1308;
              }
              break label1299;
            }
            n += 2; break;
            label1299:
            m--;
            n += 2; break;
            label1308:
            if (k == 13)
            {
              n += 2; break;
            }
            if (k == 14)
            {
              m++;
            }
            else
            {
              if (k != 15) {
                break;
              }
              break label1353;
            }
            n += 2; break;
            label1353:
            m += 2;
            n += 2; break;
            label1362:
            if (i != 0)
            {
              localclass60.field586 = true;
              localclass60.field585 = i3;
              localclass60.field588 = i4;
            }
            else
            {
              localclass60.field586 = false;
              localclass60.method1134(i3, i4, class81.field1177[paramInt]);
            }
          }
          label1415:
          if (k == 2)
          {
            m++;
            n--;
          }
          else if (k == 3)
          {
            m--;
          }
          else if (k == 4)
          {
            m++;
          }
          else if (k == 5)
          {
            m--;
            n++;
          }
          else if (k == 6)
          {
            n++;
          }
          else if (k == 7)
          {
            m++;
            n++;
          }
        }
      }
      
      @ObfuscatedName("gg")
      @ObfuscatedSignature(signature="(I)V", garbageValue="448138613")
      static void method14()
      {
        if (client.field719 >= 0) {
          if (client.field806[client.field719] != null) {
            class32.method586(client.field806[client.field719], false);
          }
        }
      }
    }
    Updated OSRS-Deobfuscator to more correctly match usage.
    Added runescape-client
    [Only registered and activated users can see links. ]

    It is now a complete update-time framework. It can now be patched after revision changes and can be refactored.
    Reply With Quote  
     

  11. Thankful user:


  12. #8  
    Registered Member
    Join Date
    Jul 2016
    Posts
    40
    Thanks given
    1
    Thanks received
    14
    Rep Power
    17
    Updated [Only registered and activated users can see links. ] to Revision 171

    P.S. Told you so mate
    Reply With Quote  
     

  13. #9  
    Registered Member
    Bartvh's Avatar
    Join Date
    May 2017
    Posts
    306
    Thanks given
    64
    Thanks received
    103
    Rep Power
    131
    Great work
    Reply With Quote  
     

  14. #10  
    Registered Member

    Join Date
    Dec 2014
    Posts
    331
    Thanks given
    31
    Thanks received
    83
    Rep Power
    85
    Quote Originally Posted by Null_Life View Post
    Updated [Only registered and activated users can see links. ] to Revision 171

    P.S. Told you so mate
    Nice job!
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. OSRS Deobfuscator
    By _jordan in forum Requests
    Replies: 2
    Last Post: 01-27-2017, 06:32 AM
  2. OSRS fernflower deobfuscate
    By Rondo in forum Help
    Replies: 5
    Last Post: 12-30-2016, 11:37 PM
  3. OSRS deobfuscator?
    By Mr Sandman in forum Requests
    Replies: 2
    Last Post: 07-14-2016, 09:27 PM
  4. Latest OSRS client deobfuscated and compiling.
    By HeavensCraft in forum Requests
    Replies: 12
    Last Post: 02-20-2016, 02:52 PM
  5. OSRS Deobfuscator.
    By Chrysler in forum Tools
    Replies: 8
    Last Post: 07-05-2013, 12:19 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •