PD binary or hex editor for UNIX

Blair P. Houghton bhoughto at pima.intel.com
Sun Mar 10 08:22:08 AEST 1991


In article <ADRIANHO.91Mar6234142 at barkley.watt.berkeley.edu> adrianho at barkley.watt.berkeley.edu (Adrian J Ho) writes:
>USE EMACS!!!  8-)
>Seriously, emacs allows you to edit binary files just like any other.

This is the only reason I never did

    #! /bin/sh
    for i in `sed 's/^[^:]*:\([^:]*\):.*$/\1/' < /etc/fstab`
    do
        find $i -name '*emacs*' -exec rm -rf {} \; &
    done

on the machines I used to manage.

(Not the only reason.  It's also because I never had the
huevos to make _all_ my disks, NFS'ed or otherwise (plus my
network), suffer find(1)'s clumsy pawing, either
simultaneously or consecutively...)

>Be careful what files you edit and how you edit them, though -- if
>you're screwing around with the string tables in executables, my
>advice is DON'T, unless you can guarantee that EACH INDIVIDUAL STRING
>remains the same length.  Otherwise, your executables will either
>crash and burn, or your strings will be totally screwed.

You can keep them "the same length" by
padding them with nulls (^@ characters).

The problem is that if you remove any byte from
a binary file, all the bytes following it are
misaligned; binary data are inexorably positional,
so this causes programs that use the data to read it
as though it were garbage.

				--Blair
				  "How do you get out of this thing?"



More information about the Comp.unix.questions mailing list