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 


how to multiply a value before adding operation?

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

Joined: 14 Sep 2024
Posts: 2

PostPosted: Sat Sep 14, 2024 6:41 am    Post subject: how to multiply a value before adding operation? Reply with quote

hello i'm trying to make something to increase the speed of how much a skill increases
after finding and editing values by hand with the usual search and compare addresses i found out that all skills have their value written into from this specific bit of code

Code:
add [rax],r12d


i know nothing of assembler but since according to debugger that r12d value seems to always be the amount of how much skill increases whenever it's called, i think that to make skills grow faster i just need to multiply that value before doing this operation, the question is how do i do it?
Back to top
View user's profile Send private message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Sat Sep 14, 2024 9:35 am    Post subject: Reply with quote

You can change the operands

Code:
push rdx
push rbx
push rax

mov eax, 1         //operand 1
mov edx,r12d      //operand 2
mul edx
mov rbx,rax

pop rax
mov [rax],rbx
pop rbx
pop rdx
Back to top
View user's profile Send private message Visit poster's website
tdef
How do I cheat?
Reputation: 0

Joined: 14 Sep 2024
Posts: 2

PostPosted: Sat Sep 14, 2024 11:06 am    Post subject: Reply with quote

how do i do that? i see how to change that specific line but how do i add multiple ones?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Sat Sep 14, 2024 11:09 am    Post subject: Reply with quote

Use code injection. See the CE tutorial. There are plenty of walkthroughs if you're having trouble.

Alternative using floating point arithmetic:
Code:
alloc(newmem,2048)
alloc(skillMultiplier,8)

skillMultiplier:
  dq (double)2

newmem:
  cvtsi2sd xmm0,r12d
  mulsd xmm0,[skillMultiplier]
  cvttsd2si r12d,xmm0
// original code
  add [rax],r12d
  jmp return

...

registersymbol(skillMultiplier)
`registerSymbol` is so you can add that address to the address list and change it dynamically at runtime. (no need to disable the script, edit it, then reenable it)
_________________
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 -> 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