diff --git a/.vs/AmongUsCapture/DesignTimeBuild/.dtbcache.v2 b/.vs/AmongUsCapture/DesignTimeBuild/.dtbcache.v2 index d8dd94da..6904072a 100644 Binary files a/.vs/AmongUsCapture/DesignTimeBuild/.dtbcache.v2 and b/.vs/AmongUsCapture/DesignTimeBuild/.dtbcache.v2 differ diff --git a/AmongUsCapture/GameMemReader.cs b/AmongUsCapture/GameMemReader.cs index f19a9297..f194a0ae 100644 --- a/AmongUsCapture/GameMemReader.cs +++ b/AmongUsCapture/GameMemReader.cs @@ -21,6 +21,12 @@ class GameMemReader private bool shouldForceUpdate = false; private bool shouldTransmitState = false; + private int AmongUsClientOffset = 0x1468840; + private int GameDataOffset = 0x1468864; + private int MeetingHudOffset = 0x14686A0; + private int GameStartManagerOffset = 0x0; + private int HudManagerOffset = 0x13EEB44; + public static GameMemReader getInstance() { return instance; @@ -82,16 +88,16 @@ public void RunLoop() Console.WriteLine($"({GameAssemblyPtr})"); - prevChatBubsVersion = ProcessMemory.Read(GameAssemblyPtr, 0xD0B25C, 0x5C, 0, 0x28, 0xC, 0x14, 0x10); + prevChatBubsVersion = ProcessMemory.Read(GameAssemblyPtr, HudManagerOffset, 0x5C, 0, 0x28, 0xC, 0x14, 0x10); } } GameState state; //int meetingHudState = /*meetingHud_cachePtr == 0 ? 4 : */ProcessMemory.ReadWithDefault(GameAssemblyPtr, 4, 0xDA58D0, 0x5C, 0, 0x84); // 0 = Discussion, 1 = NotVoted, 2 = Voted, 3 = Results, 4 = Proceeding - IntPtr meetingHud = ProcessMemory.Read(GameAssemblyPtr, 0xDA58D0, 0x5C, 0); + IntPtr meetingHud = ProcessMemory.Read(GameAssemblyPtr, MeetingHudOffset, 0x5C, 0); uint meetingHud_cachePtr = meetingHud == IntPtr.Zero ? 0 : ProcessMemory.Read(meetingHud, 0x8); int meetingHudState = meetingHud_cachePtr == 0 ? 4 : ProcessMemory.ReadWithDefault(meetingHud, 4, 0x84); // 0 = Discussion, 1 = NotVoted, 2 = Voted, 3 = Results, 4 = Proceeding - int gameState = ProcessMemory.Read(GameAssemblyPtr, 0xDA5ACC, 0x5C, 0, 0x64); // 0 = NotJoined, 1 = Joined, 2 = Started, 3 = Ended (during "defeat" or "victory" screen only) + int gameState = ProcessMemory.Read(GameAssemblyPtr, AmongUsClientOffset, 0x5C, 0, 0x64); // 0 = NotJoined, 1 = Joined, 2 = Started, 3 = Ended (during "defeat" or "victory" screen only) if (gameState == 0) { @@ -115,7 +121,7 @@ public void RunLoop() state = GameState.TASKS; } - IntPtr allPlayersPtr = ProcessMemory.Read(GameAssemblyPtr, 0xDA5A60, 0x5C, 0, 0x24); + IntPtr allPlayersPtr = ProcessMemory.Read(GameAssemblyPtr, GameDataOffset, 0x5C, 0, 0x24); IntPtr allPlayers = ProcessMemory.Read(allPlayersPtr, 0x08); int playerCount = ProcessMemory.Read(allPlayersPtr, 0x0C); @@ -124,7 +130,7 @@ public void RunLoop() // check if exile causes end if (oldState == GameState.DISCUSSION && state == GameState.TASKS) { - byte exiledPlayerId = ProcessMemory.ReadWithDefault(GameAssemblyPtr, 255, 0xDA58D0, 0x5C, 0, 0x94, 0x08); + byte exiledPlayerId = ProcessMemory.ReadWithDefault(GameAssemblyPtr, 255, MeetingHudOffset, 0x5C, 0, 0x94, 0x08); int impostorCount = 0, innocentCount = 0; for (int i = 0; i < playerCount; i++) @@ -275,8 +281,8 @@ public void RunLoop() } } - IntPtr chatBubblesPtr = ProcessMemory.Read(GameAssemblyPtr, 0xD0B25C, 0x5C, 0, 0x28, 0xC, 0x14); - int poolSize = 20; // = ProcessMemory.Read(GameAssemblyPtr, 0xD0B25C, 0x5C, 0, 0x28, 0xC, 0xC) + IntPtr chatBubblesPtr = ProcessMemory.Read(GameAssemblyPtr, HudManagerOffset, 0x5C, 0, 0x28, 0xC, 0x14); + int poolSize = 20; // = ProcessMemory.Read(GameAssemblyPtr, 0x13EEB44, 0x5C, 0, 0x28, 0xC, 0xC) int numChatBubbles = ProcessMemory.Read(chatBubblesPtr, 0xC); int chatBubsVersion = ProcessMemory.Read(chatBubblesPtr, 0x10); IntPtr chatBubblesAddr = ProcessMemory.Read(chatBubblesPtr, 0x8) + 0x10; @@ -328,6 +334,9 @@ public void RunLoop() }); } + //string gameCode = ProcessMemory.ReadString(ProcessMemory.Read(GameAssemblyPtr, GameStartManagerOffset, 0x5c, 0, 0x20, 0x28)); + //Console.WriteLine(gameCode); + Thread.Sleep(250); } } diff --git a/AmongUsCapture/Program.cs b/AmongUsCapture/Program.cs index a987412a..79fd5584 100644 --- a/AmongUsCapture/Program.cs +++ b/AmongUsCapture/Program.cs @@ -11,7 +11,7 @@ namespace AmongUsCapture { static class Program { - private static bool debugGui = false; + private static bool debugGui = true; public static ConsoleInterface conInterface = null; /// /// The main entry point for the application.