All Projects → krpors → hx

krpors / hx

Licence: MIT License
Hex editor for the terminal using plain C99 + POSIX libs.

Programming Languages

c
50402 projects - #5 most used programming language
Roff
2310 projects
Makefile
30231 projects

Projects that are alternatives of or similar to hx

komapper
Kotlin SQL Mapper
Stars: ✭ 28 (-78.79%)
Mutual labels:  no-dependencies
autocomplete
Simple accessible autocomplete for vanilla javacript with support for remote & local data, ~3KB gzip
Stars: ✭ 38 (-71.21%)
Mutual labels:  no-dependencies
iutest
c++ testing framework
Stars: ✭ 58 (-56.06%)
Mutual labels:  no-dependencies
influxdb-c
💙 C write client for InfluxDB.
Stars: ✭ 28 (-78.79%)
Mutual labels:  no-dependencies
byte-lite
byte lite - A C++17-like byte type for C++98, C++11 and later in a single-file header-only library
Stars: ✭ 43 (-67.42%)
Mutual labels:  no-dependencies
CLIp
CLIp is a clipboard manager for a command line interface written in 100% standard C only. Pipe to it to copy, pipe from it to paste.
Stars: ✭ 12 (-90.91%)
Mutual labels:  no-dependencies
Calculate
Math Expressions Parser Engine
Stars: ✭ 30 (-77.27%)
Mutual labels:  no-dependencies
tall
Promise-based, No-dependency URL unshortner (expander) module for Node.js
Stars: ✭ 56 (-57.58%)
Mutual labels:  no-dependencies
jthread-lite
C++20's jthread for C++11 and later in a single-file header-only library
Stars: ✭ 43 (-67.42%)
Mutual labels:  no-dependencies
flatboard
A very Fast & Lightweight Flat-file forum software, Markdown and BBcode editor.
Stars: ✭ 30 (-77.27%)
Mutual labels:  no-dependencies
js-calendar
The lightest Javascript calendar out there, without any dependency.
Stars: ✭ 37 (-71.97%)
Mutual labels:  no-dependencies
Minemap
An efficient map viewer for Minecraft seed in a nice GUI with utilities without ever needing to install Minecraft.
Stars: ✭ 104 (-21.21%)
Mutual labels:  no-dependencies
github-profile-card
Simple and easy to use widget with your GitHub profile — No dependencies
Stars: ✭ 98 (-25.76%)
Mutual labels:  no-dependencies
aioconnectors
Simple secure asynchronous message queue
Stars: ✭ 17 (-87.12%)
Mutual labels:  no-dependencies
subjx
Drag/Resize/Rotate Javascript library
Stars: ✭ 155 (+17.42%)
Mutual labels:  no-dependencies
HexManiacAdvance
A hex editor designed for editing Pokemon GBA games
Stars: ✭ 73 (-44.7%)
Mutual labels:  hex-editor
tabbis.js
Pure vanilla javascript tabs with nesting
Stars: ✭ 44 (-66.67%)
Mutual labels:  no-dependencies
state saver
Transferred to https://github.com/Neargye/yacppl
Stars: ✭ 14 (-89.39%)
Mutual labels:  no-dependencies
result
A lightweight C++11-compatible error-handling mechanism
Stars: ✭ 121 (-8.33%)
Mutual labels:  no-dependencies
GitHubSearch
GitHub iOS client with minimum third-party dependencies.
Stars: ✭ 34 (-74.24%)
Mutual labels:  no-dependencies

hx

A hex editor using plain C + POSIX libs. The project's code is somewhat influenced by the kilo project.

For an idea how it looks:

hx

Compiling and running

The project does not have a dependency on libraries, not even curses. Like the kilo editor, it makes use of ANSI escape sequences. The source can be compiled by simply running make, or make all to gzip the manpage as well. To install, simply run make install (as root). The files are currently installed under /usr/local/bin/ (binary) and /usr/local/man/man1 (man page). Not really sure yet if this is portable across distributions, though.

Running hx:

hx filename       # open a file
hx -h             # for help
hx -v             # version information
hx -o 32 filename # open file with 32 octets per line
hx -g 8 filename  # open file, set octet grouping to 8

Keys which can be used:

CTRL+Q  : Quit immediately without saving.
CTRL+S  : Save (in place).
hjkl    : Vim like cursor movement.
Arrows  : Also moves the cursor around.
w       : Skip one group of bytes to the right.
b       : Skip one group of bytes to the left.
gg      : Move to start of file.
G       : Move to end of file.
x / DEL : Delete byte at cursor position.
/       : Start search input. "\xYZ" can be used to search for
          byte value YZ, and '\' must be escaped by another '\'
          to search for '\'.
n       : Search for next occurrence.
N       : Search for previous occurrence.
u       : Undo the last action.
CTRL+R  : Redo the last undone action.

a       : Append mode. Appends a byte after the current cursor position.
A       : Append mode. Appends the literal typed keys (except ESC).
i       : Insert mode. Inserts a byte at the current cursor position.
I       : Insert mode. Inserts the literal typed keys (except ESC).
r       : Replace mode. Replaces the byte at the current cursor position.
:       : Command mode. Commands can be typed and executed (see below).
ESC     : Return to normal mode.

]       : Increment byte at cursor position with 1.
[       : Decrement byte at cursor position with 1.

End     : Move cursor to end of the offset line.
Home    : Move cursor to the beginning of the offset line.

Command mode

Being in normal mode (ESC) then hitting the colon key :, you can enter command mode where manual commands can be typed. The following commands are recognized currently:

  • :123 : go to offset 123 (base 10)
  • :0x7a69 : go to offset 0x7a69 (base 16), 31337 in base 10.
  • :w : writes the file.
  • :q : quits (will warn if the buffer is dirty).
  • :q! : quits promptly without warning.
  • set o=16 : sets the amount of octets per line.
  • set g=8 : sets grouping of bytes.

Input is very basic in command mode. Cursor movement is not available (yet?).

Implementation details

The program uses raw ANSI escape sequences for manipulating colors, cursor positions and whatnot. The program first initializes the terminal in so-called raw mode (see man termios). Then keypresses are read, processed and then one function renders the contents, cursor and stuff.

In any case, the source code is pretty heavily commented I guess. For more details, Use The Source Luke.

Wishlist and TODOs

  1. Perhaps a configuration file to control the colors or some default settings.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].