Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

131 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

HxEditor

HxEditor Main Interface

HxEditor is a powerful, native macOS hex editor built with SwiftUI. Designed for developers, security researchers, and anyone working with binary files, it combines professional-grade features with an intuitive, modern interface.

โœจ Features

๐ŸŽฏ Core Editing

  • Flexible Input Modes: Switch between ASCII and hex input (โŒ˜G)
  • Multi-Byte Selection: Drag to select, Shift+Arrow to extend
  • Insert/Overwrite Modes: Toggle with Insert key
  • Smart Operations: Copy, Cut, Paste, Duplicate, Delete, Zero Out
  • Undo/Redo Support: Full undo history for all operations
  • Context Menus: Right-click any byte for quick actions

๐Ÿ” Search & Navigation

Find & Replace

  • Powerful Search: Find hex patterns or ASCII/UTF-8 text (โŒ˜F)
  • Find & Replace: Replace single or all occurrences
  • Jump to Offset: Navigate directly to any position (โŒ˜J)
  • Bookmarks: Mark important locations (โŒ˜B)
  • Keyboard Navigation: Arrow keys with selection support

๐Ÿ“Š Analysis Tools

File Statistics

File Statistics

  • Byte distribution histogram
  • Entropy calculation
  • Min/Max/Average values
  • Pattern detection

Checksum Calculator

Checksum Calculator

  • MD5, SHA-1, SHA-256, SHA-512
  • CRC32 checksums
  • Calculate for entire file or selection
  • One-click copy to clipboard

String Extraction

String Extraction

  • Extract ASCII and Unicode strings
  • Configurable minimum length
  • Filter by string type
  • Search within results
  • Click to jump to location
  • Export strings to clipboard

๐Ÿ”„ File Comparison

File Comparison

  • Side-by-Side View: Compare two files simultaneously
  • Difference Highlighting: Color-coded changes (red for modifications)
  • Synchronized Scrolling: Both files scroll together
  • Smart Navigation: Jump between differences with โŒ˜[ and โŒ˜]
  • Statistics: Total blocks, bytes changed, match percentage
  • Show Only Differences: Toggle to hide matching regions
  • Efficient Algorithm: Handles large files with optimized Myers diff

๐Ÿ“ค Export Options

Export Options

Export your data in multiple formats:

  • C Array: Perfect for embedding in source code
  • Python Bytes: Ready-to-use Python byte strings
  • Base64: Web-safe encoding
  • Hex Dump: Traditional hex dump format
  • Raw Binary: Export selection as binary file

๐Ÿท๏ธ Metadata Editor

Metadata Editor

  • Add custom tags and notes to files
  • Track file analysis progress
  • Color-coded priority levels
  • Save metadata alongside files
  • Search and filter by metadata

๐Ÿ‘๏ธ Inspector Panel

  • Data Type Interpretation: View bytes as int8/16/32/64, float, double
  • Endianness Support: Toggle between little and big endian
  • String Preview: ASCII, UTF-8, and raw views
  • Binary Representation: See raw binary patterns
  • Selection Info: Offset, length, and statistics

๐ŸŽจ Visual Features

  • Byte Grouping: Configure display (1, 2, 4, 8, 16 bytes)
  • Color Coding: Printable ASCII (blue), control chars (gray), extended (purple)
  • Dual Pane View: Synchronized hex and ASCII
  • Selection Highlighting: Clear visual feedback
  • Native macOS Design: Full Dark Mode support

โšก Performance

  • Large File Support: Handles 10MB+ files smoothly
  • Gap Buffer: Efficient data structure for editing
  • Lazy Rendering: Only visible rows rendered
  • Range-Based Selection: Instant selection queries
  • Optimized Scrolling: Smooth even with large files

๐ŸŽน Keyboard Shortcuts

Navigation

  • Arrow Keys - Move cursor
  • Shift+Arrows - Extend selection
  • โŒ˜A - Select all
  • โŒ˜J - Jump to offset

Editing

  • โŒ˜C - Copy
  • โŒ˜X - Cut
  • โŒ˜V - Paste
  • โŒ˜D - Duplicate selection
  • โŒ˜I - Insert data
  • Backspace - Delete byte
  • โŒ˜0 - Zero out selection
  • โŒ˜Z - Undo
  • โŒ˜โ‡งZ - Redo

Modes & Tools

  • โŒ˜G - Toggle hex input mode
  • Tab - Switch hex/ASCII focus
  • โŒ˜F - Find
  • โŒ˜B - Toggle bookmark
  • โŒ˜[ - Previous difference (compare mode)
  • โŒ˜] - Next difference (compare mode)

๐Ÿš€ Getting Started

Requirements

  • macOS 13.0 or later
  • Xcode 15.0+ (for building from source)

Installation

From Source

# Open in Xcode
open HxEditor.xcodeproj

# Build and run (โŒ˜R)

Usage

  1. Open a File: Use File โ†’ Open (โŒ˜O) or drag & drop
  2. Edit: Click bytes to select, type to edit
  3. Switch Modes: Press โŒ˜G for hex input mode
  4. Analyze: Use toolbar buttons for analysis tools
  5. Export: Use โŒ˜E or toolbar button

๐Ÿ—๏ธ Architecture

Technologies

  • SwiftUI: Modern declarative UI framework
  • CryptoKit: Native checksum calculations
  • Combine: Reactive state management
  • AppKit Integration: For advanced file operations

Data Structures

  • Gap Buffer: O(1) insertion/deletion at cursor
  • Range-Based Selection: O(1) selection queries
  • Lazy Collections: Efficient memory usage

Algorithms

  • Myers Diff: Industry-standard comparison algorithm
  • Rolling Hash (Rabin-Karp): Fast pattern matching
  • xxHash64: High-speed chunk hashing for diffs

๐Ÿ“ Project Structure

HxEditor/
โ”œโ”€โ”€ HxEditor/
โ”‚   โ”œโ”€โ”€ HxEditorApp.swift           # App entry point
โ”‚   โ”œโ”€โ”€ ContentView.swift            # Main coordinator view
โ”‚   โ”œโ”€โ”€ HexGridView.swift            # Hex/ASCII grid
โ”‚   โ”œโ”€โ”€ HexTextView.swift            # NSTextView-based renderer
โ”‚   โ”œโ”€โ”€ DataBuffer.swift             # Gap buffer implementation
โ”‚   โ”œโ”€โ”€ HexDocument.swift            # Document model
โ”‚   โ”œโ”€โ”€ SearchView.swift             # Find & Replace
โ”‚   โ”œโ”€โ”€ ComparisonContentView.swift  # File comparison UI
โ”‚   โ”œโ”€โ”€ DiffEngine.swift             # Diff algorithm
โ”‚   โ”œโ”€โ”€ StringExtractor.swift        # String extraction
โ”‚   โ”œโ”€โ”€ ExportView.swift             # Export formats
โ”‚   โ”œโ”€โ”€ MetadataManager.swift        # File metadata
โ”‚   โ”œโ”€โ”€ ChecksumView.swift           # Checksum calculator
โ”‚   โ”œโ”€โ”€ StatisticsView.swift         # File statistics
โ”‚   โ”œโ”€โ”€ BookmarkManager.swift        # Bookmark system
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ screenshots/                     # App screenshots
โ”œโ”€โ”€ README.md                        # This file
โ””โ”€โ”€ .gitignore                       # Git ignore rules

๐ŸŽฏ Use Cases

Perfect for:

  • ๐Ÿ”ง Software Developers: Debug binary formats and protocols
  • ๐Ÿ”’ Security Researchers: Analyze malware and encrypted data
  • ๐ŸŽฎ Game Modders: Modify save files and game assets
  • ๐Ÿ’พ Data Recovery: Examine corrupted files
  • ๐Ÿ” Reverse Engineers: Understand proprietary file formats
  • ๐Ÿ“Š Data Scientists: Analyze binary data patterns

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with SwiftUI and modern macOS frameworks
  • Uses Apple's CryptoKit for cryptographic operations
  • Myers diff algorithm implementation inspired by various open-source projects

Made with โค๏ธ for the macOS developer community

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages