Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pw4k/ironbrew-2/llms.txt

Use this file to discover all available pages before exploring further.

This guide will help you obfuscate your first Lua script with IronBrew 2.

Prerequisites

Before you begin, ensure you have:
  • IronBrew 2 CLI installed (installation guide)
  • A Lua 5.1 script to obfuscate
  • luac and luajit available in your PATH

Obfuscate your first script

1

Create a test Lua script

Create a simple Lua script to test the obfuscator:
test.lua
-- Simple test script
local function greet(name)
    return "Hello, " .. name .. "!"
end

local message = greet("World")
print(message)

-- Some basic math
local sum = 0
for i = 1, 10 do
    sum = sum + i
end
print("Sum:", sum)
2

Run the obfuscator

Execute IronBrew 2 CLI with your script as input:
./IronBrew2CLI test.lua
You should see output similar to:
Checking file...
Stripping comments...
Compiling...
Obfuscating...
Serializing...
Minifying...
Watermark...
Done!
3

Check the output

IronBrew 2 creates an out.lua file containing your obfuscated code:
ls -lh out.lua
The output file will be significantly larger than the input due to the VM wrapper and obfuscation layers.
4

Test the obfuscated script

Run the obfuscated script to verify it works correctly:
lua out.lua
Expected output:
Hello, World!
Sum:    55
The obfuscated code produces identical results to the original script.

What happened?

IronBrew 2 transformed your Lua script through several stages:
1

Comment stripping

Removes comments using LuaSrcDiet while preserving code structure
2

String encryption

Encrypts string constants (if enabled in settings)
3

Bytecode compilation

Compiles the Lua source to Lua 5.1 bytecode using luac
4

Bytecode deserialization

Parses the bytecode into an internal representation (Chunk, Instruction objects)
5

Control flow obfuscation

Applies control flow transformations to make the code harder to analyze
6

VM generation

Wraps the bytecode in a custom virtual machine with randomized instruction encoding
7

Minification

Compresses the output using LuaSrcDiet with maximum optimization

Default configuration

The CLI uses these default settings from ObfuscationSettings:
ObfuscationSettings (default)
EncryptStrings = false
EncryptImportantStrings = false
ControlFlow = true
BytecodeCompress = true
DecryptTableLen = 500
PreserveLineInfo = false
Mutate = true
SuperOperators = true
MaxMegaSuperOperators = 120
MaxMiniSuperOperators = 120
MaxMutations = 200
The default configuration provides strong obfuscation with good performance. Control flow obfuscation, mutations, and super operators are all enabled by default.

Next steps

CLI Reference

Learn about all CLI options and how to customize obfuscation

Configuration

Understand ObfuscationSettings and fine-tune the obfuscation process

Core Concepts

Dive deep into how VM-based obfuscation works

API Reference

Use IronBrew 2 programmatically in your C# projects

Common issues

Make sure luac is installed and available in your PATH:
which luac
luac -v
Install Lua 5.1 if needed. See the installation guide for platform-specific instructions.
IronBrew 2 uses LuaJIT for preprocessing. Install it:
Ubuntu/Debian
sudo apt-get install luajit
macOS
brew install luajit
The VM wrapper adds significant overhead. This is normal for VM-based obfuscation. To reduce size:
  • Disable string encryption
  • Reduce MaxMegaSuperOperators and MaxMiniSuperOperators
  • Set BytecodeCompress = true (default)
VM-based obfuscation adds runtime overhead. For better performance:
  • Reduce MaxMutations
  • Disable ControlFlow for performance-critical sections
  • Use selective obfuscation on sensitive code only