Using AA registered symbol address in LUA script?

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
User avatar
SvT
Table Makers
Table Makers
Posts: 586
Joined: Tue Dec 24, 2019 5:17 am
Reputation: 1834

Using AA registered symbol address in LUA script?

Post by SvT »

I wrote a script that gets a valid address you can use to invoke a mono method.

How would I use this address in the second script below? I'm guessing I need to setup a variable in LUA and pass it to address in mono_invoke_method but I'm not sure how to do that.

Code: Select all

[ENABLE]
alloc(newmem,2048,Mdi.SRRW.UI:GameController:Awake+f9) 
label(returnhere)
label(originalcode)
label(exit)

registersymbol(instance)

newmem:
mov [instance],rax

originalcode:
movzx eax,byte ptr [rax+00000084]

exit:
jmp returnhere

instance:
dd 0

Mdi.SRRW.UI:GameController:Awake+f9:
jmp newmem
nop 2
returnhere:

[DISABLE]
unregistersymbol(instance)
dealloc(newmem)
Mdi.SRRW.UI:GameController:Awake+f9:
movzx eax,byte ptr [rax+00000084]
//Alt: db 0F B6 80 84 00 00 00

Code: Select all

[ENABLE]
{$lua}
if (syntaxcheck) then return end
local method = mono_findMethod('', 'Mdi.SRRW.AchievementProfile', 'RecordFinishTutorial2')
local class = mono_method_getClass(method)
local domain = mono_enumDomains()[1]
local hp = mono_invoke_method(domain, method, address, {})
{$asm}

[DISABLE]

JohnFK
Expert Cheater
Expert Cheater
Posts: 55
Joined: Tue Aug 29, 2017 10:50 am
Reputation: 24

Re: Using AA registered symbol address in LUA script?

Post by JohnFK »

Use [Link]

Code: Select all

local address = getAddress('[instance]')
local hp = mono_invoke_method(domain, method, address, {})

Post Reply

Who is online

Users browsing this forum: No registered users