panraven Grandmaster Cheater
Reputation: 61
Joined: 01 Oct 2008 Posts: 958
|
Posted: Tue Nov 03, 2015 5:23 am Post subject: Custom AA Command for MemoryRecord update/creation |
|
|
This is an AA Command extension to allow MemoryRecord manipulation in AA Script.
The command is MemoryRecord or MR, format:
Code: | MemoryRecord(mr-description-path,record-property-list) |
The mr-description-path is a collection of memory record description lua regular expression separated by symbol '/'.
It is in lua regular expression so that the matching need not be complete and exact.
For example, if the following is current address list:
Code: |
-GAMEZ
+-32bit
+-Folder1
+-Folder2 -- (a)
+-OHK
+-64-bit
+-Folder1 -- (b)
+-Folder2
+-money -- (c)
GAMEZ/32/Folder2 match (a)
GAME/64/Folder match (b)
GAMEZ/64%-bit/money match (c) , note that the minus sign need to be escape with lua re symbol %
|
If the memory record expressed by the desc-path not exist, it will be created. Then the record will be update with properties specified on activating. Note that the update will be done even the script activate fail.
record-property-list is the key-value pairs expressed as KEY=VALUE separated by comma ','
The following is an example, if the 64 bit ce is attached to itself , ie, cheatengine-x86_64.exe:
Code: | MR(ABC/DEF,Type=vtByteArray,Address="cheatengine-x86_64.exe",Aob.Size=10) |
Check main.lua at ce directory or https://raw.githubusercontent.com/cheat-engine/cheat-engine/master/Cheat%20Engine/bin/main.lua for the property of Memory Record.
The following is Memory Record Type defined in define.lua at ce directory:
Code: | vtByte=0
vtWord=1
vtDword=2
vtQword=3
vtSingle=4
vtDouble=5
vtString=6
vtUnicodeString=7 --Only used by autoguess
vtByteArray=8
vtBinary=9
vtAutoAssembler=11
vtPointer=12 --Only used by autoguess and structures
vtCustom=13
vtGrouped=14 |
If the MRAA.lua file has been load as table file in a *.ct, the following script can load & run it.
Code: | function loadTableFile(n,mode)
local hdr = 'loadTableFile: '
assert(type(n)=='string',hdr.."input should be a string -"..tostring(n).." of "..type(n))
local m = assert(findTableFile(n),hdr.."can't find table file -"..n).Stream
m = assert(readStringLocal(m.Memory,m.Size),hdr.."can't read content -"..n)
if type(mode)~='boolean' then return m end
m = assert(loadstring(m,n),hdr.."lua script load fail -"..n)
return mode and m() or m
end
loadTableFile("MRAA.lua",true) | ,
Sorry, not a detailed explain~
FIXED:
sorry, left an external function in the script, updated.
Description: |
custom AA command for MemoryRecord |
|
 Download |
Filename: |
MRAA.lua |
Filesize: |
7.01 KB |
Downloaded: |
1364 Time(s) |
_________________
- Retarded. |
|