[chirp_devel] little utility to watch and print binary changes to files
Here is a quick and dirty "binary diff watcher" to show hex and binary differences and the offsets of two files.
The general idea is to take control sample image file, and then edit a second copy of it in whatever program so that you can see what is getting twiddled.
This is a little bit faster cycle than looking at in a hex editor.
If we can refine this a bit and make it more useful, perhaps it's worthy of committing to tools folder...
-Jens AF5MI
usage: bincmp.py [--offset <start_at_hex_offset>] [--watch] -1 <file1> -2 <file2>
example: $./bincmp.py -1 ft90-test.img -2 ft90-test2.img 1: ft90-test.img 2: ft90-test2.img @0105h 1:41h, 01000001b 2:44h, 01000100b @010Fh 1:00h, 00000000b 2:33h, 00110011b bytes read: 4063
While we're sharing, here's the script I use for the same purpose. It outputs hex and ASCII bytes rather than bits.
#!/bin/sh
hexdump -C $1 > /tmp/$1.hexdump hexdump -C $2 > /tmp/$2.hexdump diff /tmp/$1.hexdump /tmp/$2.hexdump | less rm /tmp/$1.hexdump /tmp/$2.hexdump
Usage: ./hexdiff.sh original.img changed.img
Tom KD7LXL
Here is a quick and dirty "binary diff watcher" to show hex and binary differences and the offsets of two files.
vbindiff works pretty well also.
I use some scripts that diff the "hexdump -C" output of two files, which I find really helpful because I can see the context around the things that are changing. I've been meaning to get those into the tree as well, but they're super hacky and need at least a usage statement.
Cool, yeah I was looking for something I can run cross-platform, although I'll admit so far I have only tested this on linux. It's intended usage is on Windows ;)
I had tried some others - i think vbindiff was one - but didnt like it cause it wouldnt show me bits. Yaesu loves memory conservation especially in settings area ;)
On Thursday, October 31, 2013 5:55 PM, Dan Smith dsmith@danplanet.com wrote:
Here is a quick and dirty "binary diff watcher" to show hex and binary differences and the offsets of two files.
vbindiff works pretty well also.
I use some scripts that diff the "hexdump -C" output of two files, which I find really helpful because I can see the context around the things that are changing. I've been meaning to get those into the tree as well, but they're super hacky and need at least a usage statement.
participants (3)
-
Dan Smith
-
Jens J.
-
Tom Hayward