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 Scanning

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

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Dec 18, 2008 10:16 am    Post subject: AoB Scanning Reply with quote

I made my own Signature scanner and it always seem to return an invalid address

Code:

DWORD Search(char* addr){
   int min = 0x00400000;
   int max = 0x7FFFFFFF;
   char *temp;
   int length = strlen(addr);

   for(; min <=max ; min++){
      temp = new char[length];
      memcpy((void*)temp,(void*)min, length);
      if(addr == temp){
            return (DWORD)min;
      }
   }
   return 0;
}


:S


Last edited by &Vage on Thu Dec 18, 2008 11:49 am; edited 2 times in total
Back to top
View user's profile Send private message
b6ooy
Grandmaster Cheater
Reputation: 0

Joined: 21 Sep 2006
Posts: 653

PostPosted: Thu Dec 18, 2008 10:37 am    Post subject: Reply with quote

why zeromemory min of you are going to return it ?
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Dec 18, 2008 10:50 am    Post subject: Reply with quote

b6ooy wrote:
why zeromemory min of you are going to return it ?


I wanted to take off some memory usage.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu Dec 18, 2008 11:19 am    Post subject: Reply with quote

but didn't you cleaned min's memory b4 you returned it?
edit: btw what's the meaning of (void*) always wondered o_O
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Dec 18, 2008 11:21 am    Post subject: Reply with quote

1qaz wrote:
but didn't you cleaned min's memory b4 you returned it?
edit: btw what's the meaning of (void*) always wondered o_O


Oh! Lol! Ok fixed Smile, still doesn't work :/
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Thu Dec 18, 2008 11:21 am    Post subject: Re: AoB Scanning Reply with quote

_void_ wrote:
Code:
ZeroMemory((void*)min,sizeof(min));
ZeroMemory((void*)max,sizeof(max));
ZeroMemory((void*)temp,sizeof(temp));
return (DWORD)min;


Makes no sense to me :S.

Edit: nuuu I ish late Sad
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Dec 18, 2008 11:26 am    Post subject: Reply with quote

ZeroMemory((void*)min,sizeof(min));
ZeroMemory((void*)max,sizeof(max));
ZeroMemory((void*)temp,sizeof(temp));

is going to do horrible things.

use &, not (void*)
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu Dec 18, 2008 12:09 pm    Post subject: Reply with quote

how about
Code:

if (strcmp(addr,temp) == 0) return (DWORD)min;

?
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Dec 18, 2008 12:46 pm    Post subject: Reply with quote

1qaz wrote:
but didn't you cleaned min's memory b4 you returned it?
edit: btw what's the meaning of (void*) always wondered o_O


(void*) will cast whatever follows it as a pointer.

1qaz wrote:
how about
Code:

if (strcmp(addr,temp) == 0) return (DWORD)min;

?


doesn't matter, i think he's using Borland C++ Builder.
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Dec 18, 2008 12:57 pm    Post subject: Reply with quote

smartz993 wrote:
1qaz wrote:
but didn't you cleaned min's memory b4 you returned it?
edit: btw what's the meaning of (void*) always wondered o_O


(void*) will cast whatever follows it as a pointer.

1qaz wrote:
how about
Code:

if (strcmp(addr,temp) == 0) return (DWORD)min;

?


doesn't matter, i think he's using Borland C++ Builder.


MSVC++, my C++ builder trial ran out, to lazy to make a new account :/
Back to top
View user's profile Send private message
Spawnfestis
GO Moderator
Reputation: 0

Joined: 02 Nov 2007
Posts: 1746
Location: Pakistan

PostPosted: Thu Dec 18, 2008 1:12 pm    Post subject: Reply with quote

_void_ wrote:
smartz993 wrote:
1qaz wrote:
but didn't you cleaned min's memory b4 you returned it?
edit: btw what's the meaning of (void*) always wondered o_O


(void*) will cast whatever follows it as a pointer.

1qaz wrote:
how about
Code:

if (strcmp(addr,temp) == 0) return (DWORD)min;

?


doesn't matter, i think he's using Borland C++ Builder.


MSVC++, my C++ builder trial ran out, to lazy to make a new account :/

MSVC++ is good.. Confused

_________________

CLICK TO HAX MAPLESTORAY ^ !!!!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Thu Dec 18, 2008 1:17 pm    Post subject: Reply with quote

Several major mistakes.

A) You are doing a shallow compare of the pointers, not a deep compare of the values they contain. addr == temp is just checking if the two addresses are the same.
B) strlen is wrong in this case. char * does not necessarily mean c string. You may want AOBS with 0s midway. You should make the function take the array and a length.
C) Minor point, no reason to copy the bytes at min into temp.

Code:
DWORD Search(char* addr, int length) {
   char *min = 0x00400000;
   char *max = 0x7FFFFFFF;
   int i;

   for (; min <= max - length; min++) {
      for (i = 0; i < length; i++) {
         if(addr[i] != min[i])
            break;
      }
      
      if (i == length)
         return (DWORD)min;
   }
   return 0;
}


You may also want to use the true image base, GetModuleHandle(NULL), or the true code base,
Code:
   DWORD *min = (DWORD *)GetModuleHandle(NULL);
   DWORD *tmp = min + min[0x3c / 4]/4;
   tmp = min + tmp[0x2c / 4]/4;
   printf("%x", tmp);

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
crayzbeef
Expert Cheater
Reputation: 0

Joined: 21 Jan 2007
Posts: 101

PostPosted: Mon Dec 22, 2008 8:22 pm    Post subject: Reply with quote

Spawnfestis wrote:
_void_ wrote:
smartz993 wrote:
1qaz wrote:
but didn't you cleaned min's memory b4 you returned it?
edit: btw what's the meaning of (void*) always wondered o_O


(void*) will cast whatever follows it as a pointer.

1qaz wrote:
how about
Code:

if (strcmp(addr,temp) == 0) return (DWORD)min;

?


doesn't matter, i think he's using Borland C++ Builder.


MSVC++, my C++ builder trial ran out, to lazy to make a new account :/

MSVC++ is good.. Confused


Yeah.. borland is shit.
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