From a5da42093a430acbef3bbda6dd7ad79b0c40ef55 Mon Sep 17 00:00:00 2001 From: de4dot Date: Sun, 24 Nov 2013 07:07:05 +0100 Subject: [PATCH] Decrypt method is not always present --- .../Eazfuscator_NET/AssemblyResolver.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/de4dot.code/deobfuscators/Eazfuscator_NET/AssemblyResolver.cs b/de4dot.code/deobfuscators/Eazfuscator_NET/AssemblyResolver.cs index 023edce0..5569d247 100644 --- a/de4dot.code/deobfuscators/Eazfuscator_NET/AssemblyResolver.cs +++ b/de4dot.code/deobfuscators/Eazfuscator_NET/AssemblyResolver.cs @@ -186,7 +186,7 @@ namespace de4dot.code.deobfuscators.Eazfuscator_NET { return method; } - throw new ApplicationException("Could not find decrypt method"); + return null; } void UpdateDecrypterType() { @@ -228,10 +228,12 @@ namespace de4dot.code.deobfuscators.Eazfuscator_NET { if (!CreateAssemblyInfos()) throw new ApplicationException("Could not initialize assembly infos"); - simpleDeobfuscator.Deobfuscate(decryptMethod); - simpleDeobfuscator.DecryptStrings(decryptMethod, deob); - if (!CreateDecryptKey()) - throw new ApplicationException("Could not initialize decryption key"); + if (decryptMethod != null) { + simpleDeobfuscator.Deobfuscate(decryptMethod); + simpleDeobfuscator.DecryptStrings(decryptMethod, deob); + if (!CreateDecryptKey()) + throw new ApplicationException("Could not initialize decryption key"); + } } void FindOtherType() { @@ -274,6 +276,7 @@ namespace de4dot.code.deobfuscators.Eazfuscator_NET { return true; } + decryptKey = null; return false; }