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 


Filters scanning memory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
justdream
How do I cheat?
Reputation: 0

Joined: 04 Apr 2012
Posts: 7

PostPosted: Mon Apr 09, 2012 6:14 pm    Post subject: Filters scanning memory Reply with quote

Hello,

I'm writing a memory scanner and it works perfectly and fast in 'small' programs/games (like CE Tutorial, minesweeper, etc).
But in large and online games, the scan is so slow..

These are the filter I'm using:

Code:
if  (S=SizeOf(MEMORY_BASIC_INFORMATION))  and (MBI.State = MEM_COMMIT) and (MBI.Type_9 = MEM_PRIVATE) and  (MBI.RegionSize>0)  and (MBI.Protect = PAGE_READWRITE) then begin


Is there a better way to improve the scan and turn it much fast?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25831
Location: The netherlands

PostPosted: Mon Apr 09, 2012 6:50 pm    Post subject: Reply with quote

you're actually skipping too much memory (readwrite_execute might also contain variables)

Perhaps the bottleneck is somewhere else. For example, do not show the scanresults while scanning, do not update the gui for every byte you read something, do not do readprocessmemory calls for regions smaller than 4kb

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
justdream
How do I cheat?
Reputation: 0

Joined: 04 Apr 2012
Posts: 7

PostPosted: Mon Apr 09, 2012 6:54 pm    Post subject: Reply with quote

Hi Dark Byte,
Creating a string list to add the scanresults and just pass the results to the listbox when the scan is done may be a solution?

Furthermore, is there another way to improve the scan? I'm making in DLL (don't using RPM to prevent against possible hooks)...

Thanks
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25831
Location: The netherlands

PostPosted: Mon Apr 09, 2012 7:08 pm    Post subject: Reply with quote

It depends on how many results there are. If you like to scan for the 1 byte value '0' then, yes, you will need to take care of that. But if you only find a handful then that's not the bottleneck

If you are looking for a 4 byte value, you can assume that it's address is on a 4 byte alignment. Meaning that you can skip 75% of the memory compares

Also, do you copy the memory to a temporary buffer first and scan that, or do you scan immediately?

And how do you take care of the game freeing a block of memory that you are currenty reading?
If you use try/except, do not use it for every single byte compare, but use it on a querymemoryregion boundary

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
justdream
How do I cheat?
Reputation: 0

Joined: 04 Apr 2012
Posts: 7

PostPosted: Mon Apr 09, 2012 7:19 pm    Post subject: Reply with quote

Dark Byte wrote:

Also, do you copy the memory to a temporary buffer first and scan that, or do you scan immediately?


I'm scanning immediately :/

Dark Byte wrote:

And how do you take care of the game freeing a block of memory that you are currenty reading?
If you use try/except, do not use it for every single byte compare, but use it on a querymemoryregion boundary


I had not thought of that.. but I'll increment it now...
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