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 


[?] AOBs

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

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Sun May 10, 2009 6:13 pm    Post subject: [?] AOBs Reply with quote

In Kitterz Trainer, when the function FindPattern is called, for the masking, it uses “x?????xxxx?????x”. If I have an AOB, how do I tell which ones are valid bytes (‘x’) and which ones are question marks?
Back to top
View user's profile Send private message Visit poster's website
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun May 10, 2009 7:15 pm    Post subject: Reply with quote

well they're in order.

If you had the AOB:

E8 ?? ?? ?? ?? 6A ??

Then you'd call the function with the mask of

x????x?

And you'd just switch the AOB ??'s to 00's in the actual array.

_________________
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Wed May 13, 2009 9:41 pm    Post subject: Reply with quote

it's obvious to me you may not understand what AOB means talker0..

It means array of bytes but in reality it's not a array of bytes.. because all arrays have a size parameter to label them as a array or some kind of terminator like byte 0x00 (which can't work in modifying assembly if say some datatype requires part of it to be 0x00 to represent a bigger image and it screws up thinking it's the terminator.. so AOB has nothing to do with patching assembly code in memory. But sure it's coined by CheatEngine and has the ability to this but it's dangerous if you were to change the memory while it's getting executed that would of had unexpected results from a crash to a bsod (blue screen of death) based on your operating system actually.

I don't know what gave me the urge to post this since it's not that helpful but when I did I feel like I let off some of the burden I was carrying.

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Thu May 14, 2009 1:22 pm    Post subject: Reply with quote

All right, what if I had this AOB: 35 98 00 19 b2 e6 00 00 54 (just an example, not a real AOB)

For the masking, I'd use "xx?xxx??x"?
Back to top
View user's profile Send private message Visit poster's website
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Thu May 14, 2009 5:34 pm    Post subject: Reply with quote

just replace the known byte to x and the unknown to ?

0x00 could be a known byte, so you put a x
Back to top
View user's profile Send private message
ElJEffro
Grandmaster Cheater Supreme
Reputation: 0

Joined: 15 Apr 2007
Posts: 1881
Location: La Tierra

PostPosted: Thu May 14, 2009 10:08 pm    Post subject: Reply with quote

I don't really like that way of doing it, I use a method ripped from FerrisBuellerYourMyHero's work...

Code:
BYTE* ScanAOB(BYTE* AOB, BYTE* memdump, unsigned long searchsize, int aobsize)
{
    unsigned long a = 0, i = 0;
   
    for(i = 0; i < searchsize; i++)
    {     
        while(*(BYTE*)&AOB[a] == '?')
        {
            a++;
            i++;
        }
        if(*(BYTE*)&memdump[i] == *(BYTE*)&AOB[a])
        {
            if(a == (aobsize - 1))
            {
                BYTE* addy = (BYTE*)&memdump[i-a];
            }
            a++;
        }
        else
        {
            a = 0;
        }
    }
    return 0;
}


call it like
Code:

byte someAob[6] = { 0x40, 0x30, 0x20, 0x10, '?', 0x0};
DWORD scanStartAddress = 0x00400000;
ScanAOB(someAob, // AOB
 (byte*)scanStartAddress, // Address to start scan at
 0x00500000, // size of the scan (this one does 0x00400000-0x00900000)
 6); // number of bytes in the aob
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sat May 16, 2009 2:50 pm    Post subject: Reply with quote

talker0 wrote:
All right, what if I had this AOB: 35 98 00 19 b2 e6 00 00 54 (just an example, not a real AOB)

For the masking, I'd use "xx?xxx??x"?


Uh... If you know all the parts you would use all x...

If you treat zeros as unknowns then yes.
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Fri May 22, 2009 12:55 am    Post subject: Reply with quote

ElJEffro wrote:
I don't really like that way of doing it, I use a method ripped from FerrisBuellerYourMyHero's work...

Code:
BYTE* ScanAOB(BYTE* AOB, BYTE* memdump, unsigned long searchsize, int aobsize)
{
    unsigned long a = 0, i = 0;
   
    for(i = 0; i < searchsize; i++)
    {     
        while(*(BYTE*)&AOB[a] == '?')
        {
            a++;
            i++;
        }
        if(*(BYTE*)&memdump[i] == *(BYTE*)&AOB[a])
        {
            if(a == (aobsize - 1))
            {
                BYTE* addy = (BYTE*)&memdump[i-a];
            }
            a++;
        }
        else
        {
            a = 0;
        }
    }
    return 0;
}


call it like
Code:

byte someAob[6] = { 0x40, 0x30, 0x20, 0x10, '?', 0x0};
DWORD scanStartAddress = 0x00400000;
ScanAOB(someAob, // AOB
 (byte*)scanStartAddress, // Address to start scan at
 0x00500000, // size of the scan (this one does 0x00400000-0x00900000)
 6); // number of bytes in the aob

Doesn't that always return 0?
Back to top
View user's profile Send private message Visit poster's website
Jonyleeson
Master Cheater
Reputation: 0

Joined: 03 May 2007
Posts: 484
Location: Hérault, France

PostPosted: Fri May 22, 2009 4:12 am    Post subject: Reply with quote

talker0 wrote:
Doesn't that always return 0?

Yes, it does.
Not only that, it's a horrible way of doing it too, and would provide inaccurate results if your AoB had 0x3F in it. I find it hard to believe that that's FerrisBuellerYourMyHero's work, and if it is, I hope it's extremely old.

_________________
Back to top
View user's profile Send private message
ElJEffro
Grandmaster Cheater Supreme
Reputation: 0

Joined: 15 Apr 2007
Posts: 1881
Location: La Tierra

PostPosted: Sat May 23, 2009 2:49 pm    Post subject: Reply with quote

It has come to my attention that the return addy; has been left out of that function, I don't know why (maybe because I removed some useless comments and deleted it by mistake)

the function should be

Code:
BYTE* ScanAOB(BYTE* AOB, BYTE* memdump, unsigned long searchsize, int aobsize)
{
   unsigned long a = 0, i = 0;
   for(i = 0; i < searchsize; i++)
   {     
      while(*(BYTE*)&AOB[a] == '?')
      {
         a++;
         i++;
      }
      if(*(BYTE*)&memdump[i] == *(BYTE*)&AOB[a])
      {
         if(a == (aobsize - 1))
         {
            BYTE* addy = (BYTE*)&memdump[i-a];
            return addy;
         }
         a++;
      }
      else
      {
         a = 0;
      }
   }
   return 0;
}
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