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 


Auto Assemble script help - Adding

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

Joined: 12 May 2011
Posts: 41

PostPosted: Fri Oct 30, 2015 10:05 am    Post subject: Auto Assemble script help - Adding Reply with quote

Hey guys, I was wondering if anyone could help point me in the right direction for what instructions I could use to add a specific set value to the already existing value of an address.

This is basically what I have so far:

Code:
originalcode:
fstp dword ptr [esi+0000009C]


This is the game naturally increasing a Float value by 0.05 precisely every time a certain item is picked up.

What I want to get it to do is add 0.3 or any custom number instead.

The closest I could get to working injectable code was when I used this:

Code:
label(value)

originalcode:
fstp dword ptr [esi+0000009C]

addss xmm2 [value]
movss [esi+0000009C],xmm2
jmp exit

exit:
jmp returnhere

value:
dd (float)0.25


But this unfortunately sets the value of the address to 0.25 every time instead, when the default with no pickups is exactly 1.. thus giving pretty much opposite to the desired effect.

I do realize I have very little and limited knowledge about this, please forgive my lacking ability. Any help would be appreciated for learning how to add custom amounts (especially floats/doubles) to address values in this sort of way.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Oct 30, 2015 10:47 am    Post subject: Reply with quote

Put "fadd [value]" before the original "fstp"
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4723

PostPosted: Fri Oct 30, 2015 5:06 pm    Post subject: Reply with quote

"fadd dword ptr [value]" is safer. [value] could also reference a qword.

You should get rid of those addss and movss instructions unless they were there originally. The first float in xmm2 probably had a value of 0 originally, then you added 0.25 to it (so first float in xmm2 = 0.25), then you just stored xmm2 into your address. Hence it'll always be 0.25.

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