Rename method, update code
This commit is contained in:
parent
63648a9505
commit
24076419dc
|
@ -92,14 +92,18 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
|||
}
|
||||
|
||||
public byte[] unpack() {
|
||||
byte[] data = null;
|
||||
try {
|
||||
return unpack2();
|
||||
data = unpack2();
|
||||
}
|
||||
catch {
|
||||
if (shouldUnpack)
|
||||
Log.w("Could not unpack the file");
|
||||
return null;
|
||||
}
|
||||
if (data != null)
|
||||
return data;
|
||||
|
||||
if (shouldUnpack)
|
||||
Log.w("Could not unpack the file");
|
||||
return null;
|
||||
}
|
||||
|
||||
byte[] unpack2() {
|
||||
|
|
|
@ -96,8 +96,8 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
|||
continue;
|
||||
|
||||
decrypterType = type;
|
||||
stringDecrypter1 = addStringDecrypter(type, "CS$0$0004");
|
||||
stringDecrypter2 = addStringDecrypter(type, "CS$0$0005");
|
||||
stringDecrypter1 = getStringDecrypter(type, "CS$0$0004");
|
||||
stringDecrypter2 = getStringDecrypter(type, "CS$0$0005");
|
||||
foreach (var method in type.Methods) {
|
||||
if (DotNetUtils.isMethod(method, "System.Void", "()"))
|
||||
initMethods.Add(method);
|
||||
|
@ -132,7 +132,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
|||
}
|
||||
}
|
||||
|
||||
MethodDefinition addStringDecrypter(TypeDefinition type, string name) {
|
||||
MethodDefinition getStringDecrypter(TypeDefinition type, string name) {
|
||||
var method = DotNetUtils.getMethod(type, name);
|
||||
if (method == null)
|
||||
return null;
|
||||
|
@ -185,7 +185,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
|||
if (startedPatchingBadData && value == 0x3115)
|
||||
continue;
|
||||
|
||||
startedPatchingBadData |= peImage.dotNetSafeWrite(rva, BitConverter.GetBytes(value));
|
||||
startedPatchingBadData |= !peImage.dotNetSafeWrite(rva, BitConverter.GetBytes(value));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -125,12 +125,12 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
|||
}
|
||||
|
||||
public override byte[] unpackNativeFile(PeImage peImage) {
|
||||
var unpackerv3 = new ApplicationModeUnpacker(peImage);
|
||||
var data = unpackerv3.unpack();
|
||||
var unpacker = new ApplicationModeUnpacker(peImage);
|
||||
var data = unpacker.unpack();
|
||||
if (data == null)
|
||||
return null;
|
||||
|
||||
unpackedFiles.AddRange(unpackerv3.EmbeddedAssemblies);
|
||||
unpackedFiles.AddRange(unpacker.EmbeddedAssemblies);
|
||||
unpackedNativeFile = true;
|
||||
ModuleBytes = data;
|
||||
return data;
|
||||
|
|
Loading…
Reference in New Issue
Block a user