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 


Multiplying a value

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

Joined: 20 Feb 2022
Posts: 8

PostPosted: Sun Feb 20, 2022 1:18 am    Post subject: Multiplying a value Reply with quote

Trying my very first code injection, feeling lost.

The code I'm trying to edit is:

movsd [rsi+48],xmm0

I want to multiply this result by a float (1.3, to be specific).

I found this discussion where someone was trying to do something very similar:

EDIT:(ugh, it won't let me post links. The thread is called "Multiplying a double register")

but I always end up crashing my game when I try it.

Part of the problem is that I don't really understand how to incorporate the code into the template I'm using. I am using the Full Injection Template, so my starting code looks like this:

Code:
define(address,1ADEADF2B88)
define(bytes,F2 0F 11 46 48)

[ENABLE]

assert(address,bytes)
alloc(newmem,$1000,1ADEADF2B88)

label(code)
label(return)

newmem:

code:
  movsd [rsi+48],xmm0
  jmp return

address:
  jmp newmem
return:

[DISABLE]

address:
  db bytes
  // movsd [rsi+48],xmm0

dealloc(newmem)


Trying to adapt any of the solutions found in that thread leads to an instant crash, but I am probably not inserting it into the template correctly.

Any help is appreciated. Thanks![/code]
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 51

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun Feb 20, 2022 2:11 am    Post subject: Reply with quote

something like this should do the trick.
Code:
define(address,1ADEADF2B88)
define(bytes,F2 0F 11 46 48)

[ENABLE]

assert(address,bytes)
alloc(newmem,$1000,1ADEADF2B88)

label(code)
label(return)

label(multiplier)
//registerSymbol(multiplier) // uncomment this if you want to access it in the address list

newmem:

code:
  mulsd xmm0,[multiplier]
  movsd [rsi+48],xmm0
  jmp return
multiplier:
  dq (double)1.3

address:
  jmp newmem
return:

[DISABLE]

address:
  db bytes
  // movsd [rsi+48],xmm0

dealloc(newmem)
//unregisterSymbol(multiplier)

_________________
Back to top
View user's profile Send private message Visit poster's website
Antifringe
How do I cheat?
Reputation: 0

Joined: 20 Feb 2022
Posts: 8

PostPosted: Sun Feb 20, 2022 2:52 am    Post subject: Reply with quote

Wow, that worked first try! Thanks!

Yeah, the problem was that I was not understanding where exactly to put all of the new code. Having your example helps a lot. I'm already experimenting with new injections.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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