The real Main() may be called from a DNR-created Main() method
This commit is contained in:
parent
78bb21832e
commit
00f7b7feda
|
@ -459,7 +459,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor {
|
||||||
addTypeToBeRemoved(resourceResolver.Type, "Resource decrypter type");
|
addTypeToBeRemoved(resourceResolver.Type, "Resource decrypter type");
|
||||||
removeResourceResolver = true;
|
removeResourceResolver = true;
|
||||||
}
|
}
|
||||||
addCallToBeRemoved(module.EntryPoint, resourceResolver.InitMethod);
|
addEntryPointCallToBeRemoved(resourceResolver.InitMethod);
|
||||||
addCctorInitCallToBeRemoved(resourceResolver.InitMethod);
|
addCctorInitCallToBeRemoved(resourceResolver.InitMethod);
|
||||||
}
|
}
|
||||||
if (resourceResolver.Detected && !removeResourceResolver && !resourceResolver.FoundResource)
|
if (resourceResolver.Detected && !removeResourceResolver && !resourceResolver.FoundResource)
|
||||||
|
@ -492,7 +492,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor {
|
||||||
if (options.DumpEmbeddedAssemblies) {
|
if (options.DumpEmbeddedAssemblies) {
|
||||||
if (options.InlineMethods)
|
if (options.InlineMethods)
|
||||||
addTypeToBeRemoved(assemblyResolver.Type, "Assembly resolver");
|
addTypeToBeRemoved(assemblyResolver.Type, "Assembly resolver");
|
||||||
addCallToBeRemoved(module.EntryPoint, assemblyResolver.InitMethod);
|
addEntryPointCallToBeRemoved(assemblyResolver.InitMethod);
|
||||||
addCctorInitCallToBeRemoved(assemblyResolver.InitMethod);
|
addCctorInitCallToBeRemoved(assemblyResolver.InitMethod);
|
||||||
dumpEmbeddedAssemblies();
|
dumpEmbeddedAssemblies();
|
||||||
}
|
}
|
||||||
|
@ -502,13 +502,20 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor {
|
||||||
|
|
||||||
addCctorInitCallToBeRemoved(emptyClass.Method);
|
addCctorInitCallToBeRemoved(emptyClass.Method);
|
||||||
addCtorInitCallToBeRemoved(emptyClass.Method);
|
addCtorInitCallToBeRemoved(emptyClass.Method);
|
||||||
addCallToBeRemoved(module.EntryPoint, emptyClass.Method);
|
addEntryPointCallToBeRemoved(emptyClass.Method);
|
||||||
if (options.InlineMethods)
|
if (options.InlineMethods)
|
||||||
addTypeToBeRemoved(emptyClass.Type, "Empty class");
|
addTypeToBeRemoved(emptyClass.Type, "Empty class");
|
||||||
|
|
||||||
startedDeobfuscating = true;
|
startedDeobfuscating = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addEntryPointCallToBeRemoved(MethodReference methodToBeRemoved) {
|
||||||
|
var entryPoint = module.EntryPoint;
|
||||||
|
addCallToBeRemoved(entryPoint, methodToBeRemoved);
|
||||||
|
foreach (var info in DotNetUtils.getCalledMethods(module, entryPoint))
|
||||||
|
addCallToBeRemoved(info.Item2, methodToBeRemoved);
|
||||||
|
}
|
||||||
|
|
||||||
void decryptResources() {
|
void decryptResources() {
|
||||||
var rsrc = resourceResolver.mergeResources();
|
var rsrc = resourceResolver.mergeResources();
|
||||||
if (rsrc == null)
|
if (rsrc == null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user