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 


Assembly JUMP if Greather or Equal..

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Dereta
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 9

PostPosted: Sun Aug 28, 2016 3:23 pm    Post subject: Assembly JUMP if Greather or Equal.. Reply with quote

Hey everyone Sad have try a lots of thinks that let crash my game Mad

I want to change the value of an adress after it reach the value 4 or higher to 0. But the game crashes...

here's my code:

Code:

push eax // Push EAX to save old value
mov eax, (int)4 // Write Number to compare with to eax
cmp [esi+00000410], eax // Compare Value @ esi+x with eax (4)?
jb 00F30016 // Jump
inc [esi+00000410] // Increase esi+x with 1
jmp 00F30020 // Jump to end
mov [esi+00000410], 0 // Write 0 to esi + x
pop eax // Get old EAX value
ret // Return


the old code was just this here:

Code:

inc [esi+00000410]


i replace it with a jump to my injected code... but as i say.. game crashes.. what did i wrong Confused

Thanks 4 helping :3
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Aug 28, 2016 4:20 pm    Post subject: Reply with quote

Jumps looks wrong. You're not popping EAX in all scenarios. Should you even be using RET?
Your code is probably all screwed up. Just use the built-in AOB Injection template.
Code:
code:
  cmp [esi+410],4
  jge @f
  inc [esi+410]
  jmp return
@@:
  mov [esi+410],0
  jmp return
Back to top
View user's profile Send private message
Dereta
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 9

PostPosted: Sun Aug 28, 2016 4:31 pm    Post subject: Reply with quote

Thanks Smile

This code now WORKS for me <3
Code:
cmp [esi+410], (int)3
je newmem+14
inc [esi+410]
jmp newmem+1E
mov [esi+410], 0
jmp return
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Mon Aug 29, 2016 2:29 am    Post subject: Reply with quote

Still doesn't look "good" because of the newmem-offsets you're using as jumps. Best define new labels and use those as jump addresses instead (just some improvement advise) ...
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