From fdea176b97a83d52b4c0319946193b6f32e3e331 Mon Sep 17 00:00:00 2001 From: Nick Cano Date: Wed, 20 Apr 2016 14:17:20 -0700 Subject: [PATCH] Update main-accessingMemory.cpp --- Chapter6_AccessingMemory/main-accessingMemory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Chapter6_AccessingMemory/main-accessingMemory.cpp b/Chapter6_AccessingMemory/main-accessingMemory.cpp index 4e226b4..d1d3a74 100644 --- a/Chapter6_AccessingMemory/main-accessingMemory.cpp +++ b/Chapter6_AccessingMemory/main-accessingMemory.cpp @@ -132,9 +132,8 @@ DWORD getRemoteBaseAddress(HANDLE process) // get the address of GetModuleHandle() LPVOID funcAdr = GetProcAddress(k32, "GetModuleHandleA"); + if (!funcAdr) funcAdr = GetProcAddress(k32, "GetModuleHandleW"); - if (!funcAdr) - funcAdr = GetProcAddress(k32, "GetModuleHandleW"); // create the thread HANDLE thread = CreateRemoteThread(process, NULL, NULL, (LPTHREAD_START_ROUTINE)funcAdr, NULL, NULL, NULL);