mirror of
https://github.com/vxcontrol/MemoryModule.git
synced 2026-07-25 00:25:23 -04:00
Fix SectionAlignment
Some dlls do not use Native SectionAlignment, instead use SectionAlignment from PE.
This commit is contained in:
+2
-3
@@ -654,9 +654,8 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
|
||||
}
|
||||
}
|
||||
|
||||
GetNativeSystemInfo(&sysInfo);
|
||||
alignedImageSize = AlignValueUp(old_header->OptionalHeader.SizeOfImage, sysInfo.dwPageSize);
|
||||
if (alignedImageSize != AlignValueUp(lastSectionEnd, sysInfo.dwPageSize)) {
|
||||
alignedImageSize = AlignValueUp(old_header->OptionalHeader.SizeOfImage, old_header->OptionalHeader.SectionAlignment);
|
||||
if (alignedImageSize != AlignValueUp(lastSectionEnd, old_header->OptionalHeader.SectionAlignment)) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user