compare_trees
Tool
tools/triage/compare_trees.py(program, Triage). Compare two copies of a game file by file: are two releases (a CD, a GOG or Steam copy, a patch) the same program and the same data?
Run it with ./gameframe run compare_trees ARGS or python3 tools/triage/compare_trees.py. Source on GitHub.
Its own help
This is the help text in the tool itself, as ./gameframe tool compare_trees prints it.
text
Compare two copies of a game file by file: are two releases (a CD, a GOG or Steam copy, a
patch) the same program and the same data?
Usage: compare_trees.py DIR_A DIR_B [--all] [--hashes] [--similar]
Files are matched by path, ignoring case (DOS and Windows names are case-insensitive), and
compared by SHA-256. Prints the files that differ (with both sizes), the files only in one
copy, and a summary. `--all` also lists identical files; `--hashes` prints "sha256 path" for
every file of DIR_A (publishable: hashes are not game material, and they pin down which
version a finding was made on).
Use it before choosing which copy to reverse engineer: identical code means findings carry
over; a different executable means a different version, with its own addresses.
It does not look inside archives or installers (extract them first with
scripts/extract-installer.sh).
`--similar` also scores how much of each differing file is shared (0 to 100 %). It pairs each
file found only in A with the most similar file only in B, which finds renamed or moved
files. The score cuts each file into pieces at points chosen by its content (a rolling hash),
the method of fuzzy hashes such as ssdeep. A change in one place then changes only the pieces
around it, even when bytes were inserted. Files over 64 MB are not scored.Named by
Skills: re-inventory.