| View previous topic :: View next topic |
| Author |
Message |
k4sh Cheater
Reputation: 0
Joined: 01 Mar 2016 Posts: 28
|
Posted: Tue Mar 01, 2016 4:39 pm Post subject: Restore modified value in [DISABLE] section |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Mar 01, 2016 6:25 pm Post subject: |
|
|
| 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 |
|
 |
k4sh Cheater
Reputation: 0
Joined: 01 Mar 2016 Posts: 28
|
Posted: Wed Mar 02, 2016 3:00 am Post subject: |
|
|
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 |
|
 |
k4sh Cheater
Reputation: 0
Joined: 01 Mar 2016 Posts: 28
|
Posted: Wed Mar 02, 2016 1:17 pm Post subject: |
|
|
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 |
|
 |
|