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.
SOTR_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.
| Attribute | Meaning |
|---|---|
| INLINE / INLINE(false) | Inline the function into its call sites. false marks it optional, meaning it may still escape inlining. |
| UNROLL / UNROLL(false) | Unroll computable numeric for loops inside the function. |
| NO_UPVALUES | Wrap the function so it has zero upvalues, same guarantee as SOTR_NO_UPVALUES. |
| ENCRYPT / ENCRYPT(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. |
| OPTIMIZE(0..2) | Sets the optimization level applied to the function. |
| ERROR_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. |
| VM(mode) | 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). |
| PRESET(tier) | Applies a bundled intensity tier to the function: FAST, DEFAULT/BALANCED, SECURE, or SECURE_MAX. |
| TRANSFORM(pass, …) | Opts into additional AST passes for non-virtualized code, such as CONTROL_FLOW or REWRITE_NAMECALLS. |

