From 66b2bc177853d33f4559eb240fbbca354b173fa2 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Tue, 5 Nov 2019 10:01:52 -0800 Subject: All set... time to wire up actual randomizer --- Source/Memory.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Source/Memory.h') diff --git a/Source/Memory.h b/Source/Memory.h index d7552c5..c19d92b 100644 --- a/Source/Memory.h +++ b/Source/Memory.h @@ -1,12 +1,14 @@ #pragma once #include #include +#include #include #include // #define GLOBALS 0x5B28C0 #define GLOBALS 0x62D0A0 +#define HEARTBEAT 0x401 enum class ProcStatus { NotRunning, Running, @@ -17,11 +19,11 @@ enum class ProcStatus { // http://stackoverflow.com/q/32798185 // http://stackoverflow.com/q/36018838 // http://stackoverflow.com/q/1387064 -class Memory { +class Memory final : public std::enable_shared_from_this { public: - Memory() = default; - ProcStatus Heartbeat(const std::wstring& processName); + Memory(const std::wstring& processName); ~Memory(); + void StartHeartbeat(HWND window, std::chrono::milliseconds beat = std::chrono::milliseconds(1000)); Memory(const Memory& memory) = delete; Memory& operator=(const Memory& other) = delete; @@ -74,10 +76,15 @@ private: ThrowError(); } - bool Initialize(const std::wstring& processName); + void Heartbeat(HWND window); + bool Initialize(); void ThrowError(); void* ComputeOffset(std::vector offsets); + int _previousFrame = 0; + bool _threadActive = false; + std::thread _thread; + std::wstring _processName; std::map _computedAddresses; uintptr_t _baseAddress = 0; HANDLE _handle = nullptr; -- cgit 1.4.1