From: Eric K. <ek...@rz...> - 2002-07-23 11:51:18
|
Hi! I just found out why application compiled with MSVC++ don't run on ReactOS. These apps have a slighly different layout compared to apps compiled with MinGW. MSVC++ stores the IAT (Import Address Table) inside of the .rdata section, MinGW stores the IAT inside of the .data section. Now the problem is that the .rdata setion is read-only. To fix-up the IAT of an application the offsets stored in the IAT must be overwritten by the real import addresses. Obviously this wont work if the IAT is inside of a read-only section. To fix this bug I added calls to NtProtectVirtualMemory() to the fixup routine to change the IAT's protection to read-write before it is modified and reset its protection after the fixup is done. When I had a look at NtProtectVirtualMemory() I saw that its core functionality is disabled. What's wrong? Regards, Eric Eric |