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 


Assembler Help (jumps)

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

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Thu Apr 17, 2008 6:50 pm    Post subject: Assembler Help (jumps) Reply with quote

If i do this:

newmem:
cmp eax,eax
je label
mov eax,ebx

label:
// do stuff

How do you make it go back and execute after the je so when it's finished it continues. In other words, i want it to execute some code if the cmp is true and then continue on with the rest of the code
Back to top
View user's profile Send private message AIM Address MSN Messenger
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Thu Apr 17, 2008 11:39 pm    Post subject: Reply with quote

Try looking at the AA template.
Back to top
View user's profile Send private message
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Thu Apr 17, 2008 11:47 pm    Post subject: Reply with quote

Could you elaborate? I'm not quite sure what you're referring to. Are you talking about the "returnhere" label the template has? I don't think that'd work in my situation.. Here's an example of what i have

Code:

alloc(newmem,2048)
label(returnhere)
label(exit)
label(otherthing)

0123456:
jmp newmem
nop
returnhere:

newmem:
cmp eax,eax // always true
je otherthing // will always jump to otherthing
mov eax,[ebx] // will never get executed

otherthing:
mov edx,[eax] // random thing



Every time the game runs 0123456 it will jmp to my newmem and je to otherthing every time and the mov eax,[ebx] will never be executed. I want it to je to otherthing, then come back and execute mov eax,[ebx] and all remaining code. I'm not sure how to go about this though, i'm somewhat new to AA and assembly.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Fri Apr 18, 2008 12:14 am    Post subject: Reply with quote

Move the je under the instruction so it jumps after it Razz
Code:

alloc(newmem,2048)
label(returnhere)
label(exit)
label(otherthing)

0123456:
jmp newmem
nop
returnhere:

newmem:
cmp eax,eax // always true
mov eax,[ebx] // executed
je otherthing // will always jump to otherthing

otherthing:
mov edx,[eax] // random thing





AA template:
Code:

alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

00000000:
jmp newmem
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here


originalcode:


exit:
jmp returnhere


Enable/Disable "Toggle able" Script
Code:

[Enable]
alloc(newmem,2048)
label(returnhere)
label(exit)
label(otherthing)

0123456:
jmp newmem
nop
returnhere:

newmem:
cmp eax,eax // always true
mov eax,[ebx] // executed
je otherthing // will always jump to otherthing

otherthing:
mov edx,[eax] // random thing

[Disable]
0123456:
// put original code here so you ca nturn it off
dealloc(newmem)



Also go check out this thread to see how some scripts can be written:
http://forum.cheatengine.org/viewtopic.php?t=112385
Back to top
View user's profile Send private message
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Fri Apr 18, 2008 12:24 am    Post subject: Reply with quote

What happens if i have multiple jumps in my newmem?

i.e.
Code:

newmem:
cmp eax,eax
je otherlabel
mov eax,[ebx]
cmp eax,edx
je otherlabel2


Once the second cmp is executed wont it replace the CF(or was it ZF?) flag with it's own result and then you'll only be able to jump if equal with the second one since the first CF(zf?) flag got wiped and is now the same as the second cmp's result?
Back to top
View user's profile Send private message AIM Address MSN Messenger
Dark Byte
Site Admin
Reputation: 472

Joined: 09 May 2003
Posts: 25869
Location: The netherlands

PostPosted: Fri Apr 18, 2008 6:41 am    Post subject: Reply with quote

yes, thats why you jump BEFORE doing the next cmp
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Psy
Grandmaster Cheater Supreme
Reputation: 1

Joined: 27 Mar 2008
Posts: 1366

PostPosted: Fri Apr 18, 2008 7:00 am    Post subject: Reply with quote

Lol DB Wink

If you want to force something to jump why bother with the extra cmp/test?

Just make it a jmp or ret.
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