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 


X and Y turncap values

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

Joined: 16 Apr 2022
Posts: 2

PostPosted: Sat Apr 16, 2022 6:08 am    Post subject: X and Y turncap values Reply with quote

Hi there,
I am extremely new to CE and am trying to make a simple cheat that will increase turncap values on a melee game.
I managed to achieve this via very simple code, but only partially as when I enable the script, it increases my X turncap but completely disables all movement on the Y axis.
In the xmm0 register (pic below) I can see the values for the X and Y turncaps of the current weapon - how do I access and change both?



CE1.png
 Description:
xmm registers
 Filesize:  12.98 KB
 Viewed:  1219 Time(s)

CE1.png



CE2.png
 Description:
here is the (terrible) code i used
 Filesize:  16.86 KB
 Viewed:  1220 Time(s)

CE2.png


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4302

PostPosted: Sat Apr 16, 2022 10:56 am    Post subject: Reply with quote

movsd moves a double, not a float.
Are you sure that injection point is ok? IIRC there's a performance hit when reinterpreting the data in a vector register (i.e. doubles as floats). A good compiler would generate that code if it were overwriting the floats in the register- not if it were going to reinterpret the double as two floats later on.
Anyway:
Code:
...
alloc(newmem,2048)
label(turncaps)
label(x_turncap)
label(y_turncap)
registersymbol(x_turncap) // in case you want to dynamically change the value
registersymbol(y_turncap) // in case you want to dynamically change the value

newmem:
  movaps xmm0,[turncaps]
  ...
  jmp return

align 10 CC
turncaps:
x_turncap:
  dd (float)1000.0
y_turncap:
  dd (float)1000.0
  dd 0
  dd 0

...

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

Joined: 16 Apr 2022
Posts: 2

PostPosted: Sat Apr 16, 2022 2:40 pm    Post subject: Reply with quote

ParkourPenguin wrote:
movsd moves a double, not a float.
Are you sure that injection point is ok? IIRC there's a performance hit when reinterpreting the data in a vector register (i.e. doubles as floats). A good compiler would generate that code if it were overwriting the floats in the register- not if it were going to reinterpret the double as two floats later on.
Anyway:
...
[/code]


Thanks so much! This worked perfectly, and thanks for letting me know how it works. I'm using this injection point as I can't really find another with my knowledge, but I haven't experienced any performance hits - this runs very smoothly for me.
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