Skip to content
  • Macros
  • Attributes
    • SOTR_ATTRIBUTES
    • Function-scoped
    • Region-scoped
    • Attribute vocabulary
  • Obfuscate API
  • Generating Keys with API
  • Editing Keys with API
  • Using the Oracle SDK
  • Setup
  • Commands

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.

The short version
local function login()
    SOTR_ATTRIBUTES(PRESET(SECURE), ENCRYPT)
    ...
end

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.

Luau
local function login()
    SOTR_ATTRIBUTES(VM(NONE), PRESET(SECURE), ENCRYPT, INLINE)
    ...
end

Region-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.

Luau
SOTR_ATTRIBUTES(PRESET(SECURE), ENCRYPT)   -- opens: applies below
... code whose literals get encrypted and body flattened ...
SOTR_ATTRIBUTES(PRESET(DEFAULT))           -- resets to baseline
Region form only maps the range-relevant attributes, ENCRYPT (wraps the span's string/number literals) and PRESET (control-flow-flattens the span). Function-only attributes written in a region marker are ignored with a warning.

Attribute 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.

INLINE

INLINE(false) makes it optional

Inline the function into its call sites. false marks it optional, meaning it may still escape inlining.

UNROLL

UNROLL(false) makes it optional

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

OPTIMIZE(0..2)

Sets the optimization level applied to the function.

ERROR_HANDLING

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

VM(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).

PRESET

PRESET(FAST | DEFAULT | SECURE | SECURE_MAX)

Applies a bundled intensity tier to the function: FAST, DEFAULT/BALANCED, SECURE, or SECURE_MAX.

TRANSFORM

TRANSFORM(pass, ...)

Opts into additional AST passes for non-virtualized code, such as CONTROL_FLOW or REWRITE_NAMECALLS.

PreviousMacros
NextObfuscate API
SoteriaSoteria

Navigation

  • Pricing
  • Documentation
  • FAQ
  • Blog
  • Discord

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Acceptable Use
SoteriaSoteria
Pricing
Log inLog inGet startedGet started