vche is a hex editor and viewer which lets you see all the 256
characters, as found in video ROM.
It uses the /dev/vcs[1-63] and /dev/vcsa[0-63] character
devices to do all it's screen I/O. So this version will
run only on Linux on a local console, and not under X or
remote sessions.
vche-nc It is the NCURSES version, it will use that library to
do all the screen I/O, so it will not show non-printable
ASCII.
vche-raw It is the Run AnyWhere version (or RAW version, his name
is twofold), it does all the screen I/O using the linux
console escape and control sequences, for more information
see the
console_codes(4) man page.
Flags There are six flags, each one shows the current program state and
the behavior
vche
will have. See
vche.conf(5) for a complete description.
Bit operations When you are in edit mode you can press
F3 to set the edit mask. The
"edit mask" is a mask used in bit operations. If you want, for example,
to XOR some bytes, the value used to XOR that bytes is
the
"edit mask" . The bit operations are:
"XOR"
Do a XOR on the byte at cursor position with the value
set in the edit mask.
"OR"
Do an OR.
"AND"
Do an AND.
"NEG"
Negates the bytes at cursor position.
"ADD and SUB"
Adds or substract 1 from the bytes you want.
You could enter the
"edit mask" as a decimal or as hex number, prefixing a "0x" to it (like in C).
Miscellaneous If you provided more than one filename at the command line, you
could view or edit any of them easily using the commands:
n to go to the next file and
p to go to the previous file.
You could also press
F7 to browse the list of files and select one manually, moving with
the arrow keys.
COMMANDS
"c-c"
Control-C, kills the program. (use it if you are in trouble).
The keys have different meanings if you are in view or
edit mode:
View mode
"q, F10"
Quits the program.
"?, h, H, F1"
Shows a helpless help.
"w"
Toggle read-write/read-only mode.
"b"
Toggle bell flag.
"n"
Open the next file (if any).
"p"
Open the previous file (if any).
"F7"
Select another file manually from the file list given at the
command line.
"e, F2"
Enter edit mode.
"x, F3"
Toggle hex window viewing.
"s, F4"
Search a string taking care of case. (Prefix a "0x" to enter the string
in hexadecimal).
"S"
Search a string ignoring case.
"SPACE, F5"
Search again.
"r"
Redraw the screen, it is needed when other process writes to the
current tty and the screen gets corrupted. It is also useful when
viewing files or devices whose contents change.
"R"
Refresh file size, use it if the size of the file changes during
viewing, by any reason.
"m"
Toggle non-printable character mask.
"0"
Toggle zero mask.
"g, F6"
Seek to an offset (to enter an hexadecimal offset you must
prefix it with a "0x").
"F8"
Shows you the ascii table (as found in character ROM), shows also
in hex, octal, decimal and binary.
"F9"
Shows GNU GPL (General Public License).
"HOME KEY"
Go to the beginning of the file.
"END KEY"
Go to the end of the file.
"LEFT KEY"
Go back a byte.
"RIGHT KEY"
Go forward a byte.
"UP KEY"
Go back a line.
"DOWN KEY"
Go forward a line.
"PGUP KEY"
Go back a page.
"PGDN KEY"
Go forward a page.
Edit mode
"TAB KEY"
Switch beetwen HEX and ASCII editing.
"F2"
Save changes (if any).
"F3"
Set the edit mask (needed for XOR, OR and AND operations).
"F4"
Do a XOR.
"F5"
Do an OR.
"F6"
Do an AND.
"F7"
Negates the byte at cursor position.
"F8"
Add 1 to the byte at the cursor position.
"F9"
Substract 1.
"F10"
Abort changes made.
"HOME KEY"
Go to the beginning of the file.
"END KEY"
Go to the end of the file.
"LEFT KEY"
Move the cursor to the left.
"RIGHT KEY"
Move the cursor to the right.
"UP KEY"
Move the cursor up.
"DOWN KEY"
Move the cursor down.
"PGUP KEY"
Go back a page.
"PGDN KEY"
Go forward a page.
VIEWING DEVICES
As with regular files you can also view or edit devices. Since there is no
standard way to get the size of a device, each time you change the read-only
flag, open or refresh the size of a device,
vche will pop up a menu where you have to select the way the program
will get his size, the three available options are:
"Ask kernel"
This option will use Linux kernel ioctls to get the size of the device.
Not all devices provide with such ioctl(2) calls, so, if you select this
option and the ioctl fails, the file size will be set to LONG_MAX, or to
2147483647 if LONG_MAX is not defined, and an error message will be issued.
You should use this option with IDE, SCSI, loop and with any device which
support the BLKGETSIZE or FDGETPRM ioctl call.
"Let vche guess it"
If you select this option, to find the device size, the program will lseek(2)
to different offsets doing a binary search until the lseek call fails. It
works with almost any device, it is used mainly with RAM, kernel memory or
other character devices, but you could use it with anything if you are in
doubt. As with the
Ask kernel option the device size can not be greater than a signed long (LONG_MAX),
because it is the maximal value the lseek(2) call could handle.
"Enter it manually"
This option will let you enter whatever device size you want, once you
entered it the device will look as the desired size, you can not see or
edit beyond that offset. To change the offset simply refresh the file
size with the
R command.