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 


[MASM32]AOBScan

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

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Tue Sep 25, 2007 10:17 am    Post subject: [MASM32]AOBScan Reply with quote

As people are sharing so much lately...
I wrote:
Returns the first array that matches.

Array - a pointer to the array
ArraySize - the length of the array
ScanBaseAddress - Scan's base address
ScanRange - How many bytes to scan
ScanResult - A pointer to an address to set the result

Code:
AOBScan proc Array,ArraySize,ScanBaseAddress,ScanRange,ScanResult
   LOCAL TempR:DWORD
   mov eax,ScanBaseAddress
   mov ebx,eax
   add ebx,ScanRange
   mov ecx,ArraySize
   mov edx,Array
   
   .while eax < ebx
      push ebx
      NextByte:
      mov byte ptr bl,[eax+ecx-1]
      mov byte ptr bh,[edx+ecx-1]
      .if   bl == bh
         .if ecx==01
            mov   TempR,eax
            .if ScanResult != NULL
               push eax
               mov ebx,ScanResult
               pop [ebx]
            .endif
            pop ebx
            mov   eax,TempR
            ret
         .else
            dec ecx
            jmp NextByte
         .endif
      .else
         mov ecx,ArraySize
      .endif
      pop ebx
      AOBFound:
      inc eax
   .endw
   xor eax,eax
   ret
AOBScan endp
Back to top
View user's profile Send private message
Uligor
Grandmaster Cheater
Reputation: 0

Joined: 21 Jan 2006
Posts: 956

PostPosted: Tue Sep 25, 2007 11:49 am    Post subject: Reply with quote

This here is mine

Code:
FindAOB:
push esi
push edi
cld
mov esi, [esp+0Ch]
mov edx, [esp+10h]
mov edi, [esp+14h]
mov ecx, [esp+18h]

AOBloop:
cmpsb
jz ByteFound
mov esi, [esp+0Ch]
mov edx, [esp+10h]
jmp EndAOBLoop

ByteFound:
dec edx
jz AOBFound

EndAOBLoop:
loop AOBloop
xor eax, eax
jmp AOBend

AOBFound:
mov eax, edi
sub eax, [esp+10h]
AOBend:
pop edi
pop esi
ret


Example:

push ScanSize
push ScanAddress
push AOBsize
push AOBtoFind
call FindAOB

Made this a long time ago, so it isn't really tweaked.

_________________
Back to top
View user's profile Send private message
Potatoes
Newbie cheater
Reputation: 0

Joined: 25 Sep 2007
Posts: 16

PostPosted: Tue Sep 25, 2007 10:40 pm    Post subject: Reply with quote

=O
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