How to Access the Protected memory of window of My Application?

Hello,
Whenever the application is executing it loads the dll it uses like user32.dll , ntdll.dll in it virtual memory . And allocates the address . Following is the module it loads.

TestApp.exe 0x400000-0x428FFF
User32.dll 0x77E10000-77E73FFF

Now i need to append the function in the user32.dll(address some 77E18052 ). I can access the memory or modify the memory with debugger But when i am appending with my problem it gives error using pointer to dword
Error : “Unhandled exception in Test.exe:0xC0000005: Access Violation”

So how to remove the memory protection and allow my program to access the memory.

-Thomas

Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
Know more at http://mail.sify.com

Sify Power mail- a Premium Service from Sify Mail!
know more at http://mail.sify.com

You must use VirtualProtect to de-ice the pages. See this KB (How to
modify executable code in memory):

http://support.microsoft.com/default.aspx?scid=kb;en-us;127904

thomas mathew wrote:

Hello,
Whenever the application is executing it loads the dll it uses like user32.dll , ntdll.dll in it virtual memory . And allocates the address . Following is the module it loads.

TestApp.exe 0x400000-0x428FFF
User32.dll 0x77E10000-77E73FFF

Now i need to append the function in the user32.dll(address some 77E18052 ). I can access the memory or modify the memory with debugger But when i am appending with my problem it gives error using pointer to dword
Error : “Unhandled exception in Test.exe:0xC0000005: Access Violation”

So how to remove the memory protection and allow my program to access the memory.

-Thomas

Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
Know more at http://mail.sify.com

Sify Power mail- a Premium Service from Sify Mail!
know more at http://mail.sify.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

  • Nick Ryan (MVP for DDK)