|
NAMEhxavi - A binary editor for vi and Vim users SYNOPSIShxavi [-a] [-b] [+[address]] filename DESCRIPTION1.ABOUTHexvi is a binary editor which shows binary files as
dumplist of hexadecimal numbers, and user can edit binary files. As commands
about cursor movements are almost similar to vi(1) or vim(1),
it is easy to remember.
2.OVERVIEW
3.TERMINOLOGYNext notations are used in the explanetions about commands from here. - Space key ................................. <spc> - Tab key ................................... <tab> - Shift+Tab key ............................. <shift+tab> - Enter key ................................. <ent> - Escape key ................................ <esc> - Backspace key ............................. <bs> - Insert key ................................ <ins> - Delete key ................................ <del> - Home key .................................. <home> - End key ................................... <end> - PageUp key ................................ <pgup> - PageDown key .............................. <pgdn> - Arrow keys ................................ <left>,<right>, 4.START AND QUIT
5.DESIGN OF SCREENWhen you start it, the following screen will be displayed. The top two lines are an area that displays information about the entire file, the lines below that are an area for dumping the file contents, a line beow that is a command input line, and a line below that is message display line. Depeiding on the option settings, a decimal interpretation of the currently displayed data may be displayed below that. ------------------------------------------------------------------------------ ReadOnly NotSaved Modified [-b] [-rwxr-xr-x] [sym-> 3] [2025-11-12 18:01:38] 000001B3CF2/0000036255F, 50%,.......1785074/.......3548511 ,U+00008D <COMMAND> | +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F |0123456789ABCDEF 000001B3CE0| C7 E8 8A 48 FE FF 48 8B 05 33 C7 1B 00 48 8B 40 |...H..H..3...H.@ 000001B3CF0| 38 48 8D 70 FF FF FF 48 3B 01 75 0E 48 8B BD 70 |8H.p...H;.u.H..p 000001B3D00| FF FF FF 89 DE E8 45 51 FE FF E8 70 18 FE FF 85 |......EQ...p.... 000001B3D10| C0 74 4C 48 8B 05 05 C7 1B 00 48 8B 70 38 8B 58 |.tLH......H.p8.X 000001B3D20| 40 48 8B 3D 97 C1 1B 00 BA 01 00 00 00 E8 DD 91 |@H.=............ 000001B3D30| FD FF 48 8B 0D 86 C1 1B 00 8B 49 24 8D 51 FE 83 |..H.......I$.Q..
6.COMMANDSThis section describes the commands that can be used with hxavi. Of the following commands, those with a '*' at the beginning of the description have different names and functions from the commands vi(1), vim(1).
(command)(explanation)h|H|<bs>|<left> Move the cursor one byte to the left.
l|<spc>|<right>
Move the cursor one byte to the right.
k|^P|<up> Move the cursor one line up to the same column.
j|^N|<down> Move the cursor down one line to the same column.
0|^
Move the cursor to the position of the data at the left
end of the line.
$
Move the cursor to the position of the data at the right
end of the line.
fHH ("HH" is a 2-digit hexadecimal number)
Search forward for HH in the line and move to that
location if found.
FHH ("HH" is a 2-digit hexadecimal number)
Search backward for HH in the line and move to that
location if found.
tHH ("HH" is a 2-digit hexadecimal number)
Search forward for HH in the line, and if found, move to
just before that location.
THH ("HH" is a 2-digit hexadecimal number)
Search backward for HH in the line, and if found, move to
just after that location.
; Repeated search within the line.
+|<ent> Move the cursor to the beginning of the next line. - Move the cursor to the beginning of the previous line. H|<home> Move the cursor to the home position (upper left corner). M Move the cursor to the left edge of the center line. L Move the cursor to the left edge of the bottom line of
the screen.
<end>
Move the cursor to the right edge of the bottom line of
the screen.
zt Moves the line where the cursor is to the top edge.
zz Moves the line where the cursor is to the center. zb Moves the line where the cursor is to the bottom edge. z<ent> Moves the line where the cursor is to the top edge, and
the cursor moves to the left edge.
z.
Moves the line where the cursor is to the center, and the
cursor moves to the left edge.
z-
Moves the line where the cursor is to the bottom edge,
and the cursor moves to the left edge.
^Y/^E
Scroll one line up (towards the smaller address) / down
(towards the larger address).
^U/^D
Scroll up (towards the smaller address) / down (toward
the larger address) by half a page.
^B|<pgup> Display the previous page.
^F|<pgdn> Display the next page. gg Move the cursor to the top left edge of file. G Move the cursor to the bottom left edge of the file. :go <destination address><ent> or :<destination address><ent> Move the cursor to the address indicated by
<destination>(Hexadecimal|Decimal|Octal|Binary). Please refer to 7.1 for
how to write address.
/{pattern}<ent>
Searches the data specified in pattern (7.5. Later)
forward (in the direction of the large address). The pattern can be either an
even number of hexadecimal digits, or a string of text begining with a
'"' (double quote). Do not enclose the pattern with another '/'.
/<ent>
Repeat the forward search with the previously specified
pattern.
?{pattern}<ent>
Searches the data specified by pattern backward (in the
direction of the small address).
?<ent>
Repeat the backward search with the previously specified
pattern.
/:{decimalnumber}<ent>
Specify a decimal number to search forward for data with
that value. Data type can be selected with
<tab>,<shift+tab>.
/:{decimalmin},{decimalmax}<ent>
Given two decimal numbers, search forward for data
between the two values. When searching by specifying floating point numbers,
it is better to specify a range using two values, as there is a conversion
error between binary and decimal numbers, and it is difficult to match them
with one value.
?:{decimalnumber}<ent>
Specify a decimal number to search backward for data with
that value. Data type can be selected with
<tab>,<shift+tab>.
?:{decimalmin},{decimalmax}<ent>
Given two decimal numbers, search backward for data
between the two values. When searching by specifying floating point numbers,
it is better to specify a range using two values, as there is a conversion
error between binary and decimal numbers, and it is difficult to match them
with one value.
n Repeated the last search (in the same direction).
N Repeat the last search (reverse direction). mx (x is one of a-z) Give the cursor position the name x. ´x Jumps to the location of name x and move to the far left. `x Jump to the location of name x. The following is a summary of the movements of the main commands.
Enter insert mode. The mode display changes to
<INSERT>. The commands available in it are:
(commands)(explanation)
* Display the help screen in the mode. Press
the'<esc>' or 'q'keys to return to the original screen.
0-9|a-f|A-F
Enter the hexadecimal value.
"{string}<ent> * Insert the character string entered in
"string" as data.
:{decimalnumber}<ent> * Interprets the decimal number entered with
"decimalnumber" and inserts it as data.
You can select which data type (integer/floating point number, with/without sign, data length) to interpret the entered decimal number with <tab> or <shift+tab>. <tab> and <shift+tab> can be used even while entering a numerical value. (The first character is a colon':'.) #{binarynumber}<ent> * Interprets the binary number entered with
"binarynumber" and inserts it as data.
You can select which data type (integer/floating point number, with/without sign, data length) to interpret the entered binary number with <tab> or <shift+tab>. :set decimalview must be set. h|^H|<bs> Cancellation, retreat.
^L * Redisplay the screen.
<esc> Exit the mode.
I Move to the beginning of the line and enter insert
mode.
a Move one byte ahead of the cursor to enter insert mode. A Move to the end of the line and enter insert mode. o Move to the beginning of the next line and enter insert mode. O Move to the beginning of the line and enter insert mode. R
Enter overwrite mode. The mode display changes to
<REPLACE>. The commands available in it are:
(commands)(explanation)
* Display the help screen in the mode. Press
the'<esc>' or 'q'keys to return to the original screen.
0-9|a-f|A-F
Enter the hexadecimal value.
"{string}<ent>
* Insert the character string entered in
"string" as data.
:{decimalnumber}<ent> * Interprets the decimal number entered with
"decimalnumber" and inserts it as data.
You can select which data type (integer/floating point number, with/without sign, data length) to interpret the entered decimal number with <tab> or <shift+tab>. <tab> and <shift+tab> can be used even while entering a numerical value. (The first character is a colon':'.) #{binarynumber}<ent> * Interprets the binary number entered with
"binarynumber" and inserts it as data.
You can select which data type (integer/floating point number, with/without sign, data length) to interpret the entered binary number with <tab> or <shift+tab>. :set decimalview must be set. h|^H|<bs> Cancellation, retreat.
^L * Redisplay the screen.
<esc> Exit the mode.
x|<del> Deletes 1 byte at the cursor position. X Deletes the 1 byte before the cursor position. rHH Set 1 byte of data at the cursor position to HH. y{motion} Copy the data from the current position to the location
you move with motion.
yy|Y Copy the current line of data. d{motion} Deletes the data from the current position to the
location moved by motion.
dd Delete the current line of data. D Delete the data from the cursor position to the end of
the line.
p Insert the copied or deleted data just after the cursor
position.
P Insert the copied or deleted data just before the cursor
position.
. Repeat the last editing command. :i {start address},{end address},{destination address}<ent> * Copy the data from {start address} to {end address} and
insert it into {destination address}. {Destination address} must be outside
{start address} to {end address}. The range includes {start address} but not
includes {end address}. Refer to 7.1 and 7.3. Below for how to enter the
address.
:d {start address},{end address}<ent> * Delete the data from the start address to the end
address. The specified range includes {start address} but not includes {end
address}. For the input method of the address, refer to 7.1 and 7.3.
u For commands that change the contents of the buffer, undo
the changes. There is no limit to the number of times.
^R For commands that change the contents of the buffer, redo
the retroactive changes with undo. There is no limit to the number of
times.
Exit the editor. Export only if the file has been
modified.
ZQ Exit the editor without exporting.
:w [{altname}]<ent>
Export to a file. The editor will continue editing. If
altname is specified, export to altname instead of the original file.
:w! [{altname}]<ent> Force export to a file. The editor will continue
editing.
:q<ent> Cancel edit + Exit editor. If there is a change in the
file, it will only give a warning to that effect and will not exit.
:q!<ent> Cancel edit + Exit editor. Exit without checking for file
changes. Same as ZQ.
:wq [{altname}]<ent> Export to file + end. If export fails, it will not
end.
:wq! [{altname}]<ent> Export to file + Finish.
* Calculates a formula and displays the result. Addition,
subtraction, multiplication, division and remainder calculation of integers
(hexadecimal, decimal, octal, binary) can be performed. Parentheses can also
be used. See 7.3 for how to write integers.
:!{command}<ent>
Start a shell and execute command. Enter the <ent>
key etc. to return to the original screen.
:bytemap<ent> * Switch the screen to display the data in a graphical
bytemap view. The commands available in it are:
(commads)(explanation)^F/^B|^D/^U|^E/^Y|j/k|^N/^P|<pgdn>|<pgup>|<down>|<up> Scroll the display.
+/-
Increases / decreases the number of bytes displayed on
one line.
(/)
Rotate the data column displayed in one row to the left /
right.
<tab>/<shift+tab>
Switch between the following modes. -Mode to display 0x00 as a blue dots -Mode to display 0x01-0x1f with a light blue dots -Mode to display 0x20-0x7f with a red dots -Mode to display 0x80-0xff with black dots Redisplay the screen.
q|<esc>
Exits the bytemap view and returns to the dump
screen.
g
Exits the bytemap view and returns to the dump screen,
jumping to the address in the top left of the view.
:bitmap<ent> * Switch the screen to display the data in a graphical
bitmap view. The commands available in it are:
(commads)(explanation)^F/^B|^D/^U|^E/^Y|j/k|^N/^P|<pgdn>|<pgup> Scroll the display.
+/-
Increases / decreases the number of bytes displayed on
one line.
(/)
Rotate the data column displayed in one row to the left /
right.
</>
If the number of bytes displayed on one line exceeds the
width of the screen, the screen is shifted left or right.
zt/zz/zb
Moves the line with the cursor to the top / center /
bottom line
z<ent>/z./z-
Moves the line where the cursor is to the top / center /
bottom line, and the cursor moves to the left end.
j/k|h/l|H/M/L|0/$|^H|<bs>|<left>|<right>|<down>|<up>
Move the cursor.
U Flip the image upside down.
W Inverts the black and white of the image. s/r Set / reset 1-bit data at the cursor location. u Undo 1-bit set, reset. ^R Redo 1-bit set, reset. ^L Redraw the screen. q|<esc> Exit the bitmap view and jump to the address where the
cursor is currently displaying.
* Displays a sample of the 256 colors that can be used in
the editor. The color number of each color shown here can be used with the
':set color' commoand or in the ~/.hxavirc file. The 256 ANSI standard colors
that are thought to be available on most terminals these days are sorted in
the HSV color space rather than the usual RGB, so it should be easy to find
the color you're looking for.
Less(1) is used for display, so you can search for numbers. Exit the display with 'q' or ':q'. :file [{newname}]<ent> Rename the file to newname. This name will be used when
saving the file from now on. If newname is not specified, the current file
name will be displayed (same as ^ G).
:help<ent> * Switch the screen to display the list of commands.
Scroll by typing'j','k', and return to the original screen by typing
the'q'key.
:histogram<ent> * Switch the screen and display the distribution of data
values (0x00 to 0xff) in a graphical histogram. The commands that can be used
in it are as follows.
(commands)(explanation) h/l Moves the histogram left/right. j/k Enlarges/reduces the vertical axis. q|<esc> Ends the histogram display. :logo<ent>
:man<ent>
:set<ent> or
Shows a list of current values for options that can be
specified with ":set".
:set ambiwidth[=(single|double)]<ent> Among UTF-8 characters, characters whose width is
ambiguous are displayed in half-width/full-width. Double is appropriate when
using in Japanese. If the parameter is omitted, the current setting value Is
displayed.
:set biblen[=N]<ent> * Specifies the cursor Blinking Interval in milliseconds
on the Bitmap displayed by the: bi[tmap] command.
:set bidlen[=N]<ent> * Specifies the cursor Blinking Interval in milliseconds
on the Dump screen.
:set bytes[=N]<ent> * Change the number of bytes displayed on one line of the
dump list to N bytes. The minimum value is 4. If you omit the parameter, the
number of bytes in the current dump list is displayed.
:set cmdenter[=commands]<ent> * Sepcify the command you want to execute when you enter
the command line. it is intended to control IME.
:set cmdleave[=commands]<ent> * Specify the command to be executed when exiting the
command line. It is intended to control IME.
:set color<ent> * This shows the current settings for the editor's color
usage. Colors are used in bitmap, bytemap, histogram, logo, marks on dumplist,
and search highlights. If the terminal has color capabilities, it shows the
color swatches for each color directly.
:set color {place} {part}=N<ent> * Updates the editor color setting to N. The following
list shows where {place} and {part} can be used.
bitmap scale :Bitmap scale color bitmap data :Bitmap data color bytemap scale :Bytemap scale color bytemap zero :Bytemap data color at 0x00 bytemap ctrl :Bytemap color at 0x01-0x1F,0x7F bytemap ascii :Bytemap color at 0x20-0x7E bytemap high :Bytemap color at 0x80-0xFF histogram scale :Histogram scale color histogram data :Histogram data color logo letter :Logo text color logo cat :Logo cat color dump mark :Mark color added with the mx comand search hl :Search highlihgt colorN specifies the color number of one of the 256 ANSI standard colors. Each {place} {part} can be abbreviated as long as it remains distinct. For example, However, since you cannnot use the :cmap color sample while entering the settings, this interface can be difficult to use. Therefore, it is better to enter the settings in ~/.hxavirc with a text editor while viewing the colors in :cmap. :set [no]decimalview<ent> * The numerical value obtained by interpreting the data
at the cursor position in multiple data formats and data length is displayed
in decimal.
Display types are 8-bit unsigned integer(U08), signed integer(S08), 16-bit unsigned integer(U16), signed integer(S16), 32-bit unsigned integer(U32), signed integer(S32), 64-bit unsigned integer(U64), signed integer(S64), 32-bit floating point number(F32), 64-bit floating point number(D64), 80-bit floating point number(L80). The result of bit representation of any of the above data is also displayed. Which data to display can be selected by pressing the <tab> key or <shift+tab> key. :set encoding[={name}]<ent> Specifies the encoding that interprets the data when
displaying characters. If the parameter is omitted, the current settings and a
list of selectable encodings are displayed.
The supported encoding names and their abbreviations are as follows: utf-8 (u) euc-jis-2004 (e) shift_jis-2004 (s) iso-2022-jp-2004 (j) iso-8859-1 (i) utf-16le (ul) utf-16be (ub) :set endian[=(little|big)]<ent> * Specifies the endianness when interpreting the data
with decimalview.
:set [no]flash<ent> * Specifies whether to flip the screen momentarily to
warn (visible bell) when an impossible action is performed.
:set helplang[=(ja_JP|en_US|...)]<ent> Select the display language for help and messages. If you
omit the parameter, the current settings and a list of selectable languages
are displayed.
:set [no]hideescseq<ent> When displaying characters in iso-2022-jp-2004, it is
easier to read the dump list if the escape sequence part is not displayed as
characters. By setting this option, the data in the escape sequence part will
be displayed as blank.
:set hxaviend[=commands]<ent> * Specify the command to be executed when hxavi is
terminated. It is intended to control IME.
:set lines[=N]<ent> Change the display area of the dump list to N lines. The
minimum value is 3. If you omit the parameter, the current number of rows in
the dump list is displayed.
:set ttimeoutlen[=N]<ent> When a special key input is performed and an escape
sequence occurs, the time to wait for its completion is specified in
milliseconds.
:set [no]usecolor<ent> * Specifies whether to use color for highlighting search
results and displaying bitmaps and histograms.
:set [no]wrapscan<ent> When searching for a pattern, specify whether to continue
the search beyond the end or beginning of the file.
7.MISCELLANEOUS
- If you do not specify a register, the copied or deleted data will be in the anonymous register. When you paste the data, you do not need to specify the register.
- If you specify a register, the copied or deleted data will be stored in the named register as well as the anonymous register. After that, the data in the named register will be saved even if you edit file by inserting or deleting.
ENVIRONMENTSTerminal encoding is UTF-8 only. The recommended environment variable for TERM is "xterm-256color". FILES(FreeBSD)
(Linux)
VERSIONThe version is displayed when started only with the command name hxavi. SEE ALSOvi(1), vim(1), less(1), ncurses(3) BUGS
AUTHOR"Michihiro Satoh", <satoumc(at_sign)hxavi.net>
COPYRIGHTIt is provided under the BSD 2-Clause License.
|