| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Mar 22, 2009 9:21 am Post subject: [Page Problem] ReadWrite still contains EXECUTE |
|
|
I want to protect a piece of memory that contains PAGE_READWRITE but not PAGE_EXECUTE.
So I do this:
VirtualProtect(pointer($00401000),5,PAGE_READWRITE,op);
But it still has the PAGE_EXECUTE flag on it. Is it possible to remove the EXECUTE flag while keeping the READWRITE flag? |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Mar 22, 2009 12:23 pm Post subject: |
|
|
It's actually because, without PAE, or DEP enabled on the process, there are only two memory types: READ/EXECUTE and WRITE/EXECUTE. If you want to be able to remove the EXECUTE flag, launch the program under DEP, or go into your boot.ini file and change /noexecute=optin (the default) to /noexecute=optout.
Alternatively you could just use PAGE_NOACCESS, but then you'd have to handle all the reads/writes as well.
Granted, I just woke up, so I probably missed something here. |
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Mar 22, 2009 12:31 pm Post subject: |
|
|
So is there a way of launching a program with DEP w/o changing Boot.ini.
Google won't give me an answer... |
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Sun Mar 22, 2009 4:32 pm Post subject: |
|
|
Right click on 'My Computer'.
Click on 'Change Settings'.
Click on the 'Advanced' tab.
Click on the 'Settings' button under 'Performance.'
Click on the 'Data Execution Prevention' tab.
Choose the second radio button. |
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Mar 22, 2009 4:53 pm Post subject: |
|
|
| I know that... But is it possible to enable it for 1 program. Though code? Not manual user settings? |
|
| Back to top |
|
 |
|