Macro Documentation

Learn how to use Ironbrew1 macros.

IB_OBFUSCATED

A boolean macro that compiles to true when the script is processed by Ironbrew1. This is useful for conditionals that should only run in production/obfuscated builds.

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

IB_LINE

A numeric macro that resolves to the line number where it was called. This is useful for debugging to see exactly what line something breaks on.

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

IB_NO_VIRTUALIZE

Marks a block of code to not get virtualized by ironbrew1 and instead run normally. This is typically used for extreme hot paths that require native speed minus the protection overhead.

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

Forces a function to be inlined anywhere it is called. This is useful for small functions that get called constantly and need to run faster without using IB_NO_VIRTUALIZE.

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

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

IB_ENCSTR

Encrypts a string, making it much harder for attackers to constant dump your strings at runtime.

local secretString = IB_ENCSTR("super secret string")

IB_CRASH

Stops the VM preventing further execution. This is useful for authentication

if not whitelisted then
    IB_CRASH()
end