diff options
Diffstat (limited to 'Source/Memory.cpp')
| -rw-r--r-- | Source/Memory.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
| diff --git a/Source/Memory.cpp b/Source/Memory.cpp index e240b90..d90c402 100644 --- a/Source/Memory.cpp +++ b/Source/Memory.cpp | |||
| @@ -8,16 +8,17 @@ | |||
| 8 | #undef PROCESSENTRY32 | 8 | #undef PROCESSENTRY32 |
| 9 | #undef Process32Next | 9 | #undef Process32Next |
| 10 | 10 | ||
| 11 | Memory::Memory(const std::wstring& processName) : _processName(processName) { | 11 | Memory::Memory(const std::wstring& processName) : _processName(processName) {} |
| 12 | } | ||
| 13 | 12 | ||
| 14 | Memory::~Memory() { | 13 | Memory::~Memory() { |
| 15 | if (_threadActive) { | 14 | if (_threadActive) { |
| 16 | _threadActive = false; | 15 | _threadActive = false; |
| 17 | _thread.join(); | 16 | _thread.join(); |
| 18 | } | 17 | } |
| 18 | |||
| 19 | if (_handle != nullptr) { | 19 | if (_handle != nullptr) { |
| 20 | CloseHandle(_handle); | 20 | for (uintptr_t addr : _allocations) VirtualFreeEx(_handle, (void*)addr, 0, MEM_RELEASE); |
| 21 | CloseHandle(_handle); | ||
| 21 | } | 22 | } |
| 22 | } | 23 | } |
| 23 | 24 | ||
| @@ -133,7 +134,7 @@ int Memory::ExecuteSigScans() | |||
| 133 | { | 134 | { |
| 134 | for (int i=0; i<0x200000; i+=0x1000) { | 135 | for (int i=0; i<0x200000; i+=0x1000) { |
| 135 | std::vector<byte> data = ReadData<byte>({i}, 0x1100); | 136 | std::vector<byte> data = ReadData<byte>({i}, 0x1100); |
| 136 | 137 | ||
| 137 | for (auto& [scanBytes, sigScan] : _sigScans) { | 138 | for (auto& [scanBytes, sigScan] : _sigScans) { |
| 138 | if (sigScan.found) continue; | 139 | if (sigScan.found) continue; |
| 139 | int index = find(data, scanBytes); | 140 | int index = find(data, scanBytes); |
