A simple hex editor written in C.
  • C 96.6%
  • Makefile 3.4%
Find a file
2026-08-21 10:50:44 +03:00
.gitignore Added write buffering per line, updated status output, updated README 2026-08-20 20:17:03 +03:00
LICENSE Updated LICENSE 2026-08-20 22:06:31 +03:00
main.c Fixed version printout 2026-08-21 10:50:44 +03:00
Makefile Added Makefile, version printout if no args 2026-08-17 09:42:44 +03:00
README.md Added write buffering per line, updated status output, updated README 2026-08-20 20:17:03 +03:00

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.