about summary refs log tree commit diff stats
path: root/Source/Memory.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-30 20:00:32 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-30 20:00:32 -0700
commite66a408e38849107a3d35a317ff6f2b23dcaeead (patch)
tree2e2abb9c80997c0565fddce4e7e271d901839b26 /Source/Memory.cpp
parent2ec4950107245df8f01860a3289b7731753933cd (diff)
downloadwitness-tutorializer-e66a408e38849107a3d35a317ff6f2b23dcaeead.tar.gz
witness-tutorializer-e66a408e38849107a3d35a317ff6f2b23dcaeead.tar.bz2
witness-tutorializer-e66a408e38849107a3d35a317ff6f2b23dcaeead.zip
RM static cast, lower warning level, add homebrew RNG
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}