I want to write code in a DLL that will modify the jump table in the process that loaded the DLL.
I tried and I received an access violation.
I think I should use VirtualProtect before changing the jump table.
The problem is that if this is what I should do, I don't know how to get the beginning of the region.



mov ebx, 004AC0C8h
invoke VirtualProtect, ebx, 4, PAGE_READWRITE, ADDR OldProt1
invoke VirtualProtect, ebx, 4, PAGE_WRITECOPY, ADDR OldProt2
mov eax, OFFSET MyOwnProcedure
mov dword ptr [ebx], eax



I suppose I have to use PAGE_WRITECOPY because I'm using XP. When I try only one call with "PAGE_READWRITE or PAGE_WRITECOPY" the call fails.
Posted on 2002-01-12 13:08:26 by Hel