View previous topic :: View next topic |
Author |
Message |
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sun Aug 02, 2015 12:16 am Post subject: Local Symbol from Custom AA Command |
|
|
How to define a local symbol in a custom AA command?
For example, I define a custom aobscan,said MyScan, return 1st matched address on success, and suppose to assign to a local symbol in the aa script.
I try with this AA Lines:
Code: |
label(symbol)
10400000: // result address
symbol:
|
the custom aa command is define like this
Code: |
function split(s,sep)...end
function customScan(...)...end
function MyScan(scriptLine, checkSyntax)
local symbol,aob = unpack(split(scriptLine,','))
local Result
if checkSyntax==true then
Result = 0x20000 -- fake result for syntaxcheck
else
Result = customScan(aob) -- address of integer type or nil on fail
end
assert(Result~=nil)
-- return result lines for aa
return string.format([[
label(%s)
%X:
%s:
]],symbol,Result,symbol)
end
registerAutoAssembleCommand('MyScan',MyScan)
-- pseudo code, ignore typo or syntax error pls
|
It work with the AA Command execute alone, but not work if the local symbol is referred by following aa script.
If the result line is paste on the AA script, it work as expected.
It seems when execute as an AA Command, the result lines is not yet ready when other following aa script line referring the local symbol.
It can be done with lua version registerSymbol, but I want to simulate exactly the local symbol behavior.
Thank you~
_________________
- Retarded. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sun Aug 02, 2015 2:09 am Post subject: |
|
|
the way the local symbol handler functions is that every thing that can create a local symbol will check if the current line contains that symbol and if so, replace it with the hexadecimal value
to do what you want you'll have to use registerAutoAssemblerPrologue
in there first scan for your command, handle it, and replace all instances of the given variable with the outout
_________________
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 |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sun Aug 02, 2015 2:35 am Post subject: |
|
|
Dark Byte wrote: | the way the local symbol handler functions is that every thing that can create a local symbol will check if the current line contains that symbol and if so, replace it with the hexadecimal value
to do what you want you'll have to use registerAutoAssemblerPrologue
in there first scan for your command, handle it, and replace all instances of the given variable with the outout |
I see.
Some more questions, it seems using define(symbol, address) also can simulate a local symbol.
Which one (vs with label) has a closer match as local symbol from original aobscan?
Will it work if the symbol is a registered-symbol defined before? (ie. cause error or redefine the registered-symbol)
_________________
- Retarded. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sun Aug 02, 2015 2:51 am Post subject: |
|
|
ah yes, forgot about define
that'll work too
as for the difference, there's not much different after it has been defined (registersymbol doesn't work with defines though)
_________________
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 |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sun Aug 02, 2015 5:10 am Post subject: |
|
|
It seems the define symbol override the registered symbol.
Thank you, it is working now.
It is an aa version of AOBScan with protect and address range, I'll post the code later.
bye~
_________________
- Retarded. |
|
Back to top |
|
|
|