Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > General Forum
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2011, 10:00 AM
Dzeimis Dzeimis is offline
Member
 
Join Date: Aug 2011
Posts: 5
Default [x86] is it possible to reference memory with a different segment base?

Hello, I'm attempting to modify an existing executable without it's source code and I want a function from one segment to load some data from another segment (The data can't reside in the same segment as the code, because there's not enough code cave in that segment). However whenever I try to access the data I get an access violation error 0xC0000005.
Reply With Quote
  #2  
Old 08-24-2011, 10:12 AM
kao kao is offline
Senior Member
 
Join Date: Sep 2007
Posts: 184
Default

Forget about segments and segment bases. In 32/64 bit windows you operate with virtual memory and pages, every memory page can have different memory protection options. See VirtualProtect() documentation in MSDN (http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx).
Reply With Quote
  #3  
Old 08-24-2011, 01:16 PM
Dzeimis Dzeimis is offline
Member
 
Join Date: Aug 2011
Posts: 5
Default

I think I got it: I should write a DLL that changes protection for that page, right? Thanks for pointing me in the right direction.
Reply With Quote
  #4  
Old 08-24-2011, 03:37 PM
kao kao is offline
Senior Member
 
Join Date: Sep 2007
Posts: 184
Default

Quote:
Originally Posted by Dzeimis View Post
I think I got it: I should write a DLL that changes protection for that page, right?
Not really, no. What I meant is - you can use your codecave to call VirtualProtect and make the necessary memory region writable.
Reply With Quote
  #5  
Old 08-24-2011, 03:58 PM
Dzeimis Dzeimis is offline
Member
 
Join Date: Aug 2011
Posts: 5
Default

I made it with DLL - this application automatically loads all *.dll and *.bin (memory patch) files from it's plugins directory, so no modification of original exe is required. Of course my solution might not be the best one, but I like learning things myself and anyway, it works (although the modification that I want to do isn't finished yet)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump





Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.