mirror of
https://github.com/vxcontrol/MemoryModule.git
synced 2026-07-25 08:35:44 -04:00
Added getting code base address API function to manage handles on other side
This commit is contained in:
+7
-2
@@ -603,7 +603,6 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
|
||||
PIMAGE_NT_HEADERS old_header;
|
||||
unsigned char *code, *headers;
|
||||
ptrdiff_t locationDelta;
|
||||
SYSTEM_INFO sysInfo;
|
||||
PIMAGE_SECTION_HEADER section;
|
||||
DWORD i;
|
||||
size_t optionalSectionSize;
|
||||
@@ -732,7 +731,7 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
|
||||
result->getProcAddress = getProcAddress;
|
||||
result->freeLibrary = freeLibrary;
|
||||
result->userdata = userdata;
|
||||
result->pageSize = sysInfo.dwPageSize;
|
||||
result->pageSize = old_header->OptionalHeader.SectionAlignment;
|
||||
#ifdef _WIN64
|
||||
result->blockedMemory = blockedMemory;
|
||||
#endif
|
||||
@@ -810,6 +809,12 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LPVOID MemoryGetCodeAddress(HMEMORYMODULE mod)
|
||||
{
|
||||
PMEMORYMODULE module = (PMEMORYMODULE)mod;
|
||||
return module ? (LPVOID)module->codeBase : NULL;
|
||||
}
|
||||
|
||||
static int _compare(const void *a, const void *b)
|
||||
{
|
||||
const struct ExportNameEntry *p1 = (const struct ExportNameEntry*) a;
|
||||
|
||||
Reference in New Issue
Block a user