The first one is, readUnsignedShortBEAdd.
Second one is readBytesReverse or readBytes
|
Streams:
Do this one would be "readShortLE128" or "readUnsignedShortLE128"?
Do this one would be "readBytes"?Code:public int method13117() { index += -602230638; return ((buffer[index * 1211505145 - 1] - 128 & 0xff) + ((buffer[index * 1211505145 - 2] & 0xff) << 8)); }
Thanks, rep++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]; } }
The first one is, readUnsignedShortBEAdd.
Second one is readBytesReverse or readBytes
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:
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 int readUnsignedLEShortA { index += 2; return ((buffer[index - 1] - 128 & 0xff) + ((buffer[index - 2] & 0xff << 8)); }
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!Code:public void getBytes(byte[] input, int offset, int length) { for (int index = offset; index < length + offset; index++) { input[index] = buffer[++index - 1]; } }
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.
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)
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |