You are right. Thanks for such a detailed review. I fixed it in v2 patch. I changed zeroed field from VirtualAddress to Size to make perform_relocations return STATUS_SUCCESS next time.
W dniu 05.02.2019 o 11:04, Alexandre Julliard pisze:
Rafał H rafalh92@outlook.com writes:
/* make sure we don't try again */
size = FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + nt->FileHeader.SizeOfOptionalHeader;
VirtualProtect( nt, size, PAGE_READWRITE, &old );
nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0;
VirtualProtect( nt, size, old, &old );
You most likely need to keep that part.