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 


Set Value on Script Toggle

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

Joined: 14 Jan 2025
Posts: 1

PostPosted: Tue Jan 14, 2025 3:05 pm    Post subject: Set Value on Script Toggle Reply with quote

Hello,

I have the following script which works great:

Code:

[ENABLE]
alloc(newmem,2048,22B7C93594C)
label(returnhere)
label(originalcode)
label(exit)

newmem:
mov ecx,#39321

originalcode:
mov [rax],ecx
mov rcx,rbp

exit:
jmp returnhere

22B7C93594C:
jmp newmem
returnhere:
 
 
[DISABLE]
dealloc(newmem)
22B7C93594C:
db 89 08 48 8B CD
//mov [rax],ecx
//mov rcx,rbp


The script sets the value to 39321 when the specific event is triggered, but how do I set the value of the address "22A173349C8" to 39321 in the same script beforehand, just once on toggle, because it needs that value before the event? Thanks!
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3321

PostPosted: Tue Jan 14, 2025 3:14 pm    Post subject: Reply with quote

Believe me when I say, you don't want to use a fixed address.
Back to top
View user's profile Send private message
jgoemat
Master Cheater
Reputation: 23

Joined: 25 Sep 2011
Posts: 264

PostPosted: Thu Jan 23, 2025 8:04 am    Post subject: Reply with quote

I'm not exactly sure what you want to do, and these addresses will change when you restart the game, but for the base question of "I want to set the value at address "22A173349C8" to the decimal 32-bit value "39321", the first lines here will do it. It sets the address of the assembler to that address and just writes that value as a 'dd' or doubleword 32 bit value.

Code:

[ENABLE]

// set value directly when enabling
22A173349C8:
  dd #39321

alloc(newmem,2048,22B7C93594C)
label(returnhere)
label(originalcode)
label(exit)

newmem:
mov ecx,#39321

originalcode:
mov [rax],ecx
mov rcx,rbp

exit:
jmp returnhere

22B7C93594C:
jmp newmem
returnhere:
 
 
[DISABLE]
dealloc(newmem)
22B7C93594C:
db 89 08 48 8B CD
//mov [rax],ecx
//mov rcx,rbp
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