Back to Home

Macro Compatibility

Voltils macros are the default names. Common LPH macros are accepted as aliases so existing scripts can pass through without 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
VOLTILS_ENCFUNC LPH_ENCFUNC Compatibility identity wrapper. The wrapped function remains valid Lua and is still processed by the selected preset.
VOLTILS_ENCSTR LPH_ENCSTR, LPH_ENCNUM, LPH_JIT, LPH_JIT_MAX, LPH_NO_UPVALUES No-op compatibility wrappers. The first returned value is preserved.
VOLTILS_NO_VIRTUALIZE LPH_NO_VIRTUALIZE Accepted as an identity wrapper for source compatibility.
VOLTILS_CRASH VOLTILS_CRASHED, LPH_CRASH, LPH_CRASHED Raises a runtime crash/error marker.
VOLTILS_LINE LPH_LINE Replaced with the current source line number during obfuscation.
VOLTILS_OBFUSCATED LPH_OBFUSCATED Replaced with true in obfuscated output.

Example

print("line", VOLTILS_LINE)

local protected = VOLTILS_ENCFUNC(function(value)
    if not VOLTILS_OBFUSCATED then
        return "plain"
    end

    if value == "stop" then
        VOLTILS_CRASHED()
    end

    return VOLTILS_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 VOLTILS_ENCSTR("secret") or VOLTILS_ENCFUNC(function() end).