xxd: hexdump something quickly

| 1 Comment | No TrackBacks

We have all been in this situation: you have two files which are subtly different, and you need to take a quick look in them. Let me point you towards xxd which is part of vim. Users of other editors can stop reading now! :-)

dpavlin@t61p:~/t61p/utf-8-accents$ xxd good
0000000: 506f 7669 6a65 736e 6f20 6172 6865 6f6c  Povijesno arheol
0000010: 6fc5 a16b 6920 766f 6469 c48d 2070 6f20  o..ki vodi.. po 
0000020: 4f73 6f72 750a                           Osoru.
dpavlin@t61p:~/t61p/utf-8-accents$ xxd bad
0000000: 506f 7669 6a65 736e 6f20 6172 6865 6f6c  Povijesno arheol
0000010: 6f73 cc8c 6b69 2076 6f64 6963 cc8c 2070  os..ki vodic.. p
0000020: 6f20 4f73 6f72 750a                      o Osoru.

Now, if I could only find peace of perl code which puts accents back to characters...

No TrackBacks

TrackBack URL: http://blog.rot13.org/mt/mt-tb.cgi/669

1 Comment

The really great thing about xxd is that it can turn a hexdump back into a binary file. I haven't come across anything that can do that since I wrote my own utility for the Sinclair QL in 1986...

I used it just last week to turn a captured serial port U-boot session of a hexdump of a flash region back into a binary file I could flash on another board:


flinfo
md.b 0xbf000000 0x200000

clean up the captured output, write to boot.txt

sed 's/.*: \([0-9a-f ]*\).*/\1/' < boot.txt > boot.txt2
xxd -r -p boot.txt2 boot.img

Leave a comment

About this Entry

This page contains a single entry by Dobrica Pavlinušić published on December 9, 2009 7:33 PM.

HTML5TV: video archive with slide sync without plugins was the previous entry in this blog.

LDAP server application integration with virtual LDAP is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

  • pics
OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.04