Results 1 to 4 of 4

Thread: Patching dll at runtime

  1. #1
    SaNGa
    Guest

    Question Patching dll at runtime

    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?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    הבּרוּ נשׂאי כּלי יהוה mike's Avatar
    Join Date
    Mar 2001
    Posts
    491

    what OS

    What OS? I know under win98, I just cast the handle returned from loadlibrary as a pointer & modified memory that way.

  3. #3
    IcyDee
    Guest
    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.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    hailua
    Guest
    Hi IcyDee,

    Patch the DLL section?but Dll packer ,how do patch .I try it but
    it crash
    I promise that I have read the FAQ and tried to use the Search to answer my question.

Similar Threads

  1. Extract Sequence of assembly codes during runtime ???
    By mansourweb in forum Malware Analysis and Unpacking Forum
    Replies: 5
    Last Post: February 18th, 2011, 16:43
  2. DLL code patching at runtime ...
    By kappasm in forum The Newbie Forum
    Replies: 11
    Last Post: February 6th, 2011, 06:13
  3. extract runtime assembly code ?
    By mansourweb in forum Malware Analysis and Unpacking Forum
    Replies: 0
    Last Post: May 13th, 2010, 04:48
  4. Vista x64 SP1 tcpip.sys runtime patching
    By LordByte in forum Advanced Reversing and Programming
    Replies: 3
    Last Post: March 17th, 2008, 19:26
  5. patching dll functions at runtime?
    By ramin_rad2000 in forum Malware Analysis and Unpacking Forum
    Replies: 6
    Last Post: May 23rd, 2004, 07:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •