 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Kamd Cheater
Reputation: 1
Joined: 02 May 2018 Posts: 28
|
Posted: Mon Sep 02, 2019 7:39 pm Post subject: autoAssemble and disableInfo help |
|
|
I am integrating an Assembly script in Lua.
As far as I know, disableInfo is a boolean, with true making it run the [DISABLE] section.
Though I read this thread, where they use disableInfo to access things defined from the Assembly script. Can someone give me more info about this, and how to properly use it?
For example,
| Code: | ---- Enable script
local enabledOk, disableInfo = autoAssemble(scriptStr)
if enabledOk then
print('The auto assembler script was enabled successfully.')
else
print('There was an error enabling the auto assembler script.')
end
print(disableInfo.allocs.newmem.address)
local val = readInteger(disableInfo.allocs.newmem.address)
print(tostring(val)) |
So is disableInfo a special type, or..?
|
|
| Back to top |
|
 |
FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Sep 02, 2019 8:16 pm Post subject: |
|
|
no it's not a boolean it's a table of information for how to disable the script.
if you were to run some code like this (note it uses a 3rd party library added to the autorun folder with a slight modification so I don't have to "require" it) | Code: | local success, disableInfo = autoAssemble[[[ENABLE]
alloc(newmem,$1000) // not automatically known outside the script
globalalloc(global,$2000) // automatically registered/known, not deallocated
registerSymbol(newmem)
label(skip_except_code)
// some fake code that's not actually called but creates an exception point
newmem:
xor eax,eax
{$try}
mov eax,[eax] // deref NULL pointer, throw exception
add eax,1 // can't be reached
jmp skip_except_code // if we didn't get an exception, skip handling it
// label code will jump to when exception is thrown
{$except}
mov eax, 0
skip_except_code:
ret
[DISABLE]
dealloc(newmem)
unregistersymbol(newmem)]]
print(type(success), tostring(success))
-- note serpent is a lua pretty print library I've added to CE's autorun folder
print(type(disableInfo), serpent.block(disableInfo))
| you'd get results like this: | Code: | boolean true
table {
allocs = {
newmem = {
address = 42205184, --note in decimal
size = 4096
} --[[table: 0000000008E58600]]
} --[[table: 0000000008E585C0]],
exceptionlist = {
42205186 -- try starts after the xor, a 2 byte instruction
} --[[table: 0000000008E576C0]],
registeredsymbols = {
"newmem"
} --[[table: 0000000008E57BC0]]
} --[[table: 0000000008E581C0]]
|
If you're willing to read some Pascal code you can see where CE generates it here
As for using it, a lot of the time you aren't going to do anything other than store it and pass it to autoAssemble when you are ready to disable the script so it can use that information. If you want to also use that information, you can.
_________________
|
|
| Back to top |
|
 |
|
|
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
|
|