From f485927337c329a4a691500a1b6c18c763863bb4 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Sun, 2 Dec 2018 18:06:46 -0800 Subject: moved sigscans & wired up hotel + wonkavator --- Source/Memory.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Source/Memory.cpp') diff --git a/Source/Memory.cpp b/Source/Memory.cpp index 825346a..43cb9b3 100644 --- a/Source/Memory.cpp +++ b/Source/Memory.cpp @@ -39,6 +39,11 @@ Memory::Memory(const std::string& processName) { if (_baseAddress == 0) { throw std::exception("Couldn't find the base process address!"); } + + // Unprotect regions of memory + + DWORD oldProtect; + VirtualProtectEx(_handle, (LPVOID)_baseAddress, sizeof(DWORD), PAGE_READWRITE, &oldProtect); } Memory::~Memory() { @@ -58,6 +63,14 @@ int Memory::GetCurrentFrame() return ReadData({SCRIPT_FRAMES}, 1)[0]; } +void Memory::SigScan(std::function& data)> scanFunc) +{ + for (int i=0; i<0x200000; i+=0x1000) { + std::vector data = ReadData({i}, 0x1100); + scanFunc(i, data); + } +} + void Memory::ThrowError() { std::string message(256, '\0'); int length = FormatMessageA(4096, nullptr, GetLastError(), 1024, &message[0], static_cast(message.size()), nullptr); -- cgit 1.4.1