A game update used to fail a patch whenever any byte it compared moved, even when only an address in the instruction changed. Patch definitions now say what a change needs and read the rest from the code: - patch.jsonc holds a list of variants, each written for one game build (written_for) with its own locate block and edit; locate.jsonc is merged into it. Exactly one variant must apply, otherwise the patch is left out. GUI script patches use the same variants rule. - expect_original and the bytes to write use the signature syntax, so addresses that differ between builds can be wildcards. - A locate block can capture values at the site (rel32 targets, immediates, displacements); a rel32 fixup fills a hole in the written bytes from a capture. allow-local-host-bot-spawns now jumps to the target of the conditional jump it replaces instead of a stored distance, which makes it apply to 2.61.0.43 as well. - verified_on is gone from the definitions. patches/versions/<version>.jsonc records, per checked game build, which variant of every patch applies and where; scripts/record-game-version.ts writes it and the launcher reads the recorded versions from there. The Python tools (check-patches, patch-exe, check-gui) read the same format; check-patches assembles a variant whose assembly names captures at the site it was located at. Checked: root and launcher type checks; check-patches and check-gui on 2.61.0.37 and 2.61.0.43 (12 exe and 35 GUI patches each); check-patches and check-gui report a deliberately broken patch with a non-zero exit; build-game-copy from 2.61.0.43 into a temporary folder. The computed bytes of allow-local-host-bot-spawns on 2.61.0.37 equal the bytes it stored before. BREAKING CHANGE: Each patch needs a variants list. Move executable locators into patch.jsonc and regenerate game version records with record-game-version.ts.
33 lines
1.4 KiB
JSON
33 lines
1.4 KiB
JSON
// Use HKCU\Software\WTOffline instead of Software\Gaijin\WarThunder.
|
|
// Why the executable: the registry path is a constant in the game identity table.
|
|
// Without it: the offline login reads and overwrites the retail client's saved credentials.
|
|
{
|
|
"id": "isolation/registry-key",
|
|
"title": "把注册表位置从 Software\\Gaijin\\WarThunder 改成 Software\\WTOffline,不碰正版保存的登录信息",
|
|
"features": [
|
|
"A-Isolation from the official game"
|
|
],
|
|
"requires": [],
|
|
"variants": [
|
|
// The wide string L"Software\Gaijin\WarThunder" with its terminating zero, 54 bytes.
|
|
// 2.61.0.37: unique hit at 0x7a39c4e.
|
|
{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "signature",
|
|
"section": ".rdata",
|
|
"pattern": "53 00 6f 00 66 00 74 00 77 00 61 00 72 00 65 00 5c 00 47 00 61 00 69 00 6a 00 69 00 6e 00 5c 00 57 00 61 00 72 00 54 00 68 00 75 00 6e 00 64 00 65 00 72 00 00 00"
|
|
},
|
|
"edit": {
|
|
"offset": 0,
|
|
"data": {
|
|
"encoding": "utf-16-le",
|
|
"text": "Software\\WTOffline"
|
|
},
|
|
"bytes": "53 00 6f 00 66 00 74 00 77 00 61 00 72 00 65 00 5c 00 57 00 54 00 4f 00 66 00 66 00 6c 00 69 00 6e 00 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
|
"expect_original": "53 00 6f 00 66 00 74 00 77 00 61 00 72 00 65 00 5c 00 47 00 61 00 69 00 6a 00 69 00 6e 00 5c 00 57 00 61 00 72 00 54 00 68 00 75 00 6e 00 64 00 65 00 72 00 00 00"
|
|
}
|
|
}
|
|
]
|
|
}
|