Getting Started
Attributes
SOTR_ATTRIBUTES attaches obfuscation attributes that control how Soteria compiles a function or a region of code. Multiple attributes can be combined in a single call.
local function login()
SOTR_ATTRIBUTES(PRESET(SECURE), ENCRYPT)
...
endSOTR_ATTRIBUTES
Type: (...attribute) → nil
Has two forms depending on where it appears. The call itself is stripped from the compiled output either way, only the attributes it carries route into the pipeline.
Aliases: LPH_ATTRIBUTES
Function-scoped
As the first statement of a named function's body, it applies to that whole function.
local function login()
SOTR_ATTRIBUTES(VM(NONE), PRESET(SECURE), ENCRYPT, INLINE)
...
endRegion-scoped
A call that is not the first statement of a named function instead opens a region that applies to everything after it, until the next marker or the end of the chunk.
SOTR_ATTRIBUTES(PRESET(SECURE), ENCRYPT) -- opens: applies below
... code whose literals get encrypted and body flattened ...
SOTR_ATTRIBUTES(PRESET(DEFAULT)) -- resets to baselineAttribute vocabulary
Any number of compatible attributes can stack in one SOTR_ATTRIBUTES call. Unknown or misused attributes are warned about and ignored, never silently mangled.
INLINEINLINE(false) makes it optional
Inline the function into its call sites. false marks it optional, meaning it may still escape inlining.
UNROLLUNROLL(false) makes it optional
Unroll computable numeric for loops inside the function.
NO_UPVALUESWrap the function so it has zero upvalues, same guarantee as SOTR_NO_UPVALUES.
ENCRYPTENCRYPT(key, expr?)
Encrypt the string and number literals in the body. key and expr are the same static/runtime key layers as SOTR_ENC_STR.
OPTIMIZEOPTIMIZE(0..2)
Sets the optimization level applied to the function.
ERROR_HANDLINGERROR_HANDLING(bool)
Enables or disables the per-function line-tracked error handler (on by default). At file scope, this toggles the whole-chunk custom-error handler.
VMVM(DEFAULT | NONE | FAST | SWIFT)
DEFAULT keeps normal virtualization, NONE keeps it native (same as SOTR_EXPOSE), FAST keeps it native with a plain-dispatch flatten (same as SOTR_JIT), SWIFT keeps it native with a full-opacity flatten (same as SOTR_JIT_MAX).
PRESETPRESET(FAST | DEFAULT | SECURE | SECURE_MAX)
Applies a bundled intensity tier to the function: FAST, DEFAULT/BALANCED, SECURE, or SECURE_MAX.
TRANSFORMTRANSFORM(pass, ...)
Opts into additional AST passes for non-virtualized code, such as CONTROL_FLOW or REWRITE_NAMECALLS.

