From e3758a15a6430e7ab7ce9821c0d9e19bbf7a1e87 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Tue, 5 Nov 2019 08:45:44 -0800 Subject: Memory / Main are now cleaned up --- Source/Memory.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Source/Memory.h') diff --git a/Source/Memory.h b/Source/Memory.h index f70de6a..d7552c5 100644 --- a/Source/Memory.h +++ b/Source/Memory.h @@ -7,21 +7,25 @@ // #define GLOBALS 0x5B28C0 #define GLOBALS 0x62D0A0 +enum class ProcStatus { + NotRunning, + Running, + NewGame +}; + // https://github.com/erayarslan/WriteProcessMemory-Example // http://stackoverflow.com/q/32798185 // http://stackoverflow.com/q/36018838 // http://stackoverflow.com/q/1387064 class Memory { public: - Memory(); - bool Initialize(const std::wstring& processName); + Memory() = default; + ProcStatus Heartbeat(const std::wstring& processName); ~Memory(); Memory(const Memory& memory) = delete; Memory& operator=(const Memory& other) = delete; - int GetCurrentFrame(); - template std::vector ReadArray(int panel, int offset, int size) { return ReadData({GLOBALS, 0x18, panel*8, offset, 0}, size); @@ -48,9 +52,6 @@ public: private: template std::vector ReadData(const std::vector& offsets, size_t numItems) { - if (GetExitCodeProcess(_process) != STILL_ACTIVE) { - // Signal error, somehow - } std::vector data; data.resize(numItems); for (int i=0; i<5; i++) { @@ -73,8 +74,8 @@ private: ThrowError(); } + bool Initialize(const std::wstring& processName); void ThrowError(); - void* ComputeOffset(std::vector offsets); std::map _computedAddresses; -- cgit 1.4.1