Architecture Overview

Atlus is structured as a multi-layer C++20 application with clean separation between analysis logic and presentation. The core is a static analysis library (atlus_core) that operates on PE files, while a fully dockable Dear ImGui GUI provides the interface.

Four-Level Diff Engine

The heart of Atlus is its hierarchical diff engine that compares binaries at increasing levels of abstraction:

Level 1: Byte-Level Diff

Raw byte comparison with optimized sliding window. Identifies changed, inserted, and deleted byte ranges. Fast for small files, provides ground truth for higher-level analysis.

Level 2: Section-Level Diff

Compares PE sections (.text, .data, .rsrc, etc.) independently. Handles section resizing, reordering, and attribute changes. Provides structural context missing from raw bytes.

Level 3: Function-Level Diff

Identifies functions via symbol tables or heuristic analysis, then compares them individually. Handles function inlining, outlining, and compiler optimization changes.

Level 4: AOB Signature Generation

Generates Array of Bytes signatures that can survive small updates. Supports both IDA-style patterns (with ? wildcards) and Cheat Engine format. These signatures can be used to find the same code in updated versions of a binary.

AOB generation works by finding stable bytes (typically instruction opcodes) while masking variable bytes (addresses, offsets, immediates). The result is a pattern that matches even when the binary is recompiled or shifted.

PE Analysis Pipeline

1. Parse PE headers (DOS, COFF, optional header)
2. Build section map with virtual/physical addresses
3. Extract exports and imports (IAT/EAT analysis)
4. Identify function boundaries
   - Via symbols if available
   - Via prologue/epilogue heuristics
   - Via control flow analysis
5. Build control flow graphs
6. Run user-selected analysis:
   - Diff against another binary
   - Generate patterns
   - Disassemble specific regions

Disassembly with Zydis

Atlus uses the Zydis disassembler for fast, accurate x86/x64 decoding:

Ghidra Decompiler Integration

For higher-level analysis, Atlus can send functions to Ghidra's decompiler and display the resulting C pseudocode:

Dear ImGui Docking Interface

The GUI is built with Dear ImGui's docking branch for a flexible workspace:

Key Libraries

LibraryPurpose
LIEFPE32/PE32+ parsing and manipulation
Zydisx86/x64 disassembly
Dear ImGuiImmediate-mode GUI with docking
GhidraDecompiler integration (external)

Performance Considerations

Binary analysis can be slow on large files. Atlus addresses this through:

What I Learned

Building Atlus taught me about the PE format in depth, including edge cases like packed executables, .NET hybrids, and the many ways compilers can structure the same code. The diff algorithm design was particularly interesting: balancing speed with accuracy across multiple abstraction levels.

Use Cases