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 


Restore modified value in [DISABLE] section

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

Joined: 01 Mar 2016
Posts: 28

PostPosted: Tue Mar 01, 2016 4:39 pm    Post subject: Restore modified value in [DISABLE] section Reply with quote

Hello There,

Here is a sample of my code where i modify a value in memory

Code:

[ENABLE]

Original_UI_Size:
  dd (float)64

... do some code
movss [rdx+120],xmm2               // We change the UI size in memory
... do some code




What i would like to do is to restore the original value in rdx + offset register in [DISABLE] section.
Some kind of opcode that may looks like
movss [rdx+120], my original value in Original_UI_Size

How can i do this

Any help appreciated
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Mar 01, 2016 6:25 pm    Post subject: Reply with quote

Code:
[ENABLE]
label(ui_backup)
...
movss [rdx+120],xmm2
mov [ui_backup],rdx
jmp return

ui_backup:
  dq 0
...
registersymbol(ui_backup)
[DISABLE]
{$lua}
local ptr = readPointer("ui_backup")
if ptr ~= 0 then
  writeFloat(ptr + 0x120, 64)
end
{$asm}
...
unregistersymbol(ui_backup)
Back to top
View user's profile Send private message
k4sh
Cheater
Reputation: 0

Joined: 01 Mar 2016
Posts: 28

PostPosted: Wed Mar 02, 2016 3:00 am    Post subject: Reply with quote

Thanks, i'll give a shot tonight.

I can understand the lua script but what is the the {$asm} line for ?
Is it aimed to introduce new opcodes ?
Back to top
View user's profile Send private message
k4sh
Cheater
Reputation: 0

Joined: 01 Mar 2016
Posts: 28

PostPosted: Wed Mar 02, 2016 1:17 pm    Post subject: Reply with quote

Ok it works like a charm. The only thing is that the following code doesn't compile. It executes however.

Code:

writeFloat(ptr + 0x120, 64)
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