MetaCode Tutorial
MetaCode Tutorial
© by RTFC, 2013.
$Array[0]=1 {var1}[0]=1
$Array[1]=True {var1}[1]=True
$Array[2]="Text" {var1}[2]={string3}
$Array[3]=$AnotherArray {var1}[3]={var2}
$Array[4]=@YEAR {var1}[4]={macro101}
In your own code, you will likely be using your own text strings.
We can extract and list these sequentially in another array:
$stringsUsed[]
1: “Tutorial”
2: “Hello World!”
Tag Type identifier string refers to this array.
The Tag ID number is the base-1 index to this array. array $stringsUsed[]
Note that strings are stored with their enclosing single- or double-quotes.
MetaCode Tags are Array pointers (3)
$header="Tutorial" {var1} = {string1}
$text="Hello World!“ {var2} = {string2}
_ShowMessage($header,$text) {funcU1}({var1}{var2})
Variables and User-Defined Functions (UDFs) work just like strings. 1: $header
2: $text
We can extract and list these sequentially in two other arrays:
3: $title
$variablesUsed[] and $functionsUsed[]. 4: $msg
array $variablesUsed[]
{var2} refers to $variablesUsed[2] = “$text”
{funcU1} refers to $functionsUsed[1] = “_ShowMessage”
1: _ShowMessage
Note that variables are stored with their $-prefix. array $functionsUsed[]
Note that functions are stored without brackets suffix.
CodeScanner creates MetaCode + Arrays
(etc...)
CodeScanner can separate a script into:
(#include 3)
• Structure (MetaCode files) (#include 2)
(#include 1)
• Content (Arrays)
(your script)
Code Structure
Single portable
Structure
(can be changed)
Structure per file
Single portable
Structure
Single portable
Structure
(can be changed)
New Arrays
1: “Tutorial” 1: “Tutoría”
2: “Hello World!” 2: “¡Hola Mundo”
array $stringsUsed[] array $stringsTransl[]
New AutoIt Script
$encabezamiento = " Tutoría"
1: $header 1: $encabezamiento $texto = "¡Hola Mundo“
2: $text 2: $texto _ PresentarMensage($encabezamiento, $texto)
3: $title 3: $titulo
Func _PresentarMensage($titulo, $msg)
4: $msg 4: $msg MsgBox ( 0, $titulo, $msg )
array $variablesUsed[] array $variablesTransl[] EndFunc
Phrases replace:
Conditionals (If ... Then, While ..., Until ...)
Function calls (native and UDF, single or nested)
Macros
array $phrasesUsed[]
1: $value > 0
2: MsgBox( 0, “Hello“, @username)
Example:
#include “MCFinclude.au3”
$header="Tutorial"
The decryption key is not stored anywhere, $text="Hello World!“
making static decompilation without the key impossible. _ShowMessage($header, $text)
So do not lose your key!
Func _ShowMessage($title, $msg)
MsgBox ( 0, $title, $msg )
EndFunc
Encrypted AutoIt code (no obfuscation, but this can be added as well)
$header=_MCFCC("0x4D1CBA0F3B9A7216D704EFCDCA2E95D74E8ADFC76D9C765D337421793D387881",3)
$text=_MCFCC("0x8F8B44D212D47E36CCAEF2ACC868CAB45F94BB5C6D4EF0365D15D49959C0B5BB",3)
Execute(_MCFCC("0xAB6A02A6D2F485FD1BBDA43635E95AB7503657412D8FA368775A85E79743C2AB4BDDCFBD315DE951A99C7831F91D4C27",3))
Func _ShowMessage($title,$msg)
Execute(_MCFCC("0x66FD31B792B019FD157FB0D34C26A3E15470625870EB6C9654F58754641CF0866CF9BB39050FA45D86E0449FC7E40CE0",3))
EndFunc
Changing Content, in order
Note: Each of these steps is optional
BackTranslation
Obfuscation (variables and/or UDFs)
Encryption (various easy settings)
Incorporating into a new script your
translated arrays
Incorporating into a new script any
*New[] array content you define
externally, without intervention