From 120289d12bba93dcf402f10c8f2baebddb64463f Mon Sep 17 00:00:00 2001 From: de4dot Date: Sat, 16 Nov 2013 20:04:38 +0100 Subject: [PATCH] Write a warning message if runtime files are missing --- .../deobfuscators/ILProtector/DynamicMethodsRestorer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/de4dot.code/deobfuscators/ILProtector/DynamicMethodsRestorer.cs b/de4dot.code/deobfuscators/ILProtector/DynamicMethodsRestorer.cs index ecbff882..c54f007e 100644 --- a/de4dot.code/deobfuscators/ILProtector/DynamicMethodsRestorer.cs +++ b/de4dot.code/deobfuscators/ILProtector/DynamicMethodsRestorer.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; +using System.IO; using dnlib.DotNet; using AssemblyData; using de4dot.code.AssemblyClient; @@ -31,6 +32,7 @@ namespace de4dot.code.deobfuscators.ILProtector { } protected override void DecryptInternal() { + CheckRuntimeFiles(); IList decryptedData; var serverVersion = NewProcessAssemblyClientFactory.GetServerClrVersion(module); using (var client = new NewProcessAssemblyClientFactory(serverVersion).Create(AssemblyServiceType.Generic)) { @@ -49,6 +51,13 @@ namespace de4dot.code.deobfuscators.ILProtector { methodInfos[info.id] = info; } + void CheckRuntimeFiles() { + foreach (var info in mainType.RuntimeFileInfos) { + if (!File.Exists(info.PathName)) + Logger.w(string.Format("ILProtector runtime file '{0}' is missing.", info.PathName)); + } + } + IList GetMethodIds() { var ids = new List();