Prepare function sections
In order to correctly find and parse off functions, the Obfuscator needs a few simple format rules to be followed:
- The function definition must start in column 1.
- The ending brace
"}"
for the function and only this one must be in column 1
There cannot be any other - Function names can only be made out of letters, numbers, and the underscore.
"}"
in column 1 within the function. You can still use the ending curly brace within the function for instance to terminate the truth block of an if, but that curly brace would always have to be indented, it can not be in column 1. Prepare Label Sections
A few simple format rules need to be followed in order for the Obfuscator to find and parse off label sections:
- The label section header followed by
":"
has to start in column 1.
- The ending
RETURN
for the label section and only it has to start in column 1.
The - Label names can made out of only letters, numbers, and the underscore, similar to function names.
RETURN
statement can still be used within the section for instance as part of an if statement, but it would always have to be indented. Functions and Label Names
- DO NOT GIVE THE SAME NAME to one function and one label as the Obfuscator could assign the wrong obfuscated name
- DO NOT ASSIGN A STRING WITH THE SAME NAME AS ONE OF YOUR FUNCTION/LABEL
For example in this call
"FunctionName"
will be properly replaced.
SetTimer, % "FunctionName", 2000
But if not intended the replacement can break some of your code.Typical example is a function which as the same name of the function it calls via a
DllCall()
.
FunctionName() {
DllCall("FunctionName",...
}
Will make an invalid replacement of the "FunctionName"
in the DllCall()
Function names used without "()"
When you must use the name of a function without calling it or using the
It happens for exemple with use of
Ex:
Ex:
Otherwise the function name won't be obfuscated and an error will occur.
This is not the same with labels, which can be used without quotes.
The reason is that some function names sometimes have the same name as AHK system commands and therefore that would lead to invalid replacements.
()
, you should ALWAYS USE THE "FUNCTION NAME" IN QUOTES.
It happens for exemple with use of
A_ThisFunc
or inside Menu Items functions
Ex:
if (A_ThisFunc="FunctionName")
Ex:
Menu, MyMenu, Add, MenuItem, % "FunctionName"
Otherwise the function name won't be obfuscated and an error will occur.
This is not the same with labels, which can be used without quotes.
The reason is that some function names sometimes have the same name as AHK system commands and therefore that would lead to invalid replacements.
Nested Label Headers Inside Other Label Sections and Functions
Labels that are nested inside other label sections are OK, no special handling is necessary. They do not need an ending
Label sections within functions are also OK, but in that case no need to worry about special positioning of the labels header or
RETURN
of their own if they are nested. There should be only one final RETURN
for them all in column 1.
Label sections within functions are also OK, but in that case no need to worry about special positioning of the labels header or
RETURN
statements.