Gobfuscator is a multi-pass source code obfuscation utility implemented in Go. By parsing Abstract Syntax Trees, the tool applies AST-level code transformations including symbol mangling, string literal encryption, dead code injection, and control flow flattening to deter reverse engineering and automated static analysis.
- Parsing: Target source code is parsed into an Abstract Syntax Tree using standard AST parser routines.
- Analysis: Symbol definitions, variable scopes, and control branches are mapped into an immutable symbol table.
- Mutation Passes: Configured transformation passes rewrite AST nodes sequentially.
- Code Generation: The transformed AST is emitted as valid, fully executable source code.
- Identifier Scrambling: Replaces variable, function, and parameter names with uninformative cryptographic hashes.
- String Encryption: Encodes string constants into byte arrays decoded at runtime.
- Dead Code Injection: Generates mathematically dead conditional branches to increase reverse engineering complexity.
- Control Flow Flattening: Replaces linear execution paths with state-variable switch dispatch loops.
- Go 1.22 or higher
git clone git@github.com:botmaksim/gobfuscator.git
cd gobfuscator
go build -o gobfuscator main.go
./gobfuscator -helpgobfuscator/
├── main.go # Command-line entry point and flags
├── go.mod # Go module definition
├── core/ # AST parsing and visitor abstractions
├── pkg/ # Concrete transformation passes
└── options/ # Obfuscation configuration options
This project is open-source software licensed under the MIT License.