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 


Two instructions. Store ESI, at one. And use it at the other

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

Joined: 17 May 2010
Posts: 58
Location: India

PostPosted: Mon Feb 23, 2015 4:43 pm    Post subject: Two instructions. Store ESI, at one. And use it at the other Reply with quote

@Admin. Did not know to what to name the topic. Edit it if and as you wish.

Game : Fallout 3 GotY Edition.

I have two different instruction which are called when I select a weapon from the weapons menu in the game. I want to set the 'Weapon Condtion' to 100%.

This instruction is for the HUD/Display only.

Code:
Fallout3.exe+24625A - - fstp dword ptr [Fallout3.exe+B6ACA4]


And the value of ESI at this instant is the MAX weapon condtion of that particular weapon.

And this one is for the actual values for the structure of that weapon.
Code:
Fallout3.exe+1D38D - - fld dword ptr [esi+0C]


They are both called when I select that weapon.

I want to get the value of ESI from the first instruction. Which is hex turn it the equivalent float. That is .. hex 96 is decimal 150. But I need float 150 and store it in [esi+0C] of the second instruction.

Can this even be done?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Feb 23, 2015 7:51 pm    Post subject: This post has 1 review(s) Reply with quote

Did you leave off one of the instructions?

According to the code you posted, the first value is a static pointer.

In the second code block, you can simply use that same address.

Code:
fld dword ptr [Fallout3.exe+B6ACA4] // static address
fst dword ptr [esi+0C] // don't pop it
// ... normal application flow


No conversion from int to float required.

By the way, converting from int to float is easy:
Code:
fild [integer.address]
Back to top
View user's profile Send private message
LykanthricAura
Advanced Cheater
Reputation: 0

Joined: 17 May 2010
Posts: 58
Location: India

PostPosted: Tue Feb 24, 2015 4:26 am    Post subject: Reply with quote

Thanks. It seems to be working.

Seems it was fairly easy. I should read up more on the floating point operations. I m not very well versed with fld and fst and such.
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