Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 52 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,45 +168,58 @@ cat obfuscated/report.json

## Architecture Overview

### System Design

```
┌─────────────────────────────────────────────────────────┐
│ LLVM Obfuscator │
├─────────────────────────────────────────────────────────┤
│ │
│ Input: source.c → [4 Layers] → Output: binary │
│ │
│ Layer 1: Symbol Obfuscation (Pre-compilation) │
│ ├─ Cryptographic hashing (SHA256/BLAKE2B) │
│ ├─ Function/variable renaming │
│ └─ Mapping file generation │
│ │
│ Layer 4: Compiler Flags (Compilation) │
│ ├─ Link-time optimization (-flto) │
│ ├─ Symbol hiding (-fvisibility=hidden) │
│ ├─ Frame pointer removal (-fomit-frame-pointer) │
│ └─ Speculative hardening (-mspeculative-load-hardening)│
│ │
│ Layer 3: OLLVM Passes (IR-level) [Optional] │
│ ├─ Control flow flattening │
│ ├─ Instruction substitution │
│ ├─ Bogus control flow │
│ └─ Basic block splitting │
│ │
│ Layer 2: String Encryption (Pre-compilation) │
│ ├─ XOR encryption │
│ ├─ Runtime decryption │
│ └─ Constructor-based initialization │
│ │
│ Layer 5: UPX Binary Packing (Post-compilation) [New!] │
│ ├─ 50-70% binary size reduction │
│ ├─ Additional obfuscation layer │
│ ├─ LZMA compression │
│ └─ Transparent runtime decompression │
│ │
└─────────────────────────────────────────────────────────┘
```
┌──────────────────────────────────────────────────────────────┐
│ LLVM Obfuscator │
├──────────────────────────────────────────────────────────────┤
│ │
│ Input: source.c → [Pipeline] → Output: packed binary │
│ │
│ ───────────────────────────────────────────────────────── │
│ Stage 1: Pre-compilation Obfuscation │
│ ───────────────────────────────────────────────────────── │
│ Layer 1: Symbol Obfuscation │
│ ├─ Cryptographic hashing (SHA256 / BLAKE2b) │
│ ├─ Function & variable renaming │
│ ├─ String table anonymization │
│ └─ Optional mapping file (debug / recovery) │
│ │
│ Layer 2: String Encryption │
│ ├─ XOR / AES-based string encryption │
│ ├─ Compile-time encryption │
│ ├─ Runtime decryption stubs │
│ └─ Constructor-based initialization │
│ │
│ ───────────────────────────────────────────────────────── │
│ Stage 2: IR-level Obfuscation (LLVM Passes) │
│ ───────────────────────────────────────────────────────── │
│ Layer 3: OLLVM / Custom LLVM Passes │
│ ├─ Control Flow Flattening │
│ ├─ Bogus Control Flow │
│ ├─ Instruction Substitution │
│ ├─ Basic Block Splitting │
│ └─ Opaque predicates │
│ │
│ ───────────────────────────────────────────────────────── │
│ Stage 3: Compilation & Toolchain Hardening │
│ ───────────────────────────────────────────────────────── │
│ Layer 4: Compiler & Linker Hardening │
│ ├─ Link-Time Optimization (-flto) │
│ ├─ Symbol visibility hiding (-fvisibility=hidden) │
│ ├─ Frame pointer omission (-fomit-frame-pointer) │
│ ├─ Stack protections (-fstack-protector-strong) │
│ └─ Speculative execution hardening │
│ (-mspeculative-load-hardening) │
│ │
│ ───────────────────────────────────────────────────────── │
│ Stage 4: Post-compilation Binary Protection │
│ ───────────────────────────────────────────────────────── │
│ Layer 5: Binary Packing & Compression │
│ ├─ UPX packing (LZMA / NRV) │
│ ├─ 50–70% size reduction │
│ ├─ Additional static-analysis resistance │
│ └─ Transparent runtime decompression │
│ │
└──────────────────────────────────────────────────────────────┘
Comment on lines +171 to +222

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated architecture diagram is no longer wrapped in a fenced code block, whereas the previous version was. Without a code block, the ASCII diagram will render in a proportional font and may misalign across different Markdown viewers. Please wrap this diagram in a fenced code block again to preserve its monospace layout and readability.

Copilot uses AI. Check for mistakes.

### Data Flow

Expand Down