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 


When two fstp.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Tue Nov 01, 2016 4:46 pm    Post subject: When two fstp. Reply with quote

Original injection without edits.
fld dword ptr [eax+24] is current stamina.
Code:
aobscan(Stamina,F3 83 C4 10 39 36 8B 46 14 D9 40 24 D9 5D D0)
alloc(newmem,$100)
label(code)
label(return)

newmem:

code:
  fld dword ptr [eax+24]
  fstp dword ptr [ebp-30]
  jmp return

Stamina+09:
  jmp newmem
  nop
return:
registersymbol(Stamina)


Is it safe to edit like this?
Code:
aobscan(Stamina,F3 83 C4 10 39 36 8B 46 14 D9 40 24 D9 5D D0)
alloc(newmem,$1000)
label(code)
label(return)

newmem:
  fld dword ptr [eax+20]
  fstp dword ptr [eax+24]
  jmp return

code:
  fstp dword ptr [ebp-30]
  jmp return

Stamina+09:
  jmp newmem
  nop
return:
registersymbol(Stamina)

fld dword ptr [eax+20] is max stamina.
Wondering cause of two fstp.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Nov 01, 2016 4:47 pm    Post subject: Reply with quote

Leave off the "P" and it won't pop the float off the stack.
Code:
aobscan(Stamina,F3 83 C4 10 39 36 8B 46 14 D9 40 24 D9 5D D0)
alloc(newmem,$1000)
label(code)
label(return)

newmem:
  fld dword ptr [eax+20]
  fst dword ptr [eax+24]
  //jmp return -- edited

code:
  fstp dword ptr [ebp-30]
  jmp return

Stamina+09:
  jmp newmem
  nop
return:
registersymbol(Stamina)


Last edited by Zanzer on Tue Nov 01, 2016 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Tue Nov 01, 2016 4:49 pm    Post subject: Reply with quote

That was fast.
Thank you.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Nov 01, 2016 4:54 pm    Post subject: Reply with quote

Oh wait. I just noticed you had a JMP RETURN in there. Remove the first one.
Back to top
View user's profile Send private message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Tue Nov 01, 2016 4:58 pm    Post subject: Reply with quote

Done.
If there is jmp return it jump over/skip fstp dword ptr [ebp-30] ?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Nov 01, 2016 5:13 pm    Post subject: Reply with quote

Correct. Which makes it so having the two FSTP doesn't cause a crash.
However, the game is putting your stamina value into [ebp-30] for a reason.
So by skipping that, who knows what issue you could cause down the road.
Back to top
View user's profile Send private message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Tue Nov 01, 2016 5:29 pm    Post subject: Reply with quote

Gotcha and Thank you for making things clear.
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 Gamehacking 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