Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Splitting page into multiple sub pages?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Mar 20, 2013 11:06 pm    Post subject: Splitting page into multiple sub pages? Reply with quote

Say I have a large page of allocated memory:

0x00401000 - 0x01000000

And it has the protection PAGE_EXECUTE_READWRITE but I want to only make part of the page PAGE_EXECUTE_READWRITE and part of the page PAGE_EXECUTE_READONLY

0x00401000-0x00700000 - PAGE_EXECUTE_READWRITE
0x00700000-0x01000000 - PAGE_EXECUTE_READONLY

is this possible? can I separate a page into two discrete pages where I can use virtualprotect on?
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Thu Mar 21, 2013 4:08 am    Post subject: This post has 1 review(s) Reply with quote

The range of pages you are speaking of (0x00401000 - 0x01000000) is not a single page, but a range of pages having identical protection attributes.
The size of a single page in bytes is constant, and this size information can be retrieved using GetSystemInfo.

You can change the protection of a region of consecutive pages using VirtualProtect.
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Mar 21, 2013 5:14 am    Post subject: Reply with quote

Zerith wrote:
The range of pages you are speaking of (0x00401000 - 0x01000000) is not a single page, but a range of pages having identical protection attributes.
The size of a single page in bytes is constant, and this size information can be retrieved using GetSystemInfo.

You can change the protection of a region of consecutive pages using VirtualProtect.


Ahhh I see what you mean. Each page is only 0x1000 bytes long. The reason I thought it was one page was because I viewed the pages in cheatengine and cheatengine said it was a continuous page of that many bytes. But if I call virtualprotect on a region it doesn't affect the rest.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites