# 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](https://github.com/tanepiper/game-frame/blob/main/tools/triage/compare_trees.py).

## 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]

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).
```

## Named by

Skills: [re-inventory](/skills/re-inventory).
