View previous topic :: View next topic |
Author |
Message |
Rexkh Newbie cheater Reputation: 0
Joined: 04 Feb 2020 Posts: 18
|
Posted: Mon Feb 10, 2020 1:56 am Post subject: How to retrieve Register's value to use outside of script |
|
|
Hi, How can I move value of ESP into a variable and use that variable in Cheat Table.
mov myAddress,ESP then
Add the variable in Cheat Table(Ex. myAddress+18) |
|
Back to top |
|
|
DanyDollaro Master Cheater Reputation: 3
Joined: 01 Aug 2019 Posts: 334
|
Posted: Mon Feb 10, 2020 11:53 am Post subject: |
|
|
You must use the Registersymbol() function.
Code: | [ENABLE]
aobscanmodule(INJECT,devenv.exe,00 00 00 00 00 00)
alloc(newmem,$1000)
alloc(myAddress, 8) // <- Look at this
registersymbol(myAddress) // <- this
label(code)
label(return)
newmem:
mov [myAddress], esp // <- this
code:
add [eax],al
add [eax],al
add [eax],al
jmp return
INJECT+03:
jmp newmem
nop
return:
registersymbol(INJECT)
[DISABLE]
INJECT+03:
db 00 00 00 00 00 00
unregistersymbol(INJECT)
unregistersymbol(myAddress) // <- and this
dealloc(newmem)
dealloc(myAddress) |
At the end, just add the name of the symbol you used in this case "myAddress" to the cheat table to be able to edit the value ESP was pointing at that moment.
Full cheat table:
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="29">
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"Auto Assemble script"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>[ENABLE]
aobscanmodule(INJECT,devenv.exe,00 00 00 00 00 00)
alloc(newmem,$1000)
alloc(myAddress, 8)
registersymbol(myAddress)
label(code)
label(return)
newmem:
mov [myAddress], esp
code:
add [eax],al
add [eax],al
add [eax],al
jmp return
INJECT+03:
jmp newmem
nop
return:
registersymbol(INJECT)
[DISABLE]
INJECT+03:
db 00 00 00 00 00 00
unregistersymbol(INJECT)
unregistersymbol(myAddress)
dealloc(newmem)
dealloc(myAddress)
</AssemblerScript>
</CheatEntry>
<CheatEntry>
<ID>1</ID>
<Description>"Your address"</Description>
<VariableType>4 Bytes</VariableType>
<Address>myAddress</Address>
</CheatEntry>
</CheatEntries>
<UserdefinedSymbols/>
</CheatTable>
|
If you want to add an offset you can use "myAddress + 18" |
|
Back to top |
|
|
Rexkh Newbie cheater Reputation: 0
Joined: 04 Feb 2020 Posts: 18
|
Posted: Tue Feb 11, 2020 2:06 am Post subject: |
|
|
It works as expected. Thanks
On the other hand, I know we can set Data Breakpoint condition on an address. Can we set condition on FPU register? Ex. What opcode write/push (float)160 to ST(0) |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Tue Feb 11, 2020 2:15 am Post subject: |
|
|
yes, but you have to predeclare a function in lua first for that to work
Code: |
function getFP0()
debug_getContext(true)
return byteTableToExtended(FP0)
end
|
then you can use as condition:
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Rexkh Newbie cheater Reputation: 0
Joined: 04 Feb 2020 Posts: 18
|
Posted: Tue Feb 11, 2020 2:28 am Post subject: |
|
|
I'm not sure where to declare this function in Cheat Engine.
Where can I use the condition getFP0()==160? |
|
Back to top |
|
|
|