diff --git a/AmongUsCapture/AmongUsCapture.csproj b/AmongUsCapture/AmongUsCapture.csproj index 8cff3fd7..fc3dce89 100644 --- a/AmongUsCapture/AmongUsCapture.csproj +++ b/AmongUsCapture/AmongUsCapture.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net5.0 amonguscapture_gtk diff --git a/AmongUsCapture/Memory/GameMemReader.cs b/AmongUsCapture/Memory/GameMemReader.cs index de6667b0..8d02007b 100644 --- a/AmongUsCapture/Memory/GameMemReader.cs +++ b/AmongUsCapture/Memory/GameMemReader.cs @@ -5,6 +5,7 @@ using System.IO; using System.Net; using System.Net.Mime; +using System.Reflection; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Text; @@ -101,18 +102,6 @@ public void RunLoop() foreach (var module in ProcessMemory.getInstance().modules) if (module.Name.Equals("GameAssembly.dll", StringComparison.OrdinalIgnoreCase)) { - if (!GameVerifier.VerifyGameHash(module.FileName)) - { - invalidversion = true; - } - else - { - invalidversion = false; - } - - Settings.conInterface.WriteModuleTextColored("GameVerifier", Color.Red, - $"Game Version Check: {(invalidversion ? Color.Red.ToTextColorPango("FAIL") : Color.Lime.ToTextColorPango("PASS"))}"); - GameAssemblyPtr = module.BaseAddress; using (SHA256Managed sha256 = new SHA256Managed()) { @@ -126,10 +115,24 @@ public void RunLoop() } Hash = GameAssemblyhashSb.ToString(); + Settings.GameOffsets.GameHash = Hash; generateOffsets(); } } } + + if (!GameVerifier.VerifyGameHash(module.FileName)) + { + invalidversion = true; + } + else + { + invalidversion = false; + } + + Settings.conInterface.WriteModuleTextColored("GameVerifier", Color.Red, + $"Game Version Check: {(invalidversion ? Color.Red.ToTextColorPango("FAIL") : Color.Lime.ToTextColorPango("PASS"))}"); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && diff --git a/AmongUsCapture/Settings.cs b/AmongUsCapture/Settings.cs index 2c96b6b5..4c09c284 100644 --- a/AmongUsCapture/Settings.cs +++ b/AmongUsCapture/Settings.cs @@ -39,10 +39,10 @@ public interface IGameOffsets { //Types allowed: bool, double, int, long, string, TimeSpan, DateTime, Uri, Guid //DateTime is always converted to UTC - + [Option(Alias = "GameHash", DefaultValue = "5ab7b3419ed29af0728e66ae8f1a207aedd6456280128060fedf74621b287be6")] - string GameHash { get; } - + string GameHash { get; set; } + [Option(Alias = "Offsets.Client", DefaultValue = 0x193C154)] int AmongUsClientOffset { get; set; }