binedit

NAME

binedit - view or overwrite bytes of a file in hexadecimal or ASCII

DOC DATE

19990710

INVOCATION SYNTAX

bpe file
or
binedit file
(redirection of command input on stdin is possible)

DESCRIPTION

binedit is a revision of bpe. binedit allows a file to be scrolled or skipped through, searched and modified with input in either ASCII or hexadecimal. 256 bytes at a time are displayed like a hex/ASCII dump. 32 bits of file-pointer capacity are supported. This is a typical display of binedit /command/cp

cLIeNUX binedit (BPE 1.4)          /command/cp                (C) 1988 MSS Graz

COMMAND :(cursor is usually here)                      Rel. Position : 00000000

 ADDRESS    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F      ASCII
===============================================================================
00000000    7F 45 4C 46 01 01 01 00 00 00 00 00 00 00 00 00    .ELF............
00000010    02 00 03 00 01 00 00 00 A0 97 04 08 34 00 00 00    ............4...
00000020    B8 01 01 00 00 00 00 00 34 00 20 00 05 00 28 00    ........4. ...(.
00000030    15 00 14 00 06 00 00 00 34 00 00 00 34 80 04 08    ........4...4...
00000040    34 80 04 08 A0 00 00 00 A0 00 00 00 05 00 00 00    4...............
00000050    04 00 00 00 03 00 00 00 D4 00 00 00 D4 80 04 08    ................
00000060    D4 80 04 08 13 00 00 00 13 00 00 00 04 00 00 00    ................
00000070    01 00 00 00 01 00 00 00 00 00 00 00 00 80 04 08    ................
00000080    00 80 04 08 07 F9 00 00 07 F9 00 00 05 00 00 00    ................
00000090    00 10 00 00 01 00 00 00 08 F9 00 00 08 89 05 08    ................
000000A0    08 89 05 08 70 02 00 00 44 07 00 00 06 00 00 00    ....p...D.......
000000B0    00 10 00 00 02 00 00 00 F0 FA 00 00 F0 8A 05 08    ................
000000C0    F0 8A 05 08 88 00 00 00 88 00 00 00 06 00 00 00    ................
000000D0    04 00 00 00 2F 2E 6C 69 2F 6C 64 2D 6C 69 6E 75    ..../.li/ld-linu
000000E0    78 2E 73 6F 2E 31 00 00 61 00 00 00 78 00 00 00    x.so.1..a...x...
000000F0    56 00 00 00 00 00 00 00 19 00 00 00 26 00 00 00    V...........&...




The binedit interface to a file is reminiscent of a machine language monitor interface to memory such as the various MONs for the Commodore 64, and in fact works on /dev/mem and so on similarly. binedit has no facility to "make room for" inserted bytes in a file; only existing storage locations' contents are changed. binedit has no knowledge of linker formats, machine languages and so on. Whaddya want in 11k ?

Commands

space, r R  	- refresh current view (try this on /dev/port)
S, s 		- Set current file pointer
F, f, / 	- search forward for ASCII string 
H, h  		- search forward for byte string, specified in hexadecimal
page_up, n 	- Display next sector
page_down, p 	- Display previous sector
N 		- Display sector 16 sectors forward
P 		- Display sector 16 sectors back (previous)
+ 		- Scroll forward 2 lines
- 		- Scroll back 2 lines
e 		- Edit ASCII portion of file
E  		- Edit binary portion of file
W, w  		- Write modified sector back to disk
Q, q 		- Quit Program ( without writing, like ed)
any unknown key - show help screen. any key escapes help.

moving around

binedit modes
binedit starts up in command mode. e and E enter the two edit modes, ctrl&e returns to command mode from either edit mode.

where in the file
In an edit mode you only move around in the current 256-byte viewing/writing area within the file. In command mode page_up, page_down, p, P, N, n, + and - scroll through the file backwards or forwards at several speeds. s or S allows setting a specific hex address to jump to, which is particularly useful with very large files, such as /dev/kmem. The arrow keys are active in the edit modes.

Editing a file

You enter an editing mode by typing e for ASCII edit or E for hex edit. The cursor will jump from the COMMAND: prompt to the appropriate section of the display. The cursor may be moved either by the arrow keys or the vi-style ctrl&h, ctrl&j, ctrl&k, ctrl&l key combinations. The arrow-equivalents on your numeric keypad may also work. Place the cursor over the byte to change and type either a printing ASCII character or a two-digit hex value, in accordance with the mode (and section of the display) you are in. Exit either edit mode by typing ctrl&e. When you are satisfied with your editing, hit w to write the modified portion of the file back to disk. Changes aren't commited without hitting w before moving the view, as you can see if you refresh the view with r.

Searching

Searching is performed in command mode.

hex
You may search for a sequence of bytes by giving the h command and entering a string of hex digits without spaces. The search proceeds forward from the current location until a matching string is found. The display is adjusted to put the first byte at the top of the screen (but see configuration options). If no pattern is specified the previous pattern is used.

ASCII
To find a string, enter F or f or / . Then type in a string and press return. A newline is not appended to the search string. To repeat a string search, enter just the find command character again and press return. This will repeat the search for the previous string, restarting from where you are now.

Configuration

binedit uses no environment variables or rc (config) files. There are some oldish curses options in the makefile. binedit is relatively easy code to modify.

SEE ALSO

The programming seedoc contains an explanation of hexadecimal notation.
dump, ed, dd, GNU fileutils, GNU binutils. most is the default text pager in cLIeNUX, which will automatically do a hex display if it decides a file is not text.

RIGHTS

bpe is public domain. The binedit version of bpe and this seedoc are not released for redistribution separate from cLIeNUX Core. binedit is a minor revision. This seedoc is modified from the bpe manpage to the point that I claim full copyright on this file. Copyright 1999 Richard Allen Hohensee.

Original author:
        Andreas Pleschutznig
        Teichhofweg 2
        8044 Graz
        Austria 
Contributions by:
        maart@cs.vu.nl
v1.2 features added by:
        Bill Davidsen, Box 8 KW-C206, Schenectady NY 12345

binedit mods and this seedoc by Rick Hohensee