-
Notifications
You must be signed in to change notification settings - Fork 4
πͺ dd's hex editor
License
dd86k/ddhx
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
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 multi-platform Text UI hex editor, inspired by GNU nano and vim.
Currently available for Windows, macOS, Linux, and FreeBSD.
License: MIT
Title font: Shaded Blocky (FIGlet)
********************************************************************************
* NOTICE *
********************************************************************************
This software is provided with NO WARANTY as it is marked as EXPERIMENTAL.
ALWAYS make backups of your files before editing them.
This is a Work In Progress (WIP). Everything was rewritten from scratch
in attempts to have editing features, as version 0.5 will be the first
version to feature editing capabilities.
//
// Roadmap
//
This list may change at any given time without notice.
0.5:
- [x] Support overwrites
- [x] Support appends
- [x] Save new buffer to file
- [x] Save existing file
- [x] History undo/redo
- [x] Command prompt
- [x] Standard input (stdin) support as new buffer
- [x] Skip to different element (or byte) (Ctrl+Left/Right)
0.6:
- [ ] Support insertions
- [ ] Support deletions
Future:
- [ ] Non-interactive session (--dump)
- [ ] 'bind' command: map command to shortcut
- [ ] Config file support
- [ ] Support for other single-byte data types in view (d8, o8)
- [ ] Support for multi-byte data types in view (d16, f32, etc.)
- [ ] Insert characters
- [ ] Insert zeros
- [ ] Insert file
- [ ] Select multiple elements, copy, and paste
//
// Usage
//
ddhx aims to be a small and easy-to-use visual hexadecimal editor. For that
purpose, there are multiple ways of using the editor.
Sypnopsis:
ddhx [OPTIONS] [FILE|-]
ddhx {-h|--help|--version|--ver}
To create a new buffer:
$ ddhx
To open an existing or create a new file at this location:
$ ddhx FILENAME
To open a new buffer with data piped:
$ echo test | ddhx -
Minimum recommended terminal size is 80x24 characters.
Navigation can be done using keybinds or commands. Editing is done directly
using the A to F and 0 to 9 keys. And saving is default mapped to Ctrl+S.
Currently, only overwrite and append operations are supported.
The command-line interface matches POSIX guidelines.
OPTIONS DESCRIPTION
-c, --columns Set columns per row (default depends on --data)
--address Set address mode ('hex', 'dec', or 'oct')
--address-spacing Set address spacing in characters
-C, --charset Set character translation (default='ascii')
-R, --readonly Open file in read-only editing mode
--log Debugging: Enable tracing to this file
--chunksize Debugging: Set in-memory patch chunks to this size
--version Print the version page and exit
--ver Print only the version and exit
-h, --help Print this help page and exit
//
// Commands
//
Commands can be executed using the command prompt.
By pressing Return, you can type a command, and then confirm it by pressing the
Return key again.
Some commands have arguments. When these arguments are omitted, the associated
command will prompt for these arguments.
For example, moving the cursor ahead of 32 bytes:
>goto +0x20
Typing "goto" alone will make the program ask for an offset. This command also
has the shortcut of Ctrl+G. In the case of "goto", it accepts decimal, octal,
and hexadecimal values.
COMMAND DESCRIPTION
"cursor-left" Navigate one element back
"cursor-right" Navigate one element forward
"cursor-up" Navigate one line back
"cursor-down" Navigate one line forward
"cursor-page-up" Navigate one page back (rows*columns)
"cursor-page-down" Navigate one page forward (rows*columns)
"cursor-line-start" Navigate to start of line
"cursor-line-end" Navigate to end of line
"cursor-sof" Go to start of buffer
"cursor-eof" Go to end of buffer
"cursor-diff-back" Skip to different element backward
"cursor-diff-front" Skip to different element forward
"move-up" Move view up a row
"move-down" Move view down a row
"goto" Go to position
"change-panel" Switch between data and text panel
"change-writemode" Change writing mode
"report-position" Report the position of the cursor in the buffer
"save" Save buffer to file
"save-as" Save buffer as a different name
"undo" Undo change
"redo" Redo change
"quit" Quit program
"set" Set a configuration value. (See Configuration section)
//
// Default keybinds
//
KEY COMMAND
LeftArrow "cursor-left"
RightArrow "cursor-right"
UpArrow "cursor-up"
DownArrow "cursor-down"
PageUp "cursor-page-up"
PageDown "cursor-page-down"
Home "cursor-line-start"
End "cursor-line-end"
Ctrl+Home "cursor-sof"
Ctrl+End "cursor-eof"
Ctrl+LeftArrow "cursor-skip-back"
Ctrl+RightArrow "cursor-skip-front"
Ctrl+UpArrow "move-up"
Ctrl+DownArrow "move-down"
Tab "change-panel"
Insert "change-writemode"
Ctrl+P "report-position"
Ctrl+S "save"
Ctrl+O "save-as"
Ctrl+U "undo"
Ctrl+R "redo"
Q or Ctrl+X "quit"
Enter, Return Show command prompt
//
// Configuration
//
The editor can be configured at runtime using the "set" command.
For example, changing the character set:
"set charset mac"
Many of these configuration parameters can be set using the Command-Line
Interface. For example, "columns" is mapped to "-c" and "--columns="
"columns"
Number of elements to show on a row
Argument: Number
Default: 16
"address-type", "address"
Change displayed address type
Argument: "hex", "dec", or "oct"
Default: "hex"
"address-spacing"
Change how much spacing the left address column takes
Argument: Number
Default: 11 (upto 0xfffffffffff, so ~16 TiB)
"charset"
Change displayed character set
Argument: "ascii", "cp437", "mac", or "ebcdic"
Default: "ascii"
//
// Compiling & Debugging
//
To compile this project, you'll need a D compiler and DUB.
All major compilers are supported (DMD, GDC, and LDC). LDC, GDC, and DUB are
typically available in package repositories as gdc/gdc-*/gcc-gdc, ldc2, and
dub.
Compile a debug build:
$ dub build
Compile a release build using a specific compiler:
$ dub build -b release --compiler=ldc2
Run unit tests with log traces:
$ dub test --d-version=Trace
The --log=FILENAME option is useful for reporting bugs.