From 7c44c2616cdb0bf4ddc9020e3bb73b45f9098d15 Mon Sep 17 00:00:00 2001 From: de4dot Date: Thu, 14 Nov 2013 17:39:59 +0100 Subject: [PATCH] If an IOException is thrown, it's not a PE file --- de4dot.cui/FilesDeobfuscator.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/de4dot.cui/FilesDeobfuscator.cs b/de4dot.cui/FilesDeobfuscator.cs index f7106c4d..e16a2d35 100644 --- a/de4dot.cui/FilesDeobfuscator.cs +++ b/de4dot.cui/FilesDeobfuscator.cs @@ -229,6 +229,11 @@ namespace de4dot.cui { catch (EndOfStreamException) { return false; } + catch (IOException) { + if (isFromPossibleFiles) + Logger.Instance.Log(false, null, LoggerEvent.Warning, "The file isn't a .NET PE file: {0}", file.Filename); + return false; // Not a .NET file + } catch (Exception ex) { Logger.Instance.Log(false, null, LoggerEvent.Warning, "Could not load file ({0}): {1}", ex.GetType(), file.Filename); return false;