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.

Overview

IronBrew 2 uses the ObfuscationSettings class to control obfuscation behavior. While the CLI currently uses default settings, understanding these options is essential for customizing obfuscation when using IronBrew 2 as a library.
The current CLI implementation uses default settings. To customize these options, you’ll need to modify the source code or use IronBrew 2 as a library in your own application.

Default Settings

When you run the CLI, it uses these default values:
var settings = new ObfuscationSettings();
// Uses defaults from constructor

Available Options

String Encryption

EncryptStrings
boolean
default:"false"
Encrypts all string constants in the scriptWhen enabled, string literals are encrypted at compile time and decrypted at runtime, making the obfuscated code harder to analyze.
EncryptImportantStrings
boolean
default:"false"
Selectively encrypts important string constantsA lighter alternative to full string encryption, targeting only sensitive strings.
DecryptTableLen
integer
default:"500"
Size of the decryption lookup tableUsed when string encryption is enabled. Larger values may improve performance but increase output size.

Control Flow Obfuscation

ControlFlow
boolean
default:"true"
Applies control flow obfuscation transformationsRestructures the program’s control flow to make it harder to follow execution paths. This significantly increases complexity for reverse engineering.

Bytecode Options

BytecodeCompress
boolean
default:"true"
Compresses the generated bytecodeReduces the size of embedded bytecode, making the output smaller and harder to analyze.
PreserveLineInfo
boolean
default:"false"
Preserves line number information in the outputWhen enabled, keeps debug line information. Useful for debugging but reduces obfuscation effectiveness.
Enabling this makes the obfuscated code easier to reverse engineer. Only use for debugging purposes.

Advanced Obfuscation

Mutate
boolean
default:"true"
Applies mutation transformations to the bytecodeRandomly transforms bytecode instructions into equivalent but different forms.
MaxMutations
integer
default:"200"
Maximum number of mutation transformations to applyHigher values increase obfuscation strength but also increase processing time and output size.
SuperOperators
boolean
default:"true"
Enables super operator transformationsCombines multiple simple operations into complex composite operations, making the VM harder to understand.
MaxMiniSuperOperators
integer
default:"120"
Maximum number of mini super operators to generateMini super operators are smaller composite operations. More operators increase variety and obfuscation strength.
MaxMegaSuperOperators
integer
default:"120"
Maximum number of mega super operators to generateMega super operators are larger, more complex composite operations that provide stronger obfuscation.

Configuration Profiles

Here are recommended setting combinations for different use cases:

Maximum Obfuscation

var settings = new ObfuscationSettings
{
    EncryptStrings = true,
    EncryptImportantStrings = true,
    ControlFlow = true,
    BytecodeCompress = true,
    DecryptTableLen = 1000,
    PreserveLineInfo = false,
    Mutate = true,
    SuperOperators = true,
    MaxMiniSuperOperators = 200,
    MaxMegaSuperOperators = 200,
    MaxMutations = 500
};
Maximum obfuscation provides the strongest protection but increases file size and processing time.

Balanced (Default)

var settings = new ObfuscationSettings();
// Uses constructor defaults
Provides good obfuscation with reasonable performance and file size.

Performance Optimized

var settings = new ObfuscationSettings
{
    EncryptStrings = false,
    EncryptImportantStrings = false,
    ControlFlow = true,
    BytecodeCompress = true,
    DecryptTableLen = 250,
    PreserveLineInfo = false,
    Mutate = false,
    SuperOperators = true,
    MaxMiniSuperOperators = 50,
    MaxMegaSuperOperators = 50,
    MaxMutations = 50
};
Faster obfuscation with smaller output, suitable when performance is critical.

Debug Mode

var settings = new ObfuscationSettings
{
    EncryptStrings = false,
    EncryptImportantStrings = false,
    ControlFlow = false,
    BytecodeCompress = false,
    PreserveLineInfo = true,
    Mutate = false,
    SuperOperators = false
};
Debug mode significantly reduces obfuscation effectiveness. Only use during development.

Using Custom Settings

To use custom settings, you’ll need to use IronBrew 2 as a library:
using IronBrew2;
using IronBrew2.Obfuscator;

var settings = new ObfuscationSettings
{
    EncryptStrings = true,
    ControlFlow = true,
    Mutate = true
};

if (IB2.Obfuscate("temp", "input.lua", settings, out string error))
{
    Console.WriteLine("Success!");
}
else
{
    Console.WriteLine($"Error: {error}");
}
See the API Reference for more details on using IronBrew 2 as a library.