Skip to content
TheMaster1127Public

About

HT-RE is a dependency-light, high-performance, web-based binary analysis suite, native terminal debugger, and low-level development environment built natively for 64-bit Linux (x86_64 and aarch64).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

19 Commits

Folders and files

Repository files navigation

⚑ HT-RE / IDREE – Integrated Development Reverse Engineering Environment

A dependency-light, high-performance, web-based binary analysis suite, native terminal debugger, and low-level development environment built natively for 64-bit Linux (x86_64 and aarch64).


πŸ“‘ Table of Contents

  1. Introduction
  2. The Core Philosophy
  3. Architecture Overview
  4. Key Capabilities & Feature Matrix
  5. Prerequisites & System Setup
  6. Installation & Launch
  7. Comprehensive Workflow Tour
  8. Debugging Complex Targets (PIE, Stripped & sstripped)
  9. Air-Gapped Bubblewrap Security Model
  10. License

1. Introduction

HT-RE (evolving into IDREE β€” Integrated Development Reverse Engineering Environment) is an all-in-one low-level cockpit designed to eliminate the friction of juggling terminals, disassemblers, decompilers, standalone scratchpads, and external compilers.

It runs locally on Linux (targeting ELF64 x86_64 and aarch64) with zero frontend build tools (no Node.js, Webpack, or Babel required). It connects standard GNU binary utilities, modern Rust decompilation (Kuna), NSA Ghidra Headless fallback, a real embedded xterm.js terminal session running bin-debug-friendly inside an air-gapped Bubblewrap (bwrap) sandbox, and a full-featured multi-file code IDE into a unified web workspace.


2. The Core Philosophy

  • Zero-Build Vanilla Client: Pure ECMAScript executing directly in browser engines with sub-millisecond virtual DOM updates.
  • Strict 64-bit Architecture Focus: Built specifically for ELF64 Linux x86_64 and aarch64 (Desktop, Raspberry Pi 5, and Termux). Legacy 32-bit targets are handled via cross-toolchains without polluting core 64-bit logic.
  • No Compromise on Debugging: Instead of clunky HTML register cards and broken flex grids, live debugging runs through a real Linux Pseudo-Terminal (PTY) rendering authentic high-contrast ANSI TUIs via xterm.js. All register inspection, editing, and memory dumping capabilities are preserved and elevated to a terminal surface.
  • Air-Gapped by Default: Live debugging, execution tracing, and untrusted toolchain compilations run sealed inside Linux kernel namespaces (bwrap --unshare-all --cap-drop ALL) with /home invisible and zero internet access.
  • Decompilation Speed: Uses Kuna for sub-second C AST generation (~60–150ms) with automatic fallback to Ghidra Headless when needed.
  • True Workspace Isolation: Open multiple binaries concurrently in top tabs without losing independent scroll states, floating windows, breakpoints, or compiler files.

3. Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                 HT-RE / IDREE FRONTEND                                 β”‚
β”‚  - Multi-Project Tabs    - Floating Multi-Window Desktop (MWM)   - Virtual DOM Scroller β”‚
β”‚  - Real xterm.js TUI     - Code IDE (Snippet Saver 7-Layout Engine) - RE Calculators   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                            β”‚ REST JSON & PTY WebSocket/Poll Stream
                                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                PYTHON / FLASK BACKEND                                  β”‚
β”‚  - Subprocess Orchestrator  - PTY Master/Slave File Descriptor Bridge                  β”‚
β”‚  - GNU Toolchain Prober     - Multi-Tenant State Storage   - SHA-256 Persistent Cache  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚                                              β”‚
                      β–Ό                                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     AIR-GAPPED BUBBLEWRAP SANDBOX         β”‚  β”‚          DECOMPILATION BRIDGES          β”‚
β”‚  - bwrap --unshare-all --cap-drop ALL     β”‚  β”‚  - Kuna (Rust Native Decompiler)        β”‚
β”‚  - bin-debug-friendly (GDB/MI2 Engine)    β”‚  β”‚  - Ghidra Headless (analyzeHeadless)   β”‚
β”‚  - Execution Mapper & Lifecycle Heap Trap β”‚  β”‚  - PIE ImageBase Normalization          β”‚
β”‚  - Sandboxed Native strace & binwalk      β”‚  β”‚  - Combined C/C++ AST Stitching         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

4. Key Capabilities & Feature Matrix

Feature Powered By Description
High-Speed Decompilation Kuna + Ghidra Sub-second Rust C AST decompilation with Ghidra Headless fallback and SHA-256 caching.
Real Terminal TUI Debugger xterm.js + bin-debug-friendly Live stationary arrow (=>), side-by-side registers, active stack, and green character/byte diffs.
Multi-Layout Code IDE Ace.js + Snippet Saver engine Multi-file nested tree, 7 window modes (Tabs, Split, Grid, Floating WM), and custom compilers.
Execution Mapping --map engine Full instruction-by-instruction logging, register dereferences (DEREF), and syscall timelines.
Lifecycle Heap Dumping heap_dump.py Traps sys_read and post-input strcmp/free/exit_group before anti-analysis memory wipes.
Dynamic String Recovery stack_strings.py Extracts secrets materializing byte-by-byte on the stack and in pointer registers across time.
Sandboxed Strace bwrap + strace Air-gapped live system call and socket tracing with interactive multi-line stdin piping and EOF control.
Clean Entropy Plotting binwalk -E In-memory base64 entropy graph visualization with zero stray .png files left on disk.
Binary Patching & Search binpatch Exact/heuristic byte search, virtual address/offset patching, and function resolution (-m, -e, -r).
Virtual DOM Scroller Custom JS engine Smooth, zero-lag scrolling across 100,000+ line disassembly and hex dumps with exact pixel jump history.
RE Math Suite math.js + BigInt Infinite spawnable scientific calculators with prefix-free hex, bswap32/64, rol/ror, and IEEE 754 converters.
Multi-Encoding Converter TextDecoder/Encoder Bidirectional text $\leftrightarrow$ hex conversion across UTF-8/ASCII, UTF-16LE, and ANSI (Windows-1252).

5. Prerequisites & System Setup

HT-RE is designed for Linux operating systems targeting 64-bit ELF binaries (x86_64 and aarch64).

1. Python 3.10+ & Flask

pip install flask

2. GNU Binutils, Toolchains, QEMU & Bubblewrap

# Arch Linux / Artix Linux
sudo pacman -S --needed binutils gcc g++ clang nasm fasm gdb qemu-user bubblewrap strace binwalk tree

# Debian / Ubuntu / Kali Linux
sudo apt update && sudo apt install -y build-essential binutils gcc g++ clang nasm fasm gdb qemu-user bubblewrap strace binwalk tree

# Fedora / RHEL
sudo dnf install -y gcc gcc-c++ binutils clang nasm gdb qemu-user bubblewrap strace binwalk tree

3. Decompiler Toolchains (Kuna & Ghidra)

  • Kuna (Primary - Highly Recommended): Install kuna to /usr/local/bin/ or ~/.cargo/bin/.
  • Ghidra (Fallback): Install Ghidra and ensure analyzeHeadless is in /opt/ghidra/, ~/.local/share/ghidra/, or exported via GHIDRA_HOME.

4. binpatch Utility

git clone https://github.com/TheMaster1127/binpatch.git
cd binpatch && sudo cp binpatch /usr/local/bin/ && sudo chmod +x /usr/local/bin/binpatch

5. bin-debug-friendly Engine

Install globally via its installer:

git clone https://github.com/TheMaster1127/bin-debug-friendly.git
cd bin-debug-friendly && sudo ./install.sh

(Alternatively, symlink or copy bin-debug-friendly into backend/bdf/).


6. Installation & Launch

  1. Clone the repository:

    git clone https://github.com/TheMaster1127/HT-RE.git
    cd HT-RE
  2. Launch the backend server:

    python3 server.py
  3. Open the interface: Navigate to:

    http://localhost:8000
    

7. Comprehensive Workflow Tour

7.1 Binary Inspection & Multi-Project Workspaces

  • Loading: Enter an absolute path (e.g. /bin/ls) or click πŸ“ Browse to upload an executable into .htre_uploads/.
  • Multi-Binary Tabs: Open multiple binaries simultaneously. Each binary maintains an isolated workspace state containing exact scroll coordinates, open floating modals, active breakpoints, and IDE files.

7.2 Disassembly & RIP-Relative String Inlining

  • Select the Disassembly tab to view formatted Intel or AT&T syntax with raw machine opcodes.
  • Automatic String Inlining: RIP-relative instruction targets (# 0x2011 <_IO_stdin_used+0x4>) are automatically resolved against data sections and displayed as inline comments (; "Hello World").
  • Navigation: Click on any highlighted hex address or symbol tag (<main>) to jump directly to target instructions. Use β—€ to step back with pixel-perfect restoration.

7.3 Kuna & Ghidra Dual-Engine Decompilation

  • Single Function: Double-click any function in the left sidebar to decompile it. HT-RE queries Kuna first for instant C AST generation (~60ms) and seamlessly falls back to Ghidra Headless if needed.
  • Batch Decompilation: Click ⚑ Decompile All to decompile every function in the binary. Results are indexed permanently on disk by SHA-256 hash (.htre_cache/<hash>.json).
  • Show All in One (C/C++): Stitches all decompiled functions into a unified, top-down C source view, filtering compiler boilerplate stubs and pinning main to the bottom.

7.4 Embedded Real Native TUI Terminal Debugger (bin-debug-friendly)

  • Switch to the Run / Trace / Hook / Debug tab and click β–Ά Launch Debugger (or 🎯 Launch (main)).
  • Executes real bin-debug-friendly inside a Linux PTY rendered via xterm.js:
    • Stationary view max Dashboard: Real-time Intel disassembly with a stationary execution arrow (=>), side-by-side general-purpose registers, active zero-trimmed stack, and bright-green character/byte diffs.
    • Single Stepping: Use buttons (Step In, Step Over, Skip Fn, Continue) or type s, n, k, c, or press Enter.
    • Direct Hex Leap: Type any address (0x1313) to run straight to it without calculating PIE load offsets.
    • Call Navigation & Ignore: Autocomplete upcoming calls with call <fn> and step over noisy loops using ignore call or ignore once.
    • Register & Memory Modification: Mutate CPU state live using set <reg> <val> or inspect single registers in all formats via get <reg>.

7.5 Autonomous Execution Mapper (--map)

  • In the πŸ—Ί Execution Mapper (--map) sub-tab, trace instructions, register changes, DEREF: pointer strings, and system calls automatically.
  • Interactive Stdin Bridge: Supports multi-line pre-queued input (using \n) and features a live prompt overlay that pauses and prompts you in the browser whenever the binary requests input mid-trace.

7.6 Lifecycle Heap Dumper (heap_dump.py)

  • In the 🧲 Lifecycle Heap Dumper sub-tab, capture complete memory snapshots of [heap] across execution.
  • Traps sys_read before stdin input and catches anti-analysis wipes by intercepting strcmp, strncmp, memcmp, explicit_bzero, free, and exit_group.

7.7 Dynamic Stack & Register String Extractor (stack_strings.py)

  • In the 🧡 Stack & Reg Strings + Recordings sub-tab, select any past recording or mapped run.
  • Automatically concatenates raw stack memory across every execution step, resolves pointer register targets (DEREF), collapses partial character-by-character build-ups (crac $\rightarrow$ crackme123), and renders a deduplicated chronological timeline.

7.8 Sandboxed Live Strace & Network Interception

  • In the 🌐 Strace & πŸ“¦ Binwalk sub-tab, click ⚑ Start Sandboxed Trace to stream system calls and socket communications live inside Bubblewrap.
  • Supports interactive multi-line stdin, live typing into running processes, Send EOF, and execution termination (⏹ Stop Trace).

7.9 Clean Firmware & In-Memory Entropy Scanner (binwalk)

  • Run signature detection, recursive payload carving (-e), and Shannon entropy analysis (-E).
  • Zero Disk Clutter: Entropy analysis renders an in-memory base64 preview directly in the browser and automatically cleans up temporary files, leaving zero stray .png files in your workspace.

7.10 The Code IDE (Snippet Saver Engine + Toolchain Compilers)

  • Switch to the Code IDE tab to manage files, write code, and compile binaries.
  • Nested File Explorer: Create files and subfolders, drag and drop items to organize, and select folders to target new file creation.
  • 7 Layout Modes: Seamlessly switch between Single Tabs, Vertical Split, Horizontal Split, Tiling Grid, Horizontal Row Scroll, Vertical Column Scroll, and a floating Window Manager (with Snap to Grid).
  • Toolchains & Custom Compilers: Pre-configured for GCC, G++, Clang, NASM, FASM, GAS, ARM32 GCC/GAS, and AArch64 GCC/GAS, with support for custom toolchain templates (e.g. cib using {compiler} {options} {input}).
  • Quick Compilation: Press Ctrl+Enter to compile the active file immediately into .htre_uploads/<filename>_compiled_<timestamp> with one-click workspace loading.
  • Draggable Resizers: Adjust the width of the project file tree, the height of the compiled binaries panel, and the height of the compiler output terminal.

7.11 Binary Patching, Search & Resolve (binpatch)

  • Write / Patch: Overwrite bytes at physical offsets (-o) or virtual addresses (-va) with automatic .bak backup creation. Caches for disassembly and hex dumps are invalidated immediately upon patching.
  • Search / Find: Run exact hex scans (-f) or wildcard heuristic substring searches (-fh).
  • Resolve Mode: Disassemble logic blocks at offsets or auto-resolved entry points (-m main, -e entry) with architecture-aware "Stream Until Return" (-r).
  • Backup Manager: Inspect, restore, or delete past backups with one click.

7.12 Bi-Directional Dis/Assembler

  • Translate assembly mnemonics to machine opcodes and vice-versa for x86-64, ARM, and AArch64.

7.13 RE Scientific Calculators & Multi-Encoding Strings

  • Infinite Calculators: Spawn multiple side-by-side calculators supporting prefix-free hex entry (4A00 + FF), bit-width clamping (8, 16, 32, 64-bit, Unlimited), and custom RE operations (bswap32, bswap64, rol, ror).
  • Bidirectional Converters: Convert values simultaneously across Hex, Binary, Octal, Signed/Unsigned Int8–Int64, Float16 (IEEE 754 Half), Float32, and Float64.
  • Multi-Encoding String Tool: Bidirectional text $\leftrightarrow$ hex converter supporting UTF-8/ASCII, UTF-16LE (Windows Wide Strings), and ANSI (Windows-1252).
  • Relative Jump Calculator: Calculate relative displacement offsets and branch targets in hex and decimal.

7.14 Auto-Reflowing Dynamic Multi-Column ASCII Reference

  • View a 256-character ASCII reference table that automatically refits into 2 to 8 vertical columns based on your screen width (or manual column selection).

7.15 Floating Multi-Window Desktop (MWM)

  • Open multiple functions simultaneously in draggable, resizable floating windows.
  • Reorder tabs with drag-and-drop, pop tabs into new windows, toggle between Assembly and Decompiled C/C++, and use right-click context menus to convert numbers inline (Hex $\leftrightarrow$ Dec $\leftrightarrow$ ASCII).

7.16 Granular JSON Workspace Exporter

  • Click Export JSON to selectively package headers, section tables, found strings, raw strings, bounded hex dumps, custom binpatch runs, disassembly blocks, and decompiled C/C++ source into an offline JSON archive.

7.17 Workflow Activity Tracking & AI Prompt Export

  • Click πŸ•΅ Export Tracking to generate a structured JSON timeline of your entire analysis session (tabs opened, searches executed, breakpoints hit, registers edited).
  • Provide this file to an LLM to ask: "Based on my analysis sequence and register edits, what vulnerabilities or logic branches did I miss?"
  • To disable tracking, open static/js/state.js and set const invasive = false; on line 41.

8. Debugging Complex Targets (PIE, Stripped & sstripped)

Position Independent Executables (PIE)

PIE binaries are relocated randomly in memory at runtime. In HT-RE:

  • Paste objdump offsets directly (0x1149) into breakpoint bars or the TUI prompt (0x1149); the runtime base is discovered via /proc/<pid>/maps / auxv and translated transparently.
  • Set relative function breakpoints such as *main+0x7c.

Stripped & sstripped Binaries

When a binary has all symbol tables and section headers wiped (e_shoff = 0):

  • bin-debug-friendly reconstructs synthetic .text, .data, and .shstrtab section headers past the last PT_LOAD segment in its temporary sandbox copy, allowing GDB to disassemble and inspect memory without crashing.
  • On x86_64, main() is resolved statically from machine code at _start (lea rdi, [rip + disp32]).

9. Air-Gapped Bubblewrap Security Model

Every live debugging session, autonomous mapper run, lifecycle heap dump, and strace execution is isolated inside Bubblewrap (bwrap):

Host Workstation Filesystem          Bubblewrap Execution Namespace (/tmp/work)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ /home/<user>/...       β”‚ ──[BLOCK]─┼─> Completely invisible; unmounted       β”‚
β”‚ ~/.ssh, api keys, data β”‚ ──[BLOCK]─┼─> Zero access                           β”‚
β”‚ Host Network Stack     β”‚ ──[BLOCK]─┼─> Unshared namespace: no internet      β”‚
β”‚ /usr, /bin, /lib*      β”‚ ──[RO]────┼─> Read-only system runtime binaries     β”‚
β”‚ Disposable Tempdir     β”‚ ──[RW]────┼─> Mounted at /tmp/work (tmpfs)          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • --unshare-all: Isolates mount, IPC, network, PID, UTS, and cgroup namespaces.
  • --cap-drop ALL: Strips all Linux root capabilities.
  • --new-session: Detaches controlling TTYs to prevent terminal keystroke injection.
  • --clearenv: Sanitizes environment variables, passing only minimal PATH and TMPDIR.

10. License

This project is open-source software licensed under the GNU General Public License v3.0 (GPLv3).

About

HT-RE is a dependency-light, high-performance, web-based binary analysis suite, native terminal debugger, and low-level development environment built natively for 64-bit Linux (x86_64 and aarch64).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages