From d7149abe4e20e335f9cf248802769f2417b79f8f Mon Sep 17 00:00:00 2001 From: de4dot Date: Mon, 14 Nov 2011 06:21:43 +0100 Subject: [PATCH] Warn if an unused string decrypter is found --- de4dot.code/deobfuscators/SmartAssembly/Deobfuscator.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/de4dot.code/deobfuscators/SmartAssembly/Deobfuscator.cs b/de4dot.code/deobfuscators/SmartAssembly/Deobfuscator.cs index a6b30bc7..4751ef1b 100644 --- a/de4dot.code/deobfuscators/SmartAssembly/Deobfuscator.cs +++ b/de4dot.code/deobfuscators/SmartAssembly/Deobfuscator.cs @@ -394,11 +394,18 @@ namespace de4dot.deobfuscators.SmartAssembly { } if (initdInfo == null) - throw new ApplicationException("Could not initialize all stringDecrypterInfos"); + break; initd[initdInfo] = true; initStringDecrypter(initdInfo); } + + // Sometimes there could be a string decrypter present that isn't called by anyone. + foreach (var info in stringDecrypterInfos) { + if (initd.ContainsKey(info)) + continue; + Log.v("String decrypter not initialized. Token {0:X8}", info.StringsEncodingClass.MetadataToken.ToInt32()); + } } void initStringDecrypter(StringDecrypterInfo info) {