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 


AOB Scanner problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Jozzef
Cheater
Reputation: 0

Joined: 17 Feb 2007
Posts: 34
Location: Wales

PostPosted: Sun Mar 22, 2009 1:29 pm    Post subject: AOB Scanner problem Reply with quote

Here's the code:

Code:

int main()
{
      DWORD dwAddress = 0x00400000;
      DWORD dwLen = 0x01FFFFFF;
for(DWORD i=0; i < dwLen; i++)
{
      char *ptr = (char*)dwAddress;
      cout << (INT)*ptr << endl;
      cout << (INT)ptr << endl;
      dwAddress++;

}


For some reason at 0x4113087 the program crashes

I'm using VC++ 2008.

Most of the code is from kitterz maplestory program.

Any help wouldbe appreciated.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 22, 2009 1:34 pm    Post subject: Reply with quote

Unhandled Access Violation.
Back to top
View user's profile Send private message
Jozzef
Cheater
Reputation: 0

Joined: 17 Feb 2007
Posts: 34
Location: Wales

PostPosted: Sun Mar 22, 2009 2:01 pm    Post subject: Reply with quote

dnsi0 wrote:
Unhandled Access Violation.


How come this happens?

It crashes even when i'm not running maplestory.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 22, 2009 2:23 pm    Post subject: Reply with quote

You are reading non-existant memory. So no duh it crashes. add a exception handler and you will be alright.
Back to top
View user's profile Send private message
mStorm
Expert Cheater
Reputation: 0

Joined: 21 Feb 2009
Posts: 107

PostPosted: Sun Mar 22, 2009 2:50 pm    Post subject: Reply with quote

use VirtualQuery

MEMORY_BASIC_INFORMATION mbi;

Scan if: mbi.AllocationBase is > 0, if mbi.RegionSize is > 0, and mbi.State == MEM_COMMITED
Then you have yourself a chunk of good memory to scan.


(increment by mbi.RegionSize..)
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