Marcus Meissner marcus@jet.franken.de writes:
@@ -1406,7 +1409,18 @@ static void load_builtin_callback( void *module, const char *filename ) } virtual_create_system_view( module, nt->OptionalHeader.SizeOfImage, VPROT_SYSTEM | VPROT_IMAGE | VPROT_COMMITTED |
VPROT_READ | VPROT_WRITECOPY | VPROT_EXEC );
VPROT_READ | VPROT_WRITECOPY | VPROT_EXEC, &view );
- sec = (IMAGE_SECTION_HEADER*)((char*)&nt->OptionalHeader+nt->FileHeader.SizeOfOptionalHeader);
- for (i=0;i<nt->FileHeader.NumberOfSections;i++) {
DWORD flags = VPROT_SYSTEM | VPROT_IMAGE | VPROT_COMMITTED;
if (sec[i].Characteristics & IMAGE_SCN_MEM_EXECUTE) flags |= VPROT_EXEC;
if (sec[i].Characteristics & IMAGE_SCN_MEM_READ) flags |= VPROT_READ;
if (sec[i].Characteristics & IMAGE_SCN_MEM_WRITE) flags |= VPROT_WRITE;
if (sec[i].Characteristics & IMAGE_SCN_MEM_SHARED) flags |= VPROT_WRITECOPY;
VIRTUAL_SetProt( view, (char*)module + sec[i].VirtualAddress, sec[i].Misc.VirtualSize, flags );
I don't think you want to actually change the permissions, our headers don't necessarily match the real ELF sections.
(BTW, could you please convince your mailer to set a valid Message-Id?)