- C 96.6%
- Makefile 3.4%
| .gitignore | ||
| LICENSE | ||
| main.c | ||
| Makefile | ||
| README.md | ||
chexeditor
A binary file hex editor written in C, inspired by Vim / Ed.
Example Usage:
-
./chexeditor a.bin Opens file a.bin for editing. If it does not exist, creates it.
-
./chexeditor a.bin --readonly Opens file a.bin for reading only. If it does not exist, throws error.
-
./chexeditor Prints out version number, usage
The interface uses vim-like keybindings to move around and edit. l, h move you forward / backward by one byte. k, j move you up / down one line.
r edits (replaces) the currently selected byte with the next two valid hex digits the user inputs. Example input to perform a replacement would be:
r 8 f
which would replace the selected byte with 8F.
w writes the current line edits to the file.
Empty lines / bytes are shown as "--". Writing can be done perfetly well on empty lines, meaning the user can create empty files and modify them as they wish (eg writing machine code to hardcode instructions for a microcontroller).
If the user edits an empty byte, all previous empty bytes are padded with 00. Example: A user decides to edit empty file a.bin, and replaces byte 8 from line 4 with FB. All previous bytes until line 1 byte 1 are 00.