TheDocumentation 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.
Generator class is responsible for creating the obfuscated Lua virtual machine that executes your protected code. It handles opcode mapping, mutation generation, super operator creation, and VM code generation.
Constructor
context- TheObfuscationContextcontaining bytecode chunks, settings, and mapping information
Core Methods
GenerateVM
settings- Configuration options controlling obfuscation features:Mutate- Enable instruction mutationsMaxMutations- Maximum number of mutations to generateSuperOperators- Enable super operator optimizationMaxMegaSuperOperators- Maximum 60-80 instruction super operatorsMaxMiniSuperOperators- Maximum 10 instruction super operatorsBytecodeCompress- Enable LZW compression of bytecodePreserveLineInfo- Preserve source line information for debugging
- Opcode Discovery - Scans the bytecode and finds all used opcodes through reflection
- Mutation Generation (if enabled) - Creates 35-50 register-shuffled variants per opcode
- Mutation Folding - Maps mutations to actual instructions in the bytecode
- Super Operator Generation (if enabled):
- Mega super operators: 60-80 consecutive instructions combined
- Mini super operators: Up to 10 consecutive instructions combined
- Bytecode Serialization - Converts chunks to binary format
- Compression (if enabled) - LZW compression of bytecode string
- VM Assembly - Combines deserializer, decoder, and opcode dispatcher
IsUsed
chunk- The bytecode chunk to scanvirt- The virtual opcode to check for
true if the opcode is used anywhere in the chunk hierarchy
Side Effects:
- Populates
InstructionMappingin the context - Sets
CustomData.Opcodeon matching instructions
Mutation System
GenerateMutations
opcodes- List of virtual opcodes to mutate
FoldMutations
mutations- Pool of available mutationsused- Set tracking which mutations were actually usedchunk- Chunk to process
- Skips instructions following
Closure(upvalue pseudoinstructions) - Preserves control flow integrity
Super Operator System
GenerateSuperOperators
chunk- Chunk to analyzemaxSize- Maximum instructions per super operatorminSize- Minimum instructions to form a super operator (default: 5)
- Jump targets (instructions following jumps, branches, loops)
- Closure upvalue pseudoinstructions
- Instructions already part of super operators
FoldAdditionalSuperOperators
chunk- Chunk to processoperators- Super operators to match againstfolded- Counter for number of folded instructions
Utility Methods
Compress
uncompressed- Raw byte array to compress
CompressedToString
compressed- LZW compressed data
ToBase36
value- Number to convert
VM Output Structure
The generated VM contains:- Decoder Functions - String and number decoding utilities
- Decompressor (if compression enabled) - LZW decompression routine
- Bytecode String - Serialized chunk data (compressed or raw)
- Deserializer - Reconstructs chunks from bytecode
- Opcode Dispatcher - Binary search tree routing instructions to handlers
- Wrapper - Execution environment setup and invocation
Performance Characteristics
- Mutation Count: 35-50 variants per opcode (random)
- Mega Super Operators: 60-80 instruction sequences
- Mini Super Operators: 5-10 instruction sequences
- Opcode Dispatch: Binary search O(log n) instead of linear lookup
Related
- Opcodes - Virtual opcode system
- ObfuscationContext - Context object
- Serializer - Bytecode serialization