From 5de975b03c7200cc66188a4b1a76e1213524975d Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Thu, 1 Nov 2018 20:56:56 -0700 Subject: pain and suffering, but I can read/write decorations & dots. --- Source/Memory.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Source/Memory.h') diff --git a/Source/Memory.h b/Source/Memory.h index 53fa1e0..310c971 100644 --- a/Source/Memory.h +++ b/Source/Memory.h @@ -3,6 +3,9 @@ #include #include +#define GLOBALS 0x5B28C0 +//#define GLOBALS 0x62A080 + // https://github.com/erayarslan/WriteProcessMemory-Example // http://stackoverflow.com/q/32798185 // http://stackoverflow.com/q/36018838 @@ -16,6 +19,27 @@ public: Memory(const Memory& memory) = delete; Memory& operator=(const Memory& other) = delete; + + template + std::vector ReadArray(int panel, int offset, int size) { + return ReadData({GLOBALS, 0x18, panel*8, offset, 0}, size); + } + + template + void WriteArray(int panel, int offset, const std::vector& data) { + WriteData({GLOBALS, 0x18, panel*8, offset, 0}, data); + } + + template + std::vector ReadPanelData(int panel, int offset, size_t size) { + return ReadData({GLOBALS, 0x18, panel*8, offset}, size); + } + + template + void WritePanelData(int panel, int offset, const std::vector& data) { + WriteData({GLOBALS, 0x18, panel*8, offset}, data); + } + template std::vector ReadData(const std::vector& offsets, size_t numItems) { std::vector data; @@ -41,6 +65,7 @@ public: } private: + void ThrowError(); void* ComputeOffset(std::vector offsets); -- cgit 1.4.1