bin2file

After writing bindump I thought: "Ok... and now?"
Now I have the opportunity to redirect bindump's output in a text file and _manage every single bit_ of _every file_.

But... after having modified the bits of the text file, what could I do with them?
Actually nothing! |-:
So the second step starts: bin2file.

Bin2file takes in input a sequence of bits and it writes the sequence (byte per byte) in a new file (specified with -w flag before). The new file is opened in append mode, this will be useful later.
The bit's sequence is read in little-endian byte order (mind it!).

Let's make an example. At first I use bindump on a file, then I extract bits and I send them into bin2file to recreate the identical file:

eddy22@lisbeth:~/myprog/bindump$ md5sum lena.bmp 
866bc20f9bbcfbdd038d0e3af0b0cfeb  lena.bmp
eddy22@lisbeth:~/myprog/bindump$ sha1sum lena.bmp 
480bbcf4e62533f7b218587d72bf1d66ef99f060  lena.bmp
eddy22@lisbeth:~/myprog/bindump$ ./bindump lena.bmp | cut -c10-80 | xargs ./bin2file
-w new_lena.bmp
eddy22@lisbeth:~/myprog/bindump$ md5sum new_lena.bmp 
866bc20f9bbcfbdd038d0e3af0b0cfeb  new_lena.bmp
eddy22@lisbeth:~/myprog/bindump$ sha1sum new_lena.bmp 
480bbcf4e62533f7b218587d72bf1d66ef99f060  new_lena.bmp

Now I modify "on the fly" each bit by 0 to 1 from 200000's bytes to 299999, from 400000 to 499999 and from 600000 to 699999.
In RGB the value 11111111 11111111 11111111 is white.

eddy22@lisbeth:~/myprog/bindump$ ./bindump lena.bmp | sed -e '/^00[246]..... /s/0/1/g' |
cut -c10-80 | xargs ./bin2file -w lena01.bmp

the result is:

Lena 01

In the next example I change each bit by 0 to 1 and viceversa from 200KB to 600KB:

eddy22@lisbeth:~/myprog/bindump$ ./bindump lena.bmp | sed -e '/^00[2-6]..... /y/01/10/' |
cut -c10-80 | xargs ./bin2file -w lena02.bmp

Lena 02

Other funny things with bindump and bin2file caming soon on this site! (-:

Hey, your site is really

Hey, your site is really great, I came across while in search for brand info on bing and it has lots of related information on it. Will be sure to come back again and bookmark. Keep up the great work! =-=

TTssEAqfuwCNiJxBs

took me a while to browse all the nmmoects, but I really enjoyed the subject that you chose. It looked to be very helpful to me and I am sure to all the other people who have looked at this blog, It's always nice when your not only informed, but your also entertained! I'm positive you had fun writing this article. I'm going to grab your rss feed so I don't miss anything important that you guys may come up with in the future, Thanks..