IB_OBFUSCATED

A boolean constant that resolves to true after Ironbrew1 processes the script. Use it to separate development and protected-build behavior.

if IB_OBFUSCATED then
    print("Running under virtualization")
else
    print("Running outside virtualization")
end

IB_LINE

A numeric constant that resolves to the source line where it appears. It can retain useful diagnostics without hard-coding line numbers.

local function assertion(cond, msg)
    if not cond then
        error(msg .. " at line " .. IB_LINE)
    end
end

IB_NO_VIRTUALIZE

Leaves a function outside the generated VM. Reserve it for measured hot paths where virtualization overhead is unacceptable.

local hugeMathTask
IB_NO_VIRTUALIZE(function()
    hugeMathTask = function(iterations)
        local count = 0
        for i = 1, iterations do
            count = count + math.sqrt(i)
        end
        return count
    end
end)()

IB_INLINE

Requests that a small function be inlined at each call site. This removes call overhead without excluding the surrounding code from virtualization.

local mix = IB_INLINE(function(a, b, ...)
    local value = (a * 33) + b
    return value, ...
end)

local result, extra = mix(counter, salt, payload)

IB_ENCSTR

Marks a string for protected storage so it is not emitted as an ordinary plaintext constant.

local secretString = IB_ENCSTR("super secret string")

IB_PRECHECK

Makes loading depend on the result of your own check. The second argument sets the expected integer at build time; a different result prevents the main script from loading correctly.

IB_PRECHECK(function()
    local reply = game:HttpGet("https://license.example.com/validate")
    return tonumber(reply)
end, 0x6B31D902)

print("License accepted")

Replace the example URL with your endpoint, returning the expected number as text. Keep the macro call at the top level. Its function takes no parameters and cannot capture outside locals. For several keys, return an array and supply the matching array of integer literals. Separate calls can add further checks.

This example reads two keys from a JSON array. Your endpoint must return the expected numbers in the same order.

IB_PRECHECK(function()
    local reply = game:HttpGet("https://license.example.com/validate-keys")
    local keys = game:GetService("HttpService"):JSONDecode(reply)
    return { keys[1], keys[2] }
end, { 0x6B31D902, 0x2C84A710 })

print("License accepted")

IB_CRASH

Stops the generated VM immediately. Use it when a failed authorization or integrity check must prevent all further execution.

if not whitelisted then
    IB_CRASH()
end