Check for null

This commit is contained in:
de4dot 2012-10-14 10:30:38 +02:00
parent c4e9097a4e
commit 0b9f188353

View File

@ -380,14 +380,14 @@ namespace de4dot.code.deobfuscators.Confuser {
addTypeToBeRemoved(memoryMethodsDecrypter.Type, "Method decrypter (memory) type"); addTypeToBeRemoved(memoryMethodsDecrypter.Type, "Method decrypter (memory) type");
} }
if (options.RemoveAntiDebug) { if (options.RemoveAntiDebug && antiDebugger != null) {
addModuleCctorInitCallToBeRemoved(antiDebugger.InitMethod); addModuleCctorInitCallToBeRemoved(antiDebugger.InitMethod);
addTypeToBeRemoved(antiDebugger.Type, "Anti debugger type"); addTypeToBeRemoved(antiDebugger.Type, "Anti debugger type");
if (antiDebugger.Type == DotNetUtils.getModuleType(module)) if (antiDebugger.Type == DotNetUtils.getModuleType(module))
addMethodToBeRemoved(antiDebugger.InitMethod, "Anti debugger method"); addMethodToBeRemoved(antiDebugger.InitMethod, "Anti debugger method");
} }
if (options.RemoveAntiDump) { if (options.RemoveAntiDump && antiDumping != null) {
addModuleCctorInitCallToBeRemoved(antiDumping.InitMethod); addModuleCctorInitCallToBeRemoved(antiDumping.InitMethod);
addTypeToBeRemoved(antiDumping.Type, "Anti dumping type"); addTypeToBeRemoved(antiDumping.Type, "Anti dumping type");
} }
@ -585,7 +585,8 @@ namespace de4dot.code.deobfuscators.Confuser {
addFieldsToBeRemoved(proxyCallFixer.Fields, "Proxy delegate instance field"); addFieldsToBeRemoved(proxyCallFixer.Fields, "Proxy delegate instance field");
proxyCallFixer.cleanUp(); proxyCallFixer.cleanUp();
} }
constantsDecrypterV18.cleanUp(); if (constantsDecrypterV18 != null)
constantsDecrypterV18.cleanUp();
if (CanRemoveStringDecrypterType) { if (CanRemoveStringDecrypterType) {
if (stringDecrypter != null) { if (stringDecrypter != null) {