π Live Demo β’ Key Features β’ Installation β’ Architecture β’ Documentation
β οΈ MVP β Minimum Viable Product. Early functional version.
Web hex editor for technical binary analysis, developed entirely with TypeScript and native browser APIs. It employs a Zero-Framework architecture to minimize execution overhead and utilizes a virtualized rendering system that enables inspection of large buffers without interface latency, integrating signature-based format detection engines and transactional state management.
Click on the image to open the live demo
Dynamically detects and interprets the structure of the following file formats by their byte signature (magic bytes):
| Category | Supported Formats |
|---|---|
| Executables | ELF (Linux/Unix), PE 32/64-bit (Windows) |
| Documents | PDF |
| Archives | ZIP |
| Images | PNG, JPEG |
| Raw Binaries | BIN β block-level entropy analysis |
Each parser extracts sections, headers, and structured metadata that are presented visually in the sidebar tree of the interface.
The hex-view component implements sliding-window virtualized rendering: only the bytes currently visible on screen are injected into the DOM. This allows inspecting files hundreds of MB in size with smooth scrolling, without UI blocking or memory consumption spikes.
- Layout: Three columns per row (hex offset | hex values | ASCII representation).
- Semantic Highlighting: Automatically color-codes bytes based on their role:
Header / Magic(Purple): File signatures and critical metadata.Structured(Blue): Bytes belonging to parsed sections (sections, segments).Modified(Yellow): Bytes edited during the current session.Null(Dimmed): Zero bytes for easier structure visualization.
Clicking or selecting one or more bytes triggers the inspector side panel to decode them on the fly into:
- Integers:
Int8,UInt8,Int16,UInt16,Int32,UInt32,Int64,UInt64β in bothLittle EndianandBig Endianvariants. - Floating Point:
Float32,Float64. - Strings & Encodings:
ASCII,UTF-8,UTF-16,UTF-32, andLatin-1. - Bit view: individual bit decomposition (
b0βb7) of the byte under the cursor. - Time/Date: Automatic Unix timestamp detection (converts 4/8 byte sequences to ISO dates).
- Color Preview: Real-time RGB/RGBA swatch for 3 or 4-byte selections.
- Data Export: Instant Base64 encoding of the active selection.
A custom-built exhaustive state machine that seamlessly handles byte replacements and range edits. Guarantees complete reversibility of all edit operations via in-memory command stacks with O(1) access. Each command stores the old and new values for every affected byte, enabling precise bidirectional replay.
Uses Branded Types throughout the type system (AbsoluteOffset, ByteCount, VirtualAddress), preventing semantic mix-ups in numeric operations or index accesses that could result in silent logic errors. All arithmetic on binary offsets is strictly bounded and validated at compile time.
Integrated search engine (search.ts) that locates arbitrary byte sequences within the active buffer, supporting hex, ASCII, and UTF-8 input modes, with visual highlighting of matches in the hex view and toolbar navigation (next / previous result, up to 1,000 matches).
- Recent Files Management:
recents.tsmodule that persists the history of recently opened files via IndexedDB, ensuring persistence across browser sessions. Allows quick reopening of previous files from the welcome screen, including file format and size metadata.
Block-level Shannon entropy calculation (entropy.ts), useful for identifying plaintext zones, compressed data, or encrypted segments in arbitrary binaries.
npm installThe project provides several pre-configured commands for the development lifecycle (defined in package.json):
# Development server with native HMR (port 5173, opens browser automatically)
npm run dev
# Type-check without emitting code β ideal for CI or pre-commit hooks
npm run typecheck
# Build optimized production bundle β /dist
npm run build
# Clean the /dist output directory (cross-platform)
npm run clean
# Preview the production build on localhost
npm run preview
# Run tests in watch mode (interactive development)
npm run test
# Run tests once (ideal for CI/CD pipelines)
npm run test:run
# Open Vitest UI for interactive test inspection in the browser
npm run test:ui
# Generate code coverage report with V8
npm run coverage
# Generate API documentation with TypeDoc β /docs
npm run docsNote: The development server starts at
http://localhost:5173withstrictPort: trueβ if the port is already in use, Vite will throw an error instead of trying another port.
The source tree (/src) and tests (/tests) are structured with strictly separated responsibilities:
src/
βββ main.ts # Entry point: initializes the app and manages sessionStorage
βββ vite-env.d.ts # Vite environment declarations
β
βββ types/
β βββ index.ts # Branded Types, domain events, analytical structures
β
βββ core/
β βββ buffer.ts # In-memory byte buffer management (read / write / patches)
β βββ editor.ts # Editor engine: Undo/Redo command stack, edit state
β βββ search.ts # Byte pattern search engine (hex, ASCII, UTF-8 modes)
β βββ selection.ts # Byte range selection management
β βββ parsers/
β βββ index.ts # Automatic parser dispatcher by file signature
β βββ elf.ts # ELF parser (sections, program headers, segments)
β βββ pe.ts # PE 32/64-bit parser (DOS header, NT headers, sections)
β βββ jpeg.ts # JPEG parser (EXIF markers, APP0, SOF, DQT)
β βββ pdf.ts # PDF parser (xref table, objects, streams)
β βββ png.ts # PNG parser (IHDR, IDAT, tEXt chunks, metadata)
β βββ zip.ts # ZIP parser (central directory, local file headers)
β
βββ ui/
β βββ screens/
β β βββ welcome.html # Welcome screen HTML template
β β βββ welcome.ts # Welcome screen logic and file loading
β β βββ editor.html # Main editor HTML template
β β βββ editor.ts # Editor screen orchestrator (mounts and wires all components)
β βββ components/
β βββ drop-zone.ts # Drag & drop area for file loading
β βββ hex-view.ts # Virtualized hex view (sliding-window rendering)
β βββ inspector.ts # Inspector panel: on-the-fly byte decoding
β βββ sidebar.ts # Sidebar tree of parsed file sections
β βββ status-bar.ts # Status bar: offset, size, active selection
β βββ toolbar.ts # Toolbar: file and edit actions, search input
β
βββ styles/
β βββ tokens.css # Design tokens: global CSS variables (colors, fonts, spacing)
β βββ base.css # Document reset and base styles
β βββ welcome.css # Welcome screen specific styles
β βββ editor.css # Editor and all component styles
β
βββ utils/
βββ encoding.ts # Encoding/decoding utilities (ASCII, UTF-8)
βββ entropy.ts # Block-level Shannon entropy calculation
βββ hex.ts # Hexadecimal conversion and formatting
βββ recents.ts # Recent files history persistence
βββ storage.ts # Abstraction over sessionStorage/localStorage
tests/ # Vitest test suites (mirrors /src structure)
βββ core/ # Core logic tests (buffer, editor, search)
βββ parsers/ # Format detector and parsing tests
βββ utils/ # Utility function tests
The orchestrator is ui/screens/editor.ts, which mounts all components and wires the data paths after the file is loaded:
File (File API / Drag & Drop)
β
βΌ
buffer.ts ββββββββββββββββββββββΊ parsers/index.ts
(loads ArrayBuffer) β
β detects format, dispatches
β β
β βΌ
β ELF / PE / PNG / ...
β β
β SectionNode[]
β β
βΌ βΌ
editor.ts (core) sidebar.ts
(initEditor: Undo/Redo (section tree UI)
command stack, modified
byte cache)
β
ββββΊ hex-view.ts
β (renders visible bytes; subscribes to
β onEditorChange for dirty-byte highlights;
β emits pointer events β selection.ts)
β
ββββΊ selection.ts
β (tracks active byte range;
β onSelectionChange βββΊ inspector.ts
β ββββΊ status-bar.ts)
β
ββββΊ inspector.ts
β (decodes selected / hovered bytes on the fly;
β refreshed by onEditorChange for live edits)
β
ββββΊ status-bar.ts
β (cursor offset, file size, selection length)
β
ββββΊ toolbar.ts
β (column selector, search input)
β β
β ββββΊ search.ts
β (findAll over buffer;
β results β selection.ts + hex-view scroll)
β
ββββΊ sidebar.ts
(section click β inspector.setSection +
hex-view.scrollToOffset)
Technical documentation generated from the project's source code using TypeDoc.
Documentation: https://pgomur.github.io/binary-raw/index.html