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 


ASM Loop Through

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

Joined: 31 Jan 2020
Posts: 29
Location: 192.168.0.1

PostPosted: Tue Jun 02, 2020 5:00 am    Post subject: ASM Loop Through Reply with quote

Here is some addresses access instruction how can i loop through it and compare each value on it with what i need, if yes jump to another label if not continue looping to second value ...etc
and thanks
Sorry for my bad english Crying or Very sad



Capture.PNG
 Description:
 Filesize:  13.81 KB
 Viewed:  1893 Time(s)

Capture.PNG


Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Tue Jun 02, 2020 12:24 pm    Post subject: Reply with quote

I assume you you want to compare unique values and assign each case a different procedure/action.
Code:

{$ASM}
//32bit
alloc(yourHook,2048)

yourHook:
 // let's say esi+4 holds the address
 push eax
 mov eax,[esi+4]
 cmp eax,#38240
    jne @F
  // you can, do here the mov[esi+10],#100 and jmp afterwards to @hookCleanup...
  call firstEntity
@@:
cmp eax,#38304
    jne @F
  call secondEntity
@@:
cmp eax 39776
    jne @F
  call thirdEntity
test eax,eax
     jne @hookCleanup
   call nullEntity
@hookCleanup:
 pop eax
jmp someAddressReturn

firstEntity:
  mov [esi+10], #100 // let's say health
ret

secondEntity:
  cmp [esi+8],1  // another unique id for example
     jne @F
    mov [esi+10],0
@@:
ret

thirdEntity:
   mov [esi+3c],(float)0 // let's say speed
ret

nullEntity:
   // eh, you may remove from array if you're saving entities to be able access from lua and such...
ret



someAddress:
jmp yourHook
someAddressReturn:


_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
ghmarko
Cheater
Reputation: 0

Joined: 31 Jan 2020
Posts: 29
Location: 192.168.0.1

PostPosted: Wed Jun 03, 2020 4:22 am    Post subject: Reply with quote

@@:
@f
what is these mean?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Wed Jun 03, 2020 10:43 am    Post subject: Reply with quote

They're labels. @@ is an anonymous label (no actual name), @f refers to the closest next label, and @b refers to the closest previous label.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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