From 633033d6b6dba4b3c09bd9597a0483acc9321188 Mon Sep 17 00:00:00 2001 From: Stephen Eckels Date: Wed, 3 Jan 2024 15:14:54 -0500 Subject: [PATCH] Update ManualMap.cpp --- JITCall/JITLoadDll/ManualMapper/ManualMap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/JITCall/JITLoadDll/ManualMapper/ManualMap.cpp b/JITCall/JITLoadDll/ManualMapper/ManualMap.cpp index 72202cc..2aebec7 100644 --- a/JITCall/JITLoadDll/ManualMapper/ManualMap.cpp +++ b/JITCall/JITLoadDll/ManualMapper/ManualMap.cpp @@ -123,18 +123,18 @@ bool ManualMapper::loadImage(char* pBase) { continue; } - uint64_t* pThunkRef = (uint64_t*)(pBase + pImportDescr->OriginalFirstThunk); - uint64_t* pFuncRef = (uint64_t*)(pBase + pImportDescr->FirstThunk); + size_t* pThunkRef = (size_t*)(pBase + pImportDescr->OriginalFirstThunk); + size_t* pFuncRef = (size_t*)(pBase + pImportDescr->FirstThunk); if (!pThunkRef) pThunkRef = pFuncRef; for (; *pThunkRef; ++pThunkRef, ++pFuncRef) { if (IMAGE_SNAP_BY_ORDINAL(*pThunkRef)) { - *pFuncRef = (uint64_t)GetProcAddress(hDll, reinterpret_cast(*pThunkRef & 0xFFFF)); + *pFuncRef = (size_t)GetProcAddress(hDll, reinterpret_cast(*pThunkRef & 0xFFFF)); } else { auto pImport = (IMAGE_IMPORT_BY_NAME*)(pBase + (*pThunkRef)); - *pFuncRef = (uint64_t)GetProcAddress(hDll, pImport->Name); + *pFuncRef = (size_t)GetProcAddress(hDll, pImport->Name); } } ++pImportDescr; @@ -349,4 +349,4 @@ uint64_t ManualMapper::getProcAddress(HMODULE hModule, std::string procName) { return RVA2VA(uint64_t, hModule, exportPtrs.addressOfFunctions[i]); } return 0; -} \ No newline at end of file +}