Rename locals and fix problem with huge strings
This commit is contained in:
parent
6e188aa7e0
commit
d1e499454e
|
@ -690,17 +690,17 @@ namespace de4dot.code.deobfuscators.MaxtoCode {
|
||||||
}
|
}
|
||||||
|
|
||||||
int usHeapOffsetOrig = usHeapOffset;
|
int usHeapOffsetOrig = usHeapOffset;
|
||||||
int len = DeobUtils.readVariableLengthInt32(fileData, ref usHeapOffset);
|
int stringDataLength = DeobUtils.readVariableLengthInt32(fileData, ref usHeapOffset);
|
||||||
int usHeapOffsetString = usHeapOffset;
|
int usHeapOffsetString = usHeapOffset;
|
||||||
int stringLength = len - (usHeapOffset - usHeapOffsetOrig);
|
int encryptedLength = stringDataLength - (usHeapOffset - usHeapOffsetOrig == 1 ? 1 : 2);
|
||||||
for (int i = 0; i < stringLength; i++) {
|
for (int i = 0; i < encryptedLength; i++) {
|
||||||
byte k = mcKey.readByte(mcKeyOffset++ % 0x2000);
|
byte k = mcKey.readByte(mcKeyOffset++ % 0x2000);
|
||||||
fileData[usHeapOffset] = rolb((byte)(fileData[usHeapOffset] ^ k), 3);
|
fileData[usHeapOffset] = rolb((byte)(fileData[usHeapOffset] ^ k), 3);
|
||||||
usHeapOffset++;
|
usHeapOffset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Log.v("Decrypted string: {0}", Utils.toCsharpString(Encoding.Unicode.GetString(fileData, usHeapOffsetString, (stringLength + 1) & ~1)));
|
Log.v("Decrypted string: {0}", Utils.toCsharpString(Encoding.Unicode.GetString(fileData, usHeapOffsetString, stringDataLength - 1)));
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Log.v("Could not decrypt string at offset {0:X8}", usHeapOffsetOrig);
|
Log.v("Could not decrypt string at offset {0:X8}", usHeapOffsetOrig);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user