From 3a03f478e407f35bfafd192c22f82bc8c6e25a38 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Wed, 6 Nov 2019 09:19:21 -0800 Subject: And... it works? --- Source/Memory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Source/Memory.cpp') diff --git a/Source/Memory.cpp b/Source/Memory.cpp index 7b4b9c7..c3b89d0 100644 --- a/Source/Memory.cpp +++ b/Source/Memory.cpp @@ -59,6 +59,8 @@ void Memory::Heartbeat(HWND window) { int frameDelta = currentFrame - _previousFrame; _previousFrame = currentFrame; if (frameDelta < 0 && currentFrame < 250) { + // Some addresses (e.g. Entity Manager) may get re-allocated on newgame. + _computedAddresses.clear(); PostMessage(window, WM_COMMAND, HEARTBEAT, (LPARAM)ProcStatus::NewGame); return; } @@ -171,9 +173,6 @@ void* Memory::ComputeOffset(std::vector offsets) { // If the address is not yet computed, then compute it. uintptr_t computedAddress = 0; if (bool result = !ReadProcessMemory(_handle, reinterpret_cast(cumulativeAddress), &computedAddress, sizeof(uintptr_t), NULL)) { - if (GetLastError() == ERROR_PARTIAL_COPY) { - int k = 1; - } ThrowError(); } _computedAddresses[cumulativeAddress] = computedAddress; -- cgit 1.4.1