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 


Assigning an address

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

Joined: 26 Dec 2022
Posts: 26
Location: Wasilla, Ak

PostPosted: Mon Dec 26, 2022 11:53 am    Post subject: Assigning an address Reply with quote

Code:

alloc(MedicineCap,4,"HorizonZeroDawn.exe"+1020F5A)
registersymbol(MedicineCap)

label(returnhere)

newmem:

movss xmm2,[rdi+5C]                              // My Code: Bypass calculate value from game to medicine cap
movss [rdi+58],xmm2                              // Game Code: Copies calculated value into the current medicine pouch
jmp returnhere

"HorizonZeroDawn.exe"+1020F5A:
jmp newmem
returnhere:


How can I assign this
Code:
[rdi+5C]
to my MedicineCap?

When I try this
Code:
movss [MedicineCap],[rdi+5C]
Cheat Engine says it can't be compiled.

Last edited by phpjunkie on Mon Dec 26, 2022 1:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1069
Location: 0x90

PostPosted: Mon Dec 26, 2022 1:17 pm    Post subject: Reply with quote

I presume the medicine cap is the limitation of how many medicinal items you can carry at any one-time? If so you can override the value referenced by [rdi+5C]
Code:

alloc(MedicineCap,4,"HorizonZeroDawn.exe"+1020F5A)
alloc(medCap,8)
registersymbol(MedicineCap)

label(returnhere)

medCap:
  dq (float)999

newmem:
movss xmm2,[medCap]                              // My Code: Bypass calculate value from game to medicine cap
movss [rdi+58],xmm2                              // Game Code: Copies calculated value into the current medicine pouch
jmp returnhere

"HorizonZeroDawn.exe"+1020F5A:
jmp newmem
returnhere:

...

[DISABLE]
...

dealloc(medCap)


Quote:
When I try this
Code:
movss [MedicineCap],[rdi+5C]
Cheat Engine says it can't be compiled.


That's because you can't copy a deferenced value to the address of another section of memory with a single instruction.
Back to top
View user's profile Send private message
phpjunkie
Cheater
Reputation: 0

Joined: 26 Dec 2022
Posts: 26
Location: Wasilla, Ak

PostPosted: Mon Dec 26, 2022 1:24 pm    Post subject: Reply with quote

Code:
[rdi+58]
is the value of the medicine and
Code:
[rdi+5C]
is the cap.

The code works as far as capping the medicine. What I'm trying to do, is display the cap in the address list of cheat engine with my script so when I enable the script it shows the cap.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Mon Dec 26, 2022 3:03 pm    Post subject: Reply with quote

memory-to-memory operations generally can't happen. Most of the time, it must be done through a register.

After `movss xmm2,[rdi+5C]`, xmm2 now contains the float at [rdi+5C]. Simply move xmm2 into [MedicineCap] via `movss [MedicineCap],xmm2`

It might be better to copy the address instead of the value. i.e.:
Code:
...
alloc(MedicineData,8,"HorizonZeroDawn.exe"+1020F5A)
registersymbol(MedicineData)

MedicineData:
  dq 0

newmem:
  mov [MedicineData],rdi
  movss xmm2,[rdi+5C]
  movss [rdi+58],xmm2
  jmp returnhere
...
After that, add a new address to the address list, check the "Pointer" checkbox, use MedicineData as the base address, and use 5C for the only offset.
_________________
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