View previous topic :: View next topic |
Author |
Message |
Wuschel How do I cheat? Reputation: 0
Joined: 26 Sep 2021 Posts: 4
|
Posted: Sun Sep 26, 2021 2:14 pm Post subject: Help with multi-level pointers script |
|
|
Hello everyone!
I'm struggling with a AoB script and maybe you can help.
As you can see from the attached file, what I would like to do is to copy the value of the Item4, then replace it to 0 and paste the value in Item6.
But I can't find a way to do it...
I could copy the value without problem.
But I tried many ways to move the value, and it's never the same value that appears in Item6...
What I did so far is this:
Code: |
aobscanmodule(MoveValue,GameAssembly.dll,48 8B FA 48 8B D9 75 12 8B 0D) // should be unique
alloc(newmem,$1000,MoveValue)
label(code)
label(code2)
label(return)
// Structure
label(_PUI)
registersymbol(_PUI)
// Value to copy
label(_COPY_Item4)
registersymbol(_COPY_Item4)
newmem:
code:
mov rdi,rdx
mov rbx,rcx
mov [_PUI],rbx
push rbx
mov rbx,rcx
cmp rbx,0
je code2
mov rbx,[rbx+60]
cmp rbx,0
je code2
mov rbx,[rbx+10]
cmp rbx,0
je code2
push rax
lea rax,[rbx+40]
cmp rax,0
je code2
mov [_COPY_Item4],rax
pop rax
// -------------------------------
// Not working from here
//push rax
//lea rax,[rbx+50]
//cmp rax,0
//je code2
//mov [rax],_COPY_Item4
//pop rax
// not working either
//lea rbx,[rbx+50]
//cmp rbx,0
//je code2
//mov [rbx],_COPY_Item4
// not working either
//mov rbx,[rbx+50]
//cmp rbx,0
//je code2
//mov [rbx],_COPY_Item4
// -----------------------------
pop rbx
jmp return
code2:
mov rdi,rdx
mov rbx,rcx
jmp return
_COPY_Item4:
dq 0
_PUI:
dq 0
MoveValue:
jmp newmem
nop
return:
registersymbol(MoveValue)
[DISABLE]
MoveValue:
db 48 8B FA 48 8B D9
unregistersymbol(MoveValue)
unregistersymbol(_PUI)
unregistersymbol(_COPY_Item4)
dealloc(newmem)
|
Description: |
|
Filesize: |
42.77 KB |
Viewed: |
2387 Time(s) |
|
Last edited by Wuschel on Sun Sep 26, 2021 3:20 pm; edited 1 time in total |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Sep 26, 2021 3:20 pm Post subject: |
|
|
This isn't Lua. It's auto assembler.
|
|
Back to top |
|
|
Wuschel How do I cheat? Reputation: 0
Joined: 26 Sep 2021 Posts: 4
|
Posted: Sun Sep 26, 2021 3:28 pm Post subject: |
|
|
Indeed, I first tried in assembler but it's a mess kinda.
Wanted to see in lua if it could be done easily maybe
I tried using {$lua} writeBytes, using the good offsets (takes less place than in asm) and so on but it was a dead end too.
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Sep 26, 2021 3:42 pm Post subject: |
|
|
This will find the entry in the table with Lua, set its value and then remove the value from the other entry.
Code: |
[ENABLE]
{$LUA}
local al = getAddressList()
local item4 = al.getMemoryRecordByDescription('Item4 (offset+40)')
local item6 = al.getMemoryRecordByDescription('Item6 (offset+50)')
if item4 ~= nil and item6 ~= nil then
item6.value = item4.value
item4.value = 0
end
{$ASM}
[DISABLE]
|
|
|
Back to top |
|
|
Wuschel How do I cheat? Reputation: 0
Joined: 26 Sep 2021 Posts: 4
|
Posted: Sun Sep 26, 2021 3:56 pm Post subject: |
|
|
LeFiXER wrote: | This will find the entry in the table with Lua, set its value and then remove the value from the other entry.
Code: |
[ENABLE]
{$LUA}
local al = getAddressList()
local item4 = al.getMemoryRecordByDescription('Item4 (offset+40)')
local item6 = al.getMemoryRecordByDescription('Item6 (offset+50)')
if item4 ~= nil and item6 ~= nil then
item6.value = item4.value
item4.value = 0
end
{$ASM}
[DISABLE]
|
|
Wow, thanks!
Extremely short and it works perfectly, couldn't expect better!
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Sep 26, 2021 4:16 pm Post subject: |
|
|
I hope it's understandable what the code is actually doing too. If you're curious about what Lua functions are available for Cheat Engine, you should check out celua.txt
celua.txt
|
|
Back to top |
|
|
Wuschel How do I cheat? Reputation: 0
Joined: 26 Sep 2021 Posts: 4
|
Posted: Sun Sep 26, 2021 4:31 pm Post subject: |
|
|
LeFiXER wrote: | I hope it's understandable what the code is actually doing too. If you're curious about what Lua functions are available for Cheat Engine, you should check out celua.txt
|
Very clear, didn't think of using my local structure that way.
Was still trying to do everything, memory side lol
But yes as long as description is unique, it's a good way to extract things from the address list!
Thanks again for this method
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Sun Sep 26, 2021 4:44 pm Post subject: |
|
|
You're most welcome!
|
|
Back to top |
|
|
|