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.
35 lines
1.4 KiB
JSON
35 lines
1.4 KiB
JSON
// Make the resource archive signature check return success.
|
|
// Why the executable: rebuilt archives cannot carry a Gaijin signature and are refused at mount time.
|
|
// Without it: the rebuilt char.vromfs.bin is not mounted and the client never learns the local addresses.
|
|
{
|
|
"id": "startup/skip-resource-archive-signature-check",
|
|
"title": "让资源包签名校验直接返回通过",
|
|
"features": [
|
|
"A-Offline startup"
|
|
],
|
|
"requires": [],
|
|
"variants": [
|
|
// First 0x60 bytes of the function, masked; a shorter prologue matches dozens of functions.
|
|
// Contains the "VRFx" archive magic comparison (56 52 46 78), a stable semantic anchor.
|
|
// Fallback: the first 0x40 bytes are also unique on 2.61.0.37; try them first if this pattern stops matching.
|
|
// 2.61.0.37: unique hit at 0x4073d30 (function 0x4073d30-0x407497d).
|
|
{
|
|
"written_for": "2.61.0.37",
|
|
"locate": {
|
|
"method": "signature",
|
|
"section": ".text",
|
|
"pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec 68 01 00 00 0f 29 b4 24 50 01 00 00 48 8b 7a 40 48 85 ff 74 ?? 8b 5a 48 85 db 74 ?? 8b 42 08 83 f8 10 73 ?? 31 c0 0f 28 b4 24 50 01 00 00 48 81 c4 68 01 00 00 5b 5d 5f 5e 41 5c 41 5d 41 5e 41 5f c3 48 89 ce 4c 8b 32 41 81 3e 56 52 46 78 75 ??"
|
|
},
|
|
"edit": {
|
|
"offset": 0,
|
|
"asm": [
|
|
"mov al, 1",
|
|
"ret"
|
|
],
|
|
"bytes": "b0 01 c3",
|
|
"expect_original": "41 57 41"
|
|
}
|
|
}
|
|
]
|
|
}
|