Check if cctor exists before using it
This commit is contained in:
parent
406afd01e3
commit
c019e21743
|
@ -247,10 +247,11 @@ namespace de4dot.code.deobfuscators.ConfuserEx
|
||||||
AddMethodsToBeRemoved(_controlFlowFixer.NativeMethods, "Control flow native methods");
|
AddMethodsToBeRemoved(_controlFlowFixer.NativeMethods, "Control flow native methods");
|
||||||
|
|
||||||
var moduleCctor = DotNetUtils.GetModuleTypeCctor(module);
|
var moduleCctor = DotNetUtils.GetModuleTypeCctor(module);
|
||||||
foreach (var instr in moduleCctor.Body.Instructions)
|
if (moduleCctor != null)
|
||||||
if (instr.OpCode == OpCodes.Call && instr.Operand is MethodDef
|
foreach (var instr in moduleCctor.Body.Instructions)
|
||||||
&& toRemoveFromCctor.Contains((MethodDef) instr.Operand))
|
if (instr.OpCode == OpCodes.Call && instr.Operand is MethodDef
|
||||||
instr.OpCode = OpCodes.Nop;
|
&& toRemoveFromCctor.Contains((MethodDef) instr.Operand))
|
||||||
|
instr.OpCode = OpCodes.Nop;
|
||||||
|
|
||||||
//TODO: Might not always be correct
|
//TODO: Might not always be correct
|
||||||
//No more mixed!
|
//No more mixed!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user