diff --git a/de4dot.code/deobfuscators/dotNET_Reactor/v4/Deobfuscator.cs b/de4dot.code/deobfuscators/dotNET_Reactor/v4/Deobfuscator.cs index 99087796a..fc2a68fc6 100644 --- a/de4dot.code/deobfuscators/dotNET_Reactor/v4/Deobfuscator.cs +++ b/de4dot.code/deobfuscators/dotNET_Reactor/v4/Deobfuscator.cs @@ -446,8 +446,10 @@ public override void DeobfuscateBegin() { proxyCallFixer.FindDelegateCreator(); proxyCallFixer.Find(); - stringDecrypter.Initialize(peImage, fileData, DeobfuscatedFile); - if (!stringDecrypter.Detected) + bool decryptStrings = Operations.DecryptStrings == OpDecryptString.Static; + if (decryptStrings) + stringDecrypter.Initialize(peImage, fileData, DeobfuscatedFile); + if (!stringDecrypter.Detected || !decryptStrings) FreePEImage(); booleanDecrypter.Initialize(fileData, DeobfuscatedFile); booleanValueInliner = new BooleanValueInliner(); @@ -459,15 +461,17 @@ public override void DeobfuscateBegin() { }); } - foreach (var info in stringDecrypter.DecrypterInfos) { - staticStringInliner.Add(info.method, (method2, gim, args) => { - return stringDecrypter.Decrypt(method2, (int)args[0]); - }); - } - if (stringDecrypter.OtherStringDecrypter != null) { - staticStringInliner.Add(stringDecrypter.OtherStringDecrypter, (method2, gim, args) => { - return stringDecrypter.Decrypt((string)args[0]); - }); + if (decryptStrings) { + foreach (var info in stringDecrypter.DecrypterInfos) { + staticStringInliner.Add(info.method, (method2, gim, args) => { + return stringDecrypter.Decrypt(method2, (int)args[0]); + }); + } + if (stringDecrypter.OtherStringDecrypter != null) { + staticStringInliner.Add(stringDecrypter.OtherStringDecrypter, (method2, gim, args) => { + return stringDecrypter.Decrypt((string)args[0]); + }); + } } DeobfuscatedFile.StringDecryptersAdded();