Thread: Client streams naming

Results 1 to 6 of 6
  1. #1 Client streams naming 
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    Streams:

    Do this one would be "readShortLE128" or "readUnsignedShortLE128"?
    Code:
    public int method13117() {
    		index += -602230638;
    		return ((buffer[index * 1211505145 - 1] - 128 & 0xff) + ((buffer[index * 1211505145 - 2] & 0xff) << 8));
    	}
    Do this one would be "readBytes"?
    Code:
    public void method13026(byte[] is, int i, int i_86_, byte i_87_) {
    		for (int i_88_ = i_86_ + i - 1; i_88_ >= i; i_88_--) {
    			if (i_87_ >= 17) {
    				break;
    			}
    			is[i_88_] = buffer[(index += -301115319) * 1211505145 - 1];
    		}
    	}
    Thanks, rep++
    Reply With Quote  
     

  2. #2  
    Extreme Donator


    Join Date
    Nov 2011
    Posts
    311
    Thanks given
    15
    Thanks received
    94
    Rep Power
    361
    The first one is, readUnsignedShortBEAdd.
    Second one is readBytesReverse or readBytes
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    rage against the dying of the light


    Join Date
    Sep 2016
    Posts
    293
    Thanks given
    103
    Thanks received
    92
    Rep Power
    197
    Method naming is fairly arbitrary since we do not have confirmed names, but I believe the first method would be readUnsignedLEShortA. The 'LE' is to indicate little endianness, as indicated by the smaller value (the value without the bit shift operation) being stored as the first byte. Without the integer obfuscation, the method should look something like this:

    Code:
    public int readUnsignedLEShortA {
    	index += 2;
    	return ((buffer[index - 1] - 128 & 0xff) + ((buffer[index - 2] & 0xff << 8));
    }
    The second method is correct, appropriately named readBytes. I usually clean up refactored methods, so I would recommend removing the empty if-statement, as it does nothing. Without the integer obfuscation, the method should look something like this:

    Code:
    public void getBytes(byte[] input, int offset, int length) {
    	for (int index = offset; index < length + offset; index++) {
    		input[index] = buffer[++index -  1];
    	}
    }
    I am writing this at work so I apologize if it feels rushed or incomplete; feel free to ask more questions if I left anything out!

    Edit and note: the second method, as mentioned below, is actually the reversed readBytes method, but I did not pay enough attention and posted before thoroughly reading through it.
    Last edited by Jintishi; 05-05-2018 at 07:35 PM. Reason: Revising the second method.
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Registered Member
    Join Date
    Jul 2016
    Posts
    186
    Thanks given
    76
    Thanks received
    39
    Rep Power
    41
    Quote Originally Posted by Terrowin View Post
    Method naming is fairly arbitrary since we do not have confirmed names, but I believe the first method would be readUnsignedLEShortA. The 'LE' is to indicate little endianness, as indicated by the smaller value (the value without the bit shift operation) being stored as the first byte. Without the integer obfuscation, the method should look something like this:

    Code:
    public int readUnsignedLEShortA {
    	index += 2;
    	return ((buffer[index - 1] - 128 & 0xff) + ((buffer[index - 2] & 0xff << 8));
    }
    The second method is correct, appropriately named readBytes. I usually clean up refactored methods, so I would recommend removing the empty if-statement, as it does nothing. Without the integer obfuscation, the method should look something like this:

    Code:
    public void getBytes(byte[] input, int offset, int length) {
    	for (int index = offset; index < length + offset; index++) {
    		input[index] = buffer[++index -  1];
    	}
    }
    I am writing this at work so I apologize if it feels rushed or incomplete; feel free to ask more questions if I left anything out!

    Isn't the second one readReversed? You have it as index++ but in the method stimulant posted, it is --:

    Code:
    public void method13026(byte[] is, int i, int i_86_, byte i_87_) {
    		for (int i_88_ = i_86_ + i - 1; i_88_ >= i; i_88_--) {
    			if (i_87_ >= 17) {
    				break;
    			}
    			is[i_88_] = buffer[(index += -301115319) * 1211505145 - 1];
    		}
    	}
    Reply With Quote  
     

  7. Thankful users:


  8. #5  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by BloodLie View Post
    Isn't the second one readReversed? You have it as index++ but in the method stimulant posted, it is --:

    Code:
    public void method13026(byte[] is, int i, int i_86_, byte i_87_) {
    		for (int i_88_ = i_86_ + i - 1; i_88_ >= i; i_88_--) {
    			if (i_87_ >= 17) {
    				break;
    			}
    			is[i_88_] = buffer[(index += -301115319) * 1211505145 - 1];
    		}
    	}
    Yes it is.

    @OP, regarding the first question. It's easy to determine whether the method is signed or unsigned. You can spot it simply by looking for the 'bitwise and' sign, AKA &. In the first method you have '& 0xff' at the end of each byte. 0xff = 255, AKA 127 + 128 (ignoring the sign, because that's what it does)
    Attached image
    Reply With Quote  
     

  9. Thankful users:


  10. #6  
    rage against the dying of the light


    Join Date
    Sep 2016
    Posts
    293
    Thanks given
    103
    Thanks received
    92
    Rep Power
    197
    Quote Originally Posted by BloodLie View Post
    Isn't the second one readReversed? You have it as index++ but in the method stimulant posted, it is --[/code]
    Indeed, it is. I didn't pay enough attention to the sign before posting. I'll update my previous post now. Thanks for pointing that out!
    Reply With Quote  
     

  11. Thankful user:



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. pi client turn name off/on or hit 10x
    By Romania Clan in forum Help
    Replies: 2
    Last Post: 10-12-2010, 10:38 PM
  2. [Galkon's Base]Change Client Title/Name.
    By .:Jack:. in forum Snippets
    Replies: 2
    Last Post: 11-30-2009, 11:08 PM
  3. [525] Client streams And packets help
    By Silicity in forum Help
    Replies: 0
    Last Post: 04-20-2009, 10:28 PM
  4. 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
  5. Client Stream 23% Refractored VS
    By wizzyt21 in forum Tutorials
    Replies: 7
    Last Post: 12-22-2008, 11:47 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
  •