about summary refs log tree commit diff stats
path: root/Source/Memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Memory.cpp')
-rw-r--r--Source/Memory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Memory.cpp b/Source/Memory.cpp index 0afeded..168b4e2 100644 --- a/Source/Memory.cpp +++ b/Source/Memory.cpp
@@ -25,7 +25,7 @@ Memory::Memory(const std::string& processName) {
25 // Next, get the process base address 25 // Next, get the process base address
26 DWORD numModules; 26 DWORD numModules;
27 std::vector<HMODULE> moduleList(1024); 27 std::vector<HMODULE> moduleList(1024);
28 EnumProcessModulesEx(_handle, &moduleList[0], static_cast<DWORD>(moduleList.size()), &numModules, 3); 28 EnumProcessModulesEx(_handle, &moduleList[0], moduleList.size(), &numModules, 3);
29 29
30 std::string name(64, 0); 30 std::string name(64, 0);
31 for (DWORD i = 0; i < numModules / sizeof(HMODULE); i++) { 31 for (DWORD i = 0; i < numModules / sizeof(HMODULE); i++) {
@@ -49,7 +49,7 @@ Memory::~Memory() {
49 49
50void Memory::ThrowError() { 50void Memory::ThrowError() {
51 std::string message(256, '\0'); 51 std::string message(256, '\0');
52 FormatMessageA(4096, nullptr, GetLastError(), 1024, &message[0], static_cast<DWORD>(message.length()), nullptr); 52 FormatMessageA(4096, nullptr, GetLastError(), 1024, &message[0], message.length(), nullptr);
53 std::cout << message.c_str() << std::endl; 53 std::cout << message.c_str() << std::endl;
54 exit(EXIT_FAILURE); 54 exit(EXIT_FAILURE);
55} 55}