[ale] OT: hexing files
Charles Shapiro
cshapiro at nubridges.com
Tue Oct 14 09:24:14 EDT 2003
Uh, I wrote a simple little filter program that allows you to do just
this called "hex". It's about 200 lines of C code. I can tar it up and
post it on the TWiki if folks are interested.
Run it against a file and it produces a hex dump of the file with the
text (or dots for non-printing characters) running down the RH side.
You can view and edit the hex dump in an ordinary ASCII editor, then use
the same filter to read the dump back into its binary file.
Hence, the command:
hex -i < hex | hex -o > hex.out
Is almost a quine, since the file "hex.out" will be identical to its
input. I tested the program by making "hex.out" executable and running
it.
A true quine, of course, is a program which produces its own source
code as its output. A good bash quine, courtesy of Mark Wooding at the
quines page, is:
#! /bin/sh
q="'" qq='echo \#! /bin/sh;echo q=\"$q\" qq=${q}$qq$q;echo eval \$qq'
eval $qq
Writing or disseminating this program is not technically a violation of
the DMCA because it has uses other than circumventing copy protection,
although you could use it for that. I wouldn't know if you did though.
-- CHS
On Mon, 2003-10-13 at 23:08, Stephen Turner wrote:
> hey forgive my ignorance i havent been able to get into hex editing or
> assembly but cant you hex edit a file to ignor the registration code? for
> say those files you for some reason dont want to register or dont have a
> code to? >:)
>
> =====
> ** computers are a lot like air conditioners, they stop working properly once you open windows **
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list