From 25f217e3a304b0fd38730450455c331a252bf9df Mon Sep 17 00:00:00 2001 From: Chuck Lu Date: Fri, 6 Sep 2019 18:32:10 +0800 Subject: [PATCH] make sure the program will not crash when encounter exception --- de4dot-x64/Program.cs | 14 +++++++++++++- de4dot/Program.cs | 19 ++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/de4dot-x64/Program.cs b/de4dot-x64/Program.cs index bd728449..4a994031 100644 --- a/de4dot-x64/Program.cs +++ b/de4dot-x64/Program.cs @@ -17,10 +17,22 @@ along with de4dot. If not, see . */ +using System; + namespace de4dot_x64 { class Program { static int Main(string[] args) { - return de4dot.cui.Program.Main(args); + int returnValue = 0; + try + { + returnValue = de4dot.cui.Program.Main(args); + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + + return returnValue; } } } diff --git a/de4dot/Program.cs b/de4dot/Program.cs index 7a9cb796..eec575ac 100644 --- a/de4dot/Program.cs +++ b/de4dot/Program.cs @@ -17,10 +17,23 @@ along with de4dot. If not, see . */ +using System; + namespace de4dot_x86 { class Program { - static int Main(string[] args) { - return de4dot.cui.Program.Main(args); - } + static int Main(string[] args) + { + int returnValue = 0; + try + { + returnValue = de4dot.cui.Program.Main(args); + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + + return returnValue; + } } }