Project

General

Profile

Actions

Feature #1259

closed

developer tool for doing byte/bit level compares

Added by Jens Jensen almost 11 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
11/20/2013
Due date:
% Done:

90%

Estimated time:
3:00 h
Chirp Version:
daily
Model affected:
(All models)
I read the instructions above:

Description

developer tool for comparing images

Actions #1

Updated by Jens Jensen almost 11 years ago

Here is bitdiff.py (originally named bincmp.py), a tool for doing byte/bit comparison of two files, with the focus on radio images/savefiles.

I have added an option that will parse .DAT files (i.e., the ones that baofeng/baojie, et al oem software output),
as well as a facility to log to csv file, hopefully making it easier to iterate through oem software changes while mapping out memories.

I'm envisioning even making this a process where a non-developer can help with the task of mapping some of this stuff out, as it's usually just a tedious process with out much in-depth technical work, e.g., make a change and save the file (or download the image); rinse and repeat N-dozen times...

hackpro:chirp.hg jens$ tools/bitdiff.py -h
usage: bitdiff.py [-h] [-o OFFSET | -d] [-w] [-c CSV] [-s SETTING] [-v VALUE]
                  file1 file2

byte-/bit- comparison of two files

positional arguments:
  file1                 first (reference) file to parse
  file2                 second file to parse

optional arguments:
  -h, --help            show this help message and exit
  -o OFFSET, --offset OFFSET
                        offset (hex) to start comparison
  -d, --dat             process input files from .DAT format (from 'jujumao'
                        oem programming software for chinese radios)
  -w, --watch           'watch' changes. runs in a loop

csv output:
  -c CSV, --csv CSV     file to append csv results. format: filename1,
                        filename2, byte_offset, byte1, bits1, byte2, bits2,
                        item_msg, value_msg
  -s SETTING, --setting SETTING
                        user-meaningful field indicating setting/item
                        modified, e.g. 'beep' or 'txtone'
  -v VALUE, --value VALUE
                        user-meaningful field indicating values changed, e.g.
                        'true->false' or '110.9->100.0'

hackpro:build jens$ chirp.hg/tools/bitdiff.py --dat --csv foo.csv --setting "squelch" --value "6->7" 1.dat 2.dat 
1: 1.dat  2: 2.dat
setting: squelch value: 6->7
@0F0Ah
1:06h, 00000110b
2:07h, 00000111b
bytes read: 7936

hackpro:build jens$ cat foo.csv 
filename1, filename2, byte_offset, byte1, bits1, byte2, bits2, item_msg, value_msg
1.dat, 2.dat, 0F0A, 06, 00000110, 07, 00000111, squelch, 6->7
Actions #2

Updated by Bernhard Hailer over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF