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 


Step 9 on CE tutorial

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

Joined: 02 Jan 2023
Posts: 2

PostPosted: Mon Jan 02, 2023 12:02 pm    Post subject: Step 9 on CE tutorial Reply with quote

Hey everyone, I've been going at this for hours now and I can't seem to find a satisfying answer so maybe some of you could help me find the error on this assembly code

So on step 9(x32) CE tutorial
Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
cmp dword ptr [ebx+10], 01 // or cmp [ebx+10], 1
je exit

originalcode:
mov [ebx+04],eax
fldz

exit:
jmp returnhere

"Tutorial-i386.exe"+28E89:
jmp newmem
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Tutorial-i386.exe"+28E89:
mov [ebx+04],eax
fldz
//Alt: db 89 43 04 D9 EE


Why won't this simple code work? It checks for the team number, if it's 1 it just does nothing(jump exit) else it should go to the original code...
It gives me a floating point op exception... Why? I'm not even handling floating numbers (team number isn't a float... right?)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Mon Jan 02, 2023 1:28 pm    Post subject: Reply with quote

Code:
fldz
This is not code you want to skip. Move it to where it's run for both enemies and allies.
Code:
...
je exit

originalcode:
mov [ebx+04],eax

exit:
fldz
jmp returnhere

_________________
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
bally53
How do I cheat?
Reputation: 0

Joined: 02 Jan 2023
Posts: 2

PostPosted: Mon Jan 02, 2023 5:55 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Code:
fldz
This is not code you want to skip. Move it to where it's run for both enemies and allies.
Code:
...
je exit

originalcode:
mov [ebx+04],eax

exit:
fldz
jmp returnhere


Thanks so much, yes that makes sence, so I've read the documentation about fldz, it basically pushes 0.0 on the stack, I'm guessing the program will pop that stack somewhere else where it needs that 0 and since nothing was on the stack it crashed?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Mon Jan 02, 2023 6:00 pm    Post subject: Reply with quote

That's correct.

More specifically, it's the FPU stack. This is separate from the thread's stack (esp register).

_________________
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 -> General Discussions 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