Macro Compatibility
Voltils accepts common LPH macros so existing scripts can pass through the obfuscator without needing a rewrite.
Function wrapper macros are source-compatible identity wrappers in Voltils. The normal preset already applies the main protection pipeline globally.
Supported Macros
| Macro | Aliases | Behavior |
|---|---|---|
LPH_ENCFUNC |
VOLTILS_ENCFUNC |
Compatibility identity wrapper. The wrapped function remains valid Lua and is still processed by the selected preset. |
LPH_ENCSTR |
LPH_ENCNUM, LPH_JIT, LPH_JIT_MAX, LPH_NO_UPVALUES |
No-op compatibility wrappers. The first returned value is preserved. |
LPH_NO_VIRTUALIZE |
VOLTILS_NO_VIRTUALIZE |
Accepted as an identity wrapper for source compatibility. |
LPH_CRASH |
LPH_CRASHED, VOLTILS_CRASH, VOLTILS_CRASHED |
Raises a runtime crash/error marker. |
LPH_LINE |
VOLTILS_LINE |
Replaced with the current source line number during obfuscation. |
LPH_OBFUSCATED |
VOLTILS_OBFUSCATED |
Replaced with true in obfuscated output. |
Example
print("line", LPH_LINE)
local protected = LPH_ENCFUNC(function(value)
if not LPH_OBFUSCATED then
return "plain"
end
if value == "stop" then
VOLTILS_CRASHED()
end
return LPH_ENCSTR("ready")
end)
print(protected("go"))
Notes
Macros are processed before minification and the main obfuscation pipeline. Macro names inside strings and comments are left untouched.
For best compatibility, call wrapper macros with parentheses, such as LPH_ENCSTR("secret") or LPH_ENCFUNC(function() end).