Skip to content

About

Experimental source-level code obfuscator prototype in Go with AST transformations and control-flow flattening.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

Gobfuscator: AST-Driven Source Code Obfuscation Suite

Go 1.22+ Security Compiler License: MIT

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.


Table of Contents

  1. Obfuscation Pipeline
  2. Transformation Passes
  3. Prerequisites
  4. Build & Usage
  5. Directory Structure
  6. License

Obfuscation Pipeline

  1. Parsing: Target source code is parsed into an Abstract Syntax Tree using standard AST parser routines.
  2. Analysis: Symbol definitions, variable scopes, and control branches are mapped into an immutable symbol table.
  3. Mutation Passes: Configured transformation passes rewrite AST nodes sequentially.
  4. Code Generation: The transformed AST is emitted as valid, fully executable source code.

Transformation Passes

  • 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.

Prerequisites

  • Go 1.22 or higher

Build & Usage

git clone git@github.com:botmaksim/gobfuscator.git
cd gobfuscator

go build -o gobfuscator main.go
./gobfuscator -help

Directory Structure

gobfuscator/
├── 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

License

This project is open-source software licensed under the MIT License.

About

Experimental source-level code obfuscator prototype in Go with AST transformations and control-flow flattening.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages