From 730505fd4f573ef12fa018f567fe3884afea1645 Mon Sep 17 00:00:00 2001 From: de4dot Date: Mon, 21 Oct 2013 07:29:20 +0200 Subject: [PATCH] Write a message if decryption probably failed --- .../deobfuscators/MaxtoCode/MethodsDecrypter.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/de4dot.code/deobfuscators/MaxtoCode/MethodsDecrypter.cs b/de4dot.code/deobfuscators/MaxtoCode/MethodsDecrypter.cs index ea296afc..27cfb8b8 100644 --- a/de4dot.code/deobfuscators/MaxtoCode/MethodsDecrypter.cs +++ b/de4dot.code/deobfuscators/MaxtoCode/MethodsDecrypter.cs @@ -255,15 +255,25 @@ namespace de4dot.code.deobfuscators.MaxtoCode { } } + Dictionary savedInfos = null; foreach (var decrypter in decrypters) { try { - if (InitializeInfos2(decrypter)) - return true; + if (InitializeInfos2(decrypter)) { + if (savedInfos != null) { + Logger.w("Decryption probably failed. Make sure the correct MaxtoCode runtime file is present."); + break; + } + savedInfos = infos; + infos = new Dictionary(); + } } catch { } } - return false; + if (savedInfos == null) + return false; + infos = savedInfos; + return true; } IDecrypter GetCorrectDecrypter(uint timeStamp) {