Skip to main content
Soteria exposes a set of compile-time macros that let you query and control the runtime environment directly from your Lua scripts.

SOTR_OBFUSCATED

Type: boolean Returns true if the current script is running under Soteria obfuscation, and false otherwise. Useful for toggling debug behavior or hiding sensitive logic paths in plain builds.
SOTR_OBFUSCATED
boolean
true when obfuscation is active, false when running unprotected.

if SOTR_OBFUSCATED then
    print("Running under Soteria — debug output suppressed.")
else
    _G.__DEBUG = true
end

SOTR_LINE

Type: number Expands to the current source line number at the point of use. Helpful for logging, error reporting, and runtime diagnostics without relying on debug.traceback.
SOTR_LINE
number
The line number in the source file where the macro is referenced.
local function assert_eq(a, b)
    if a ~= b then
        error("Assertion failed at line " .. SOTR_LINE .. ": expected " .. tostring(b) .. ", got " .. tostring(a))
    end
end

assert_eq(1 + 1, 2)

SOTR_KILL

Type: () → never Immediately crashes the Lua VM. Use this as a hard tripwire — placing it behind anti-tamper checks, license validation, or integrity guards ensures the process cannot continue if the condition is violated.
This is irreversible. Once called, the VM is terminated and no further code executes. Do not use in hot paths or without a deliberate condition guard.
SOTR_KILL
function
Calling this function crashes the VM immediately with no recovery.
local LICENSE_VALID = validate_license()

if not LICENSE_VALID then
    -- Hard stop — no graceful exit, no error message
    SOTR_KILL()
end

-- Only reachable if license check passed
run_application()