View Full Version : Patching dll at runtime
SaNGa
March 28th, 2002, 08:56
I'm trying to patch a function imported from a dll (not a system dll) by another process at runtime. I write a small loader that load the main process and the dll is loaded by this process. How can I obtain the handle of the loaded dll? I have used LoadLibrary but if I use WriteProcessMemory with this handle, the function fails (the page protection is PAGE_EXECUTE_READWRITE, modifyed with VirtualProtectEx). Any suggestions?
mike
March 28th, 2002, 19:16
What OS? I know under win98, I just cast the handle returned from loadlibrary as a pointer & modified memory that way.
IcyDee
April 1st, 2002, 13:15
why not patch the DLL section that you are trying to modify to make it read\execute\write? that always worked for me no matter what the operating system. Then cast the handle as a pointer as mentioned above.
hailua
April 7th, 2002, 01:09
Hi IcyDee,
Patch the DLL section?but Dll packer ,how do patch .I try it but
it crash
Powered by vBulletin® Version 4.2.2 Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.