From d9339f0cebad8f2898963b9bd5aed609d7976dac Mon Sep 17 00:00:00 2001 From: "Travis J. Gutjahr" <33809229+Squirrelies@users.noreply.github.com> Date: Tue, 12 Feb 2019 22:48:48 -0600 Subject: [PATCH] Explicitly setting ListModules's filter to check 64-bit modules only. Show error message to user rather than silently fail. It still shows in event viewer but now will show a message to the user. --- RE2REmakeSRT/GameMemory.cs | 2 +- RE2REmakeSRT/Program.cs | 2 ++ RE2REmakeSRT/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RE2REmakeSRT/GameMemory.cs b/RE2REmakeSRT/GameMemory.cs index 85b1396..4e22076 100644 --- a/RE2REmakeSRT/GameMemory.cs +++ b/RE2REmakeSRT/GameMemory.cs @@ -63,7 +63,7 @@ public GameMemory(Process proc) { gameVersion = REmake2VersionDetector.GetVersion(proc); memoryAccess = new ProcessMemory.ProcessMemory(proc.Id); - BaseAddress = NativeWrappers.GetProcessBaseAddress(proc.Id).ToInt64(); // Bypass .NET's managed solution for getting this and attempt to get this info ourselves via PInvoke since some users are getting 299 PARTIAL COPY when they seemingly shouldn't. This is built as x64 only and RE2 is x64 only to my knowledge. + BaseAddress = NativeWrappers.GetProcessBaseAddress(proc.Id, ProcessMemory.PInvoke.ListModules.LIST_MODULES_64BIT).ToInt64(); // Bypass .NET's managed solution for getting this and attempt to get this info ourselves via PInvoke since some users are getting 299 PARTIAL COPY when they seemingly shouldn't. This is built as x64 only and RE2 is x64 only to my knowledge. //BaseAddress = proc.MainModule.BaseAddress.ToInt64(); // Setup the pointers. diff --git a/RE2REmakeSRT/Program.cs b/RE2REmakeSRT/Program.cs index af92b98..d782bd3 100644 --- a/RE2REmakeSRT/Program.cs +++ b/RE2REmakeSRT/Program.cs @@ -105,7 +105,9 @@ public static void Main(string[] args) } catch (Exception ex) { + string title = "RE2 (2019) SRT - " + srtVersion; string exception = string.Format("[{0}] An unhandled exception has occurred. Please see below for details.\r\n\r\n[{1}] {2}\r\n{3}.", srtVersion, ex.GetType().ToString(), ex.Message, ex.StackTrace); + MessageBox.Show(exception, title, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); Environment.FailFast(exception, ex); } } diff --git a/RE2REmakeSRT/Properties/AssemblyInfo.cs b/RE2REmakeSRT/Properties/AssemblyInfo.cs index 6d4d630..fb43276 100644 --- a/RE2REmakeSRT/Properties/AssemblyInfo.cs +++ b/RE2REmakeSRT/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.8.1")] -[assembly: AssemblyFileVersion("1.1.8.1")] +[assembly: AssemblyVersion("1.1.8.2")] +[assembly: AssemblyFileVersion("1.1.8.2")]