Files
WT-Offline/gui-patches/inventory/local-content-public-key/patch.json
T
N0VAN0M4LY 9e759197d0 Sign external inventory responses for the offline client
Sign the inventory JSON payload using the local signing key and
provide the required signature headers. Register the corresponding
public key in the rebuilt GUI pack so the client can verify the
definitions.

Type checking, pack checks, and local signature verification passed.
In-game acceptance requires a rebuilt offline copy and restarted service.
2026-11-26 02:13:23 +08:00

33 lines
4.5 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"id": "inventory/local-content-public-key",
"title": "外部库存内容验签公钥替换为本地服务的固定公钥",
"file": "scripts/inventory/inventorycontentsign.nut",
"program_behaviour": {
"stock": "scripts/inventory/inventoryContentSign.nut 启动时把内置的 Gaijin RSA 公钥通过 inventory.addContentPublicKey(key)(aces.exe 0x459b090)注册到原生 charsq 库存客户端;inventoryClient.nut 请求 GetItemDefsClient 时开启 content_sign_check = true,原生层(0x336d590 -> 0x4e6eba0 -> 0x3c38270)用已注册公钥校验响应头 chardContentSign 与 chardContentSignHashAlgo 对原始响应体的签名。",
"patched": "保持客户端 addContentPublicKey 与 requestWithSignCheck 原生验签流程不变,将 inventoryContentSign.nut 中的公钥替换为本地服务固定密钥对(local-inventory-content.key.pem)对应的 RSA-2048 公钥,本地服务对库存 JSON 响应附带 RSA-SHA256 签名。"
},
"derivation": {
"requirement": "功能清单 G「市场」、H「补给箱」「物品回收与合成」「兑换券」。客户端必须通过原生内容签名校验接收本地服务生成的外部物品定义(GetItemDefsClient),使 233 辆交易所载具恢复市场载具状态并显示「在交易所中查找」,同时使外部库存兑换券、补给箱与回收零件定义正常生效。",
"cause": "inventoryContentSign.nut 硬编码了 Gaijin 私钥对应的 RSA 公钥,本地服务没有 Gaijin 的私钥,无法生成能通过原版公钥 EVP_VerifyFinal(0x51e3e80)校验的 chardContentSign 签名;校验失败时 0x40cc070 直接将结果替换为错误 CONTENT_SIGN_VALIDATION_FAILED 并丢弃全部物品定义。",
"lighter_options_ruled_out": [
"仅在本地服务响应头填占位签名:原生层 0x3c38270 调用 OpenSSL EVP_VerifyFinal 做真实 RSA 验签,无对应私钥返回错误码 6,仍触发 CONTENT_SIGN_VALIDATION_FAILED。",
"改 inventoryClient.nut 跳过 requestWithSignCheck 或打 exe 补丁绕过 0x40cc188:直接破坏客户端原有的验签逻辑;按匹配服务器公钥(online/matching-server-public-key,方案 A)同一原则,替换公钥并由本地服务真实签名更能原样保留客户端原生代码路径。"
],
"conclusion": "在 gui.vromfs.bin 的 scripts/inventory/inventorycontentsign.nut 将公钥替换为离线版固定 RSA-2048 公钥,本地服务用配对私钥按 chardContentSign + chardContentSignHashAlgo=SHA256 对原始响应体签名。",
"if_not_applied": "每次 GetItemDefsClient 均报 CONTENT_SIGN_VALIDATION_FAILED,客户端外部物品定义表为空,233 辆交易所载具全部退回礼包车显示且右键无「在交易所中查找」,外部库存中的兑换券、银狮补给箱和回收零件无法显示详情与正常使用。"
},
"features": ["G-市场", "H-补给箱", "H-物品回收与合成", "H-兑换券"],
"evidence": [
"2.61.0.37 gui.vromfs.bin:scripts/inventory/inventorycontentsign.nut(keys、inventory.addContentPublicKey)、scripts/inventory/inventoryclient.nut 第 276-288、468 行(requestWithSignCheck、GetItemDefsClient)。",
"2.61.0.37 aces.exe:0x459b090(addContentPublicKey -> 0x4e6e840 PEM_read_bio_PUBKEY + i2d_PUBKEY -> 0x4e6ea30)、0x336f5d0(提取响应头 chardContentSign 与 chardContentSignHashAlgo)、0x336d9ac..0x336da05 -> 0x4e6eba0 -> 0x3c38270(EVP_get_digestbyname + Base64 解码 + EVP_VerifyFinal)、0x40cc070(0x40cc188..0x40cc2e0 校验结果非 1 时报 CONTENT_SIGN_VALIDATION_FAILED)。"
],
"edit": {
"find": "-----BEGIN PUBLIC KEY-----\r\nMIIBKDANBgkqhkiG9w0BAQEFAAOCARUAMIIBEAKCAQcAy9WagPn8/uLbbPHebobA\r\nftDiwrGpi23Ed0fQsSCZfGYupBkYl3mZD3fgOMgmLSYsTqFHDe0CMTQKpHYGFfT3\r\nEuvTHKwwyo2ckpaLNI/flZysDXRuoWXvwd6FzGBx3l2/I1Yw+cAle/aWB9YZnQtX\r\nfy3j3k/fJfiv7+72Sm95h3Dg715XuBILC4vSYVqvCn+UlQyrJkAZrIahWR9Gzsm6\r\novxSaduvosn83Hx1ZixD+U5wcn1hoTT0niwnrqiPuEUV3wC887JIR4KzMXYpyzvF\r\nnEhlqTKoGN7oGS7vqN4tCH6/l3hAomxfVGT+5UHGugQEauNqccYq44Hfu3t3tY1r\r\nj+eTYc35NQIDAQAB\r\n-----END PUBLIC KEY-----",
"replace": "-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5U86nI/1f8us73a5Tn8K\r\nNjcrWyT6oZzz18uC4eH4LM+VaIJlGvzA0UWMMv8/otX+u8M3wBl/uONv39wc382d\r\neKxTPmo0gWb1cwZ8SeqNUvQJl5HxD0zSPlA2LbQFwoA3aI4nSYcaFV7at7XGph/N\r\nHdYbtSCJei0N7hiqWeeIHcSYjZpmBk5KUs/E+OODquII5liol5LiC9AnvFCVHcT4\r\n1mliTgdHt/LKiLbc0AoVCDHdVMBPEPuZAn9MQJpfIPJdexU8Hzn4xBQ9K2NyISYS\r\n7eRwxratNPdNUHixaw6tyuUCDEV2ELAYw5rwoaFsqP7M76SubBRZObZ8DUgsZZaE\r\nlQIDAQAB\r\n-----END PUBLIC KEY-----"
}
}