Thread: Intellij Plugin - Client Deobfuscation

Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 55
  1. #31  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by thing1 View Post
    Thinking about this as well, however one way to tackle the anInt10488 style variables may be to check if any comparisons are made with them. If I recall correctly, all of those are set to zero by default and then only incremented but never compared against.

    I think an interesting idea would be to implement a way to change all of the math in the client that is messy. An example would be:

    This:
    Code:
    (-text.getWidth(Client.loadingFontMetrics) + 304)
    To this:
    Code:
    (304 - text.getWidth(Client.loadingFontMetrics))
    This:
    Code:
    2 - -(3 * percent)
    To this:
    Code:
    percent * 3 + 2
    Other than dummies and this it seems that most of the client is pretty clean after running the plugin on it. Thanks for your contributions and good work!
    Could you give a code example of your first description?

    Seconds a good suggestion, will add when I find time

    The second one I just did a global find and replace for - - to +
    Seemed to work out fine
    Attached imageAttached image
    Reply With Quote  
     

  2. #32  
    Intellij Plugin - Client Deobfuscation



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    Interestingly I think "Inverse Else Comparator" exists for other languages as an inspection, but not Java for some reason. I've definitely had IntelliJ itself complain about negated if-statements in TypeScript.

    One thing that takes effort in reversing are methods like this:

    Code:
    	public static char toLower(char c) {
    		int i_0_ = c;
    	while_80_:
    		do {
    		while_79_:
    			do {
    			while_78_:
    				do {
    				while_77_:
    					do {
    					while_76_:
    						do {
    						while_75_:
    							do {
    							while_74_:
    								do {
    								while_73_:
    									do {
    									while_72_:
    										do {
    											do {
    												if (i_0_ != 32 && i_0_ != 160 && i_0_ != 95 && i_0_ != 45) {
    													if (i_0_ != 91 && i_0_ != 93 && i_0_ != 35) {
    														if (i_0_ != 224 && i_0_ != 225 && i_0_ != 226 && i_0_ != 228 && i_0_ != 227 && i_0_ != 192 && i_0_ != 193 && i_0_ != 194 && i_0_ != 196 && i_0_ != 195) {
    															if (i_0_ != 232 && i_0_ != 233 && i_0_ != 234 && i_0_ != 235 && i_0_ != 200 && i_0_ != 201 && i_0_ != 202 && i_0_ != 203) {
    																if (i_0_ != 237 && i_0_ != 238 && i_0_ != 239 && i_0_ != 205 && i_0_ != 206 && i_0_ != 207) {
    																	if (i_0_ != 242 && i_0_ != 243 && i_0_ != 244 && i_0_ != 246 && i_0_ != 245 && i_0_ != 210 && i_0_ != 211 && i_0_ != 212 && i_0_ != 214 && i_0_ != 213) {
    																		if (i_0_ != 249 && i_0_ != 250 && i_0_ != 251 && i_0_ != 252 && i_0_ != 217 && i_0_ != 218 && i_0_ != 219 && i_0_ != 220) {
    																			if (i_0_ != 231 && i_0_ != 199) {
    																				if (i_0_ != 255 && i_0_ != 376) {
    																					if (i_0_ != 241 && i_0_ != 209) {
    																						if (i_0_ == 223) {
    																							break while_79_;
    																						}
    																						break while_80_;
    																					}
    																				} else {
    																					break while_77_;
    																				}
    																				break while_78_;
    																			}
    																		} else {
    																			break while_75_;
    																		}
    																		break while_76_;
    																	}
    																} else {
    																	break while_73_;
    																}
    																break while_74_;
    															}
    														} else {
    															break;
    														}
    														break while_72_;
    													}
    												} else {
    													return '_';
    												}
    												return c;
    											} while (false);
    											return 'a';
    										} while (false);
    										return 'e';
    									} while (false);
    									return 'i';
    								} while (false);
    								return 'o';
    							} while (false);
    							return 'u';
    						} while (false);
    						return 'c';
    					} while (false);
    					return 'y';
    				} while (false);
    				return 'n';
    			} while (false);
    			return 'b';
    		} while (false);
    		return Character.toLowerCase(c);
    	}
    Could be worth figuring out how to collapse these down, as it's just a collection of if-else statements.
    Last edited by Scu11; 04-08-2019 at 12:04 PM.

    Attached image
    Reply With Quote  
     

  3. #33  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by Scu11 View Post
    Interestingly I think "Inverse Else Comparator" exists for other languages as an inspection, but not Java for some reason. I've definitely had IntelliJ itself complain about negated if-statements in TypeScript.

    One thing that takes effort in reversing are methods like this:

    Code:
    	public static char toLower(char c) {
    		int i_0_ = c;
    	while_80_:
    		do {
    		while_79_:
    			do {
    			while_78_:
    				do {
    				while_77_:
    					do {
    					while_76_:
    						do {
    						while_75_:
    							do {
    							while_74_:
    								do {
    								while_73_:
    									do {
    									while_72_:
    										do {
    											do {
    												if (i_0_ != 32 && i_0_ != 160 && i_0_ != 95 && i_0_ != 45) {
    													if (i_0_ != 91 && i_0_ != 93 && i_0_ != 35) {
    														if (i_0_ != 224 && i_0_ != 225 && i_0_ != 226 && i_0_ != 228 && i_0_ != 227 && i_0_ != 192 && i_0_ != 193 && i_0_ != 194 && i_0_ != 196 && i_0_ != 195) {
    															if (i_0_ != 232 && i_0_ != 233 && i_0_ != 234 && i_0_ != 235 && i_0_ != 200 && i_0_ != 201 && i_0_ != 202 && i_0_ != 203) {
    																if (i_0_ != 237 && i_0_ != 238 && i_0_ != 239 && i_0_ != 205 && i_0_ != 206 && i_0_ != 207) {
    																	if (i_0_ != 242 && i_0_ != 243 && i_0_ != 244 && i_0_ != 246 && i_0_ != 245 && i_0_ != 210 && i_0_ != 211 && i_0_ != 212 && i_0_ != 214 && i_0_ != 213) {
    																		if (i_0_ != 249 && i_0_ != 250 && i_0_ != 251 && i_0_ != 252 && i_0_ != 217 && i_0_ != 218 && i_0_ != 219 && i_0_ != 220) {
    																			if (i_0_ != 231 && i_0_ != 199) {
    																				if (i_0_ != 255 && i_0_ != 376) {
    																					if (i_0_ != 241 && i_0_ != 209) {
    																						if (i_0_ == 223) {
    																							break while_79_;
    																						}
    																						break while_80_;
    																					}
    																				} else {
    																					break while_77_;
    																				}
    																				break while_78_;
    																			}
    																		} else {
    																			break while_75_;
    																		}
    																		break while_76_;
    																	}
    																} else {
    																	break while_73_;
    																}
    																break while_74_;
    															}
    														} else {
    															break;
    														}
    														break while_72_;
    													}
    												} else {
    													return '_';
    												}
    												return c;
    											} while (false);
    											return 'a';
    										} while (false);
    										return 'e';
    									} while (false);
    									return 'i';
    								} while (false);
    								return 'o';
    							} while (false);
    							return 'u';
    						} while (false);
    						return 'c';
    					} while (false);
    					return 'y';
    				} while (false);
    				return 'n';
    			} while (false);
    			return 'b';
    		} while (false);
    		return Character.toLowerCase(c);
    	}
    Could be worth figuring out how to collapse these down, as it's just a collection of if-else statements.
    They already are intellij inspections, if you have one selected the little yellow lightbulb pops up and you can reverse/inline; I essentially duplicated that and set specific situations for it to highlight.

    Yes I've looked at that exact method, it's a fair bit more complex than what I've done so far but should be possible
    Attached imageAttached image
    Reply With Quote  
     

  4. #34  
    Registered Member
    thing1's Avatar
    Join Date
    Aug 2008
    Posts
    2,111
    Thanks given
    131
    Thanks received
    1,099
    Rep Power
    2402
    Quote Originally Posted by Greg View Post
    Could you give a code example of your first description?

    Seconds a good suggestion, will add when I find time

    The second one I just did a global find and replace for - - to +
    Seemed to work out fine
    I'll try that global find, thanks!

    Also absolutely, here would be an example (this is every use of the variable):

    Code:
    public static int anInt2759;
    
    public void method402(byte arg0, Stream arg1) {
    	anInt2759++;
    	if (arg0 != -65)
    		aRSString_2777 = null;
    	for (;;) {
    		int i = arg1.readUnsignedByte((byte) 123);
    		if ((i ^ 0xffffffff) == -1)
    			break;
    		method409((byte) -86, arg1, i);
    	}
    }
    
    public static void method844(int arg0) {
    	RSInterface.anInt2389 = 0;
    	Class48.anInt1052 = 0;
    	Node_Sub6_Sub4_Sub4.anInt3467 = 0;
    	PacketParser.anInt2759 = 0;
    	Player.anInt3739 = 0;
    Reply With Quote  
     

  5. #35  
    Intellij Plugin - Client Deobfuscation



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    Quote Originally Posted by thing1 View Post
    I'll try that global find, thanks!

    Also absolutely, here would be an example (this is every use of the variable):

    Code:
    public static int anInt2759;
    
    public void method402(byte arg0, Stream arg1) {
    	anInt2759++;
    	if (arg0 != -65)
    		aRSString_2777 = null;
    	for (;;) {
    		int i = arg1.readUnsignedByte((byte) 123);
    		if ((i ^ 0xffffffff) == -1)
    			break;
    		method409((byte) -86, arg1, i);
    	}
    }
    
    public static void method844(int arg0) {
    	RSInterface.anInt2389 = 0;
    	Class48.anInt1052 = 0;
    	Node_Sub6_Sub4_Sub4.anInt3467 = 0;
    	PacketParser.anInt2759 = 0;
    	Player.anInt3739 = 0;
    I guess you can summarise that by saying the variable is only ever assigned, not read.

    Attached image
    Reply With Quote  
     

  6. #36  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by thing1 View Post
    I'll try that global find, thanks!

    Also absolutely, here would be an example (this is every use of the variable):

    Code:
    public static int anInt2759;
    
    public void method402(byte arg0, Stream arg1) {
    	anInt2759++;
    	if (arg0 != -65)
    		aRSString_2777 = null;
    	for (;;) {
    		int i = arg1.readUnsignedByte((byte) 123);
    		if ((i ^ 0xffffffff) == -1)
    			break;
    		method409((byte) -86, arg1, i);
    	}
    }
    
    public static void method844(int arg0) {
    	RSInterface.anInt2389 = 0;
    	Class48.anInt1052 = 0;
    	Node_Sub6_Sub4_Sub4.anInt3467 = 0;
    	PacketParser.anInt2759 = 0;
    	Player.anInt3739 = 0;
    Find in project is: Ctrl + shift + f

    Quote Originally Posted by Scu11 View Post
    I guess you can summarise that by saying the variable is only ever assigned, not read.
    Thanks for the example, yeah intelli already has an inspection for that

    ctrl + shift + alt + i to run an inspection then search unused declaration
    Attached imageAttached image
    Reply With Quote  
     

  7. #37  
    Registered Member
    thing1's Avatar
    Join Date
    Aug 2008
    Posts
    2,111
    Thanks given
    131
    Thanks received
    1,099
    Rep Power
    2402
    Quote Originally Posted by Greg View Post
    Find in project is: Ctrl + shift + f



    Thanks for the example, yeah intelli already has an inspection for that

    ctrl + shift + alt + i to run an inspection then search unused declaration
    Was unaware of this, thanks for the heads up!

    - Edit -

    I ran that inspection but since they are incremented and set they do not appear in the 'Unused declaration' inspection. Possibly there is another built in feature I'll have to try next.

    Quote Originally Posted by Scu11 View Post
    I guess you can summarise that by saying the variable is only ever assigned, not read.
    Perhaps that would have been simpler, when I first explained it I tried to summarize by saying that no comparisons were made with it but your way or an example is probably better anyways .
    Reply With Quote  
     

  8. #38  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by thing1 View Post
    Was unaware of this, thanks for the heads up!

    - Edit -

    I ran that inspection but since they are incremented and set they do not appear in the 'Unused declaration' inspection. Possibly there is another built in feature I'll have to try next.



    Perhaps that would have been simpler, when I first explained it I tried to summarize by saying that no comparisons were made with it but an example is probably better anyways .
    Seems to work here 2019.1
    Attached image
    Attached imageAttached image
    Reply With Quote  
     

  9. #39  
    Registered Member
    thing1's Avatar
    Join Date
    Aug 2008
    Posts
    2,111
    Thanks given
    131
    Thanks received
    1,099
    Rep Power
    2402
    Quote Originally Posted by Greg View Post
    Seems to work here 2019.1
    Attached image
    I believe if you change it to public it will prevent it from working .

    Private:
    Attached image

    Public:
    Attached image

    Due to all of the ones in the client having to be public, my inspections aren't picking them up.
    Reply With Quote  
     

  10. Thankful users:


  11. #40  
    Registered Member
    Selseus's Avatar
    Join Date
    Aug 2017
    Posts
    386
    Thanks given
    11
    Thanks received
    73
    Rep Power
    84
    This is incredible and a really great selfless contribution to the community! This will help people that are really wanting to further the stability and organization of client code without knowing much about the structure and methods Jagex uses! Awesome shit
    Reply With Quote  
     

Page 4 of 6 FirstFirst ... 23456 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Intellij server & client
    By valiant in forum Help
    Replies: 9
    Last Post: 02-02-2018, 02:58 PM
  2. Intellij IDEA Client Running issue
    By Proto in forum Help
    Replies: 8
    Last Post: 01-31-2015, 01:21 AM
  3. RS2 Client Deobfuscator
    By Origin in forum Help
    Replies: 3
    Last Post: 06-11-2009, 08:44 PM
  4. Client deobfuscator.
    By Encouragin in forum Requests
    Replies: 5
    Last Post: 04-12-2009, 03:43 PM
  5. Deobfuscating? What are the client class names?
    By Virus X3 in forum RS 503+ Client & Server
    Replies: 9
    Last Post: 01-23-2009, 04:45 AM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •