Skip to content

dd86k/ddhx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

705 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

                    β–‘       β–‘β–‘β–‘       β–‘β–‘β–‘  β–‘β–‘β–‘β–‘  β–‘β–‘  β–‘β–‘β–‘β–‘  β–‘
                    β–’  β–’β–’β–’β–’  β–’β–’  β–’β–’β–’β–’  β–’β–’  β–’β–’β–’β–’  β–’β–’β–’  β–’β–’  β–’β–’
                    β–“  β–“β–“β–“β–“  β–“β–“  β–“β–“β–“β–“  β–“β–“        β–“β–“β–“β–“    β–“β–“β–“
                    β–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆ
                    β–ˆ       β–ˆβ–ˆβ–ˆ       β–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆ  β–ˆ

+------------------------------------------------------------------------------+
        hex   0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                   
          0  4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00  MZ..............  
         10  b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  ........@.......  
         20  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................  
         30  00 00 00 00 00 00 00 00 00 00 00 00 f0 00 00 00  ................  
         40  0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68  ........!..L.!Th  
         50  69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f  is program canno  
         60  74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20  t be run in DOS   
         70  6d 6f 64 65 2e 0d 0d 0a 24 00 00 00 00 00 00 00  mode....$.......  
         80  41 b8 1d c5 05 d9 73 96 05 d9 73 96 05 d9 73 96  A.....s...s...s.  
         90  11 b2 77 97 09 d9 73 96 11 b2 70 97 03 d9 73 96  ..w...s...p...s.  
         a0  11 b2 76 97 c4 d9 73 96 11 b2 72 97 02 d9 73 96  ..v...s...r...s.  
         b0  05 d9 72 96 ad d9 73 96 63 b6 8e 96 0d d9 73 96  ..r...s.c.....s.  
         c0  57 ac 77 97 14 d9 73 96 57 ac 70 97 0f d9 73 96  W.w...s.W.p...s.  
         d0  57 ac 76 97 2c d9 73 96 05 d9 73 96 e0 df 73 96  W.v.,.s...s...s.  
         e0  ca ac 71 97 04 d9 73 96 52 69 63 68 05 d9 73 96  ..q...s.Rich..s.  
         f0  50 45 00 00 64 86 0d 00 02 7c bc 68 00 00 00 00  PE..d....|.h....  
        100  00 00 00 00 f0 00 22 00 0b 02 0e 1d 00 c8 21 00  ......".......!.  
        110  00 9e 0b 00 00 00 00 00 e2 7d 00 00 00 10 00 00  .........}......  
        120  00 00 00 40 01 00 00 00 00 10 00 00 00 02 00 00  ...@............  
        130  06 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00  ................  
        140  00 e0 2d 00 00 04 00 00 00 00 00 00 03 00 60 81  ..-...........`.  
        150  00 00 10 00 00 00 00 00 00 10 00 00 00 00 00 00  ................  
        160  00 00 10 00 00 00 00 00 00 10 00 00 00 00 00 00  ................  
  OVR |  x8 |    ascii |       6c
+------------------------------------------------------------------------------+

ddhx is a simple byte-oriented multi-platform modal TUI hex editor.

Currently available for Windows, macOS, Linux, and BSDs.

License: MIT
Title font: Shaded Blocky (FIGlet)

// FEATURES

  * Supports insert, overwrite, and delete operations
  * Unlimited undo/redo, even with new buffers
  * Large file support: up to 8 EiB
  * Visual selection and range commands
  * Character sets: ascii, mac, cp437, ebcdic
  * Search data with a powerful pattern syntax
  * Skip identical data or repeating patterns by selection
  * Customizable with configuration file
  * Copy, Cut, and Paste data at will

////////////////////////////////////////////////////////////////////////////////
// Roadmap

This list may change at any given time without notice.

0.9: Released!
- [x] Color theming
- [x] In-place saving (Fast Save Optimization)
- [x] Piece Coalescing
- [x] View: Other data types (d8, o8, d16, f32, etc.)

0.10: WIP
- [ ] Bookmarks / Annotations ("bookmark-{save|load}")
- [ ] Layout system

Wishlist:
- [ ] Charset-specific pattern prefixes (e.g., ebcdic:)
- [ ] Diff view (vs. opened document)
- [ ] Document: Disk
- [ ] Document: Process memory
- [ ] Endian-specific pattern prefixes (e.g., u32le:)
- [ ] Inspect data panel (replaces text panel when toggled)

////////////////////////////////////////////////////////////////////////////////
// Getting Started

Create a new empty buffer:
  $ ddhx

Open a file:
  $ ddhx file.bin

Read from a pipe:
  $ curl -s https://example.com/file | ddhx

Navigate with arrow keys, Page Up/Down, and Home/End. Edit by typing hex
digits (0-9, a-f). Undo with Ctrl+U, redo with Ctrl+R. Press Enter to
open the command prompt. Select data using Shift and navigation keys. Quit
with Ctrl+Q.

For full documentation, see the manpage:
  $ man ddhx

Or use the built-in help pages:
  $ ddhx --help
  $ ddhx --help-keys
  $ ddhx --help-commands
  $ ddhx --help-config

////////////////////////////////////////////////////////////////////////////////
// Compiling

To compile this project, you'll need a D compiler and DUB.

All major compilers are supported (DMD, GDC, and LDC).

DUB is used for project management and building. It is typically available in
system repositories as 'dub'.

DMD is typically available in system repositories and on https://dlang.org/.

GDC is typically available in system repositories as 'gdc', 'gdc-*', 'gcc-gdc',
'gcc*-gdc', 'gcc-d', or 'gcc-d-*'. For example, on Ubuntu 24.04, 'gdc-9' to
'gdc-14' are available. This project doesn't use 'gdmd', the dmd wrapper.

LDC is typically available in system repositories as 'ldc', and is typically
invoked using 'ldc2'. This project doesn't use 'ldmd2', the dmd wrapper.

Minimum version should be a compiler with DMD front-end version 2.081 and
later. Project successfully compiles on Ubuntu 16.04 using dmd-2.082.0,
using the deb package from dlang.org.

Compile a debug build:
  $ dub build
Compile a release build using a specified compiler:
  $ dub build -b release --compiler=ldc2

If DUB is unavailable, a Makefile is also available.

////////////////////////////////////////////////////////////////////////////////
// Debugging

Since things might break, there are unit testing and logging facilities.

Run unit tests (useful for new platforms):
  $ dub test
Run unit tests with log traces to stderr:
  $ dub test --d-version=Trace
Run a specific system integration test:
  $ dub test -b TYPE
  TYPE: input (terminal input), color (terminal colors), size (terminal size)

Environment variables:
- DDHX_LOG=PATH
  - If set, enables logging debugging information into this file.
  - Version: Since 0.7
- DDHX_BACKEND=BACKEND
  - Forces BACKEND to be selected.
  - Version: Since 0.7
  - Default: "piecev3" (since 0.9)
  - Backends: "piecev3" (>=0.9), "piecev2" (>=0.8), "piece" (>=0.7 <0.9)
- DDHX_NO_INPLACE_SAVE
  - If set to 1, avoid the use of the newer "in-place" saving mechanic.
  - Version: Since 0.9

********************************************************************************
*                                    NOTICE                                    *
********************************************************************************

This software is provided with NO WARRANTY as it is marked as EXPERIMENTAL.

Major progress has been made since version 0.5! It should be good enough for
regular use.