From 9f6dcb0eba00a1d60eeac4c8ddb304b1a370262a Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 17 Sep 2026 20:00:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(3dtank):=20=E5=8D=8F=E8=AE=AE=E9=80=86?= =?UTF-8?q?=E5=90=91=E5=B7=A5=E7=A8=8B=E4=B8=8E=E8=87=AA=E7=A0=94=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E5=85=A5=E5=BA=93=EF=BC=88=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=93=BE=20+=20=E5=8D=8F=E8=AE=AE=E8=A1=A8=20+=20=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E5=9B=9E=E6=94=BE=20+=20MySQL=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 工具链(3DTank/tools/):extract(模块提取)、mine_evidence/apply_names(命名证据与别名回填)、extract_codec_fields(字段表 + 全库槽位类型 + PrimClassWire/ResourceClasses)、mine_downlink(下行字段表)、extract_space_init/rebase_space_init/audit_space_init(空间模板与记录切分审计)、extract_space_session(把真实会话切成按上行触发的回放模板)、pair_flow(请求→应答配对)、probe_containers、ingest/decrypt_frames(抓包入库与解密)、serve/fetch_assets(本地站点镜像)、import_db(抓包对象仓库导入 MySQL)。 服务器(3DTank/tools/server/):link/entry/codec/container/dispatch/world/space/semantic(协议层与 lt/pt/zt 三个容器布局)、session(会话回放,顺序推进)、db + schema.sql(MySQL 连接层与对象仓库表结构)、store/responder(查库组帧与定向应答;接管范围默认只开 ba.lcr)。 同时修 pair_flow 的时间轴偏移:timeline_c2s 与 timeline_s2c 的 0 点相差 144~4453ms,改前配对整体偏约 2 秒(实测 space-100073070 偏 2084ms),改后 22.4% 的触发者被纠正。 src/、src_named/、packets/、3DTank/local/(含数据库口令)不进库,可用上述工具重新生成。 --- 3DTank/README.md | 98 +- 3DTank/names/command_alias.json | 129 + 3DTank/names/commands.json | 189 + 3DTank/names/commands_decrypted.json | 42 + 3DTank/names/decoded_frames.txt | 6006 +++++ 3DTank/names/downlink_table.json | 13852 ++++++++++ 3DTank/names/flow.json | 18690 +++++++++++++ 3DTank/names/method_table.json | 5454 ++++ 3DTank/names/model_table.json | 11152 ++++++++ 3DTank/names/regdump.json | 1 + 3DTank/names/rename_report.json | 2315 ++ 3DTank/names/sendlog.json | 1 + 3DTank/names/space-init-100045260.json | 759 + 3DTank/names/space-init-100045720.json | 216 + 3DTank/names/space-init-100072911.json | 23787 +++++++++++++++++ 3DTank/names/space-init-100119080.json | 671 + 3DTank/names/space-init-920007382011.json | 179 + 3DTank/names/space-init-login-100045260.json | 93 + 3DTank/names/uplink_table.json | 126 +- 3DTank/tools/analyze_packets.js | 221 + 3DTank/tools/apply_names.js | 786 + 3DTank/tools/audit_space_init.js | 157 + 3DTank/tools/client_registry_dump.js | 248 + 3DTank/tools/client_send_dump.js | 21 + 3DTank/tools/decrypt_frames.js | 255 + 3DTank/tools/extract.js | 123 + 3DTank/tools/extract_codec_fields.js | 416 +- 3DTank/tools/extract_space_init.js | 120 + 3DTank/tools/extract_space_session.js | 315 + 3DTank/tools/fetch_assets.js | 121 + 3DTank/tools/import_db.js | 808 + 3DTank/tools/ingest.js | 94 + 3DTank/tools/lib_space_codec.js | 161 +- 3DTank/tools/match_methods.js | 80 + 3DTank/tools/mine_downlink.js | 497 + 3DTank/tools/mine_evidence.js | 132 + 3DTank/tools/package-lock.json | 189 + 3DTank/tools/package.json | 13 + 3DTank/tools/pair_flow.js | 99 +- 3DTank/tools/probe_containers.js | 136 + 3DTank/tools/rebase_space_init.js | 261 + 3DTank/tools/serve.js | 245 + 3DTank/tools/server/codec.js | 238 + 3DTank/tools/server/container.js | 455 + 3DTank/tools/server/db.js | 125 + 3DTank/tools/server/dispatch.js | 138 + 3DTank/tools/server/entry.js | 112 + 3DTank/tools/server/index.js | 564 + 3DTank/tools/server/link.js | 83 + 3DTank/tools/server/modelservice.js | 46 + 3DTank/tools/server/responder.js | 205 + 3DTank/tools/server/schema.sql | 154 + 3DTank/tools/server/selftest.js | 187 + 3DTank/tools/server/semantic.js | 540 + 3DTank/tools/server/session.js | 187 + 3DTank/tools/server/space.js | 65 + 3DTank/tools/server/store.js | 728 + 3DTank/tools/server/world.js | 67 + 3DTank/tools/structure_space_init.js | 174 + 3DTank/tools/wss_server.js | 345 +- 3DTank/tools/wss_test.js | 84 + 61 files changed, 93297 insertions(+), 458 deletions(-) create mode 100644 3DTank/names/command_alias.json create mode 100644 3DTank/names/commands.json create mode 100644 3DTank/names/commands_decrypted.json create mode 100644 3DTank/names/decoded_frames.txt create mode 100644 3DTank/names/downlink_table.json create mode 100644 3DTank/names/flow.json create mode 100644 3DTank/names/method_table.json create mode 100644 3DTank/names/model_table.json create mode 100644 3DTank/names/regdump.json create mode 100644 3DTank/names/rename_report.json create mode 100644 3DTank/names/sendlog.json create mode 100644 3DTank/names/space-init-100045260.json create mode 100644 3DTank/names/space-init-100045720.json create mode 100644 3DTank/names/space-init-100072911.json create mode 100644 3DTank/names/space-init-100119080.json create mode 100644 3DTank/names/space-init-920007382011.json create mode 100644 3DTank/names/space-init-login-100045260.json create mode 100644 3DTank/tools/analyze_packets.js create mode 100644 3DTank/tools/apply_names.js create mode 100644 3DTank/tools/audit_space_init.js create mode 100644 3DTank/tools/client_registry_dump.js create mode 100644 3DTank/tools/client_send_dump.js create mode 100644 3DTank/tools/decrypt_frames.js create mode 100644 3DTank/tools/extract.js create mode 100644 3DTank/tools/extract_space_init.js create mode 100644 3DTank/tools/extract_space_session.js create mode 100644 3DTank/tools/fetch_assets.js create mode 100644 3DTank/tools/import_db.js create mode 100644 3DTank/tools/ingest.js create mode 100644 3DTank/tools/match_methods.js create mode 100644 3DTank/tools/mine_downlink.js create mode 100644 3DTank/tools/mine_evidence.js create mode 100644 3DTank/tools/package-lock.json create mode 100644 3DTank/tools/package.json create mode 100644 3DTank/tools/probe_containers.js create mode 100644 3DTank/tools/rebase_space_init.js create mode 100644 3DTank/tools/serve.js create mode 100644 3DTank/tools/server/codec.js create mode 100644 3DTank/tools/server/container.js create mode 100644 3DTank/tools/server/db.js create mode 100644 3DTank/tools/server/dispatch.js create mode 100644 3DTank/tools/server/entry.js create mode 100644 3DTank/tools/server/index.js create mode 100644 3DTank/tools/server/link.js create mode 100644 3DTank/tools/server/modelservice.js create mode 100644 3DTank/tools/server/responder.js create mode 100644 3DTank/tools/server/schema.sql create mode 100644 3DTank/tools/server/selftest.js create mode 100644 3DTank/tools/server/semantic.js create mode 100644 3DTank/tools/server/session.js create mode 100644 3DTank/tools/server/space.js create mode 100644 3DTank/tools/server/store.js create mode 100644 3DTank/tools/server/world.js create mode 100644 3DTank/tools/structure_space_init.js create mode 100644 3DTank/tools/wss_test.js diff --git a/3DTank/README.md b/3DTank/README.md index 03eff47..c7d2da7 100644 --- a/3DTank/README.md +++ b/3DTank/README.md @@ -12,11 +12,14 @@ index.json # 模块索引 names/ evidence.json # 命名证据(见下) + command_alias.json # 派生命名词典(读源码证实语义后起的别名,不是原始名;含 Classes/Methods/Fields/MethodIds/Spaces) + rename_report.json # apply_names.js 的产出报告(含 Aliases 段) tools/ extract.js # bundle → src/ mine_evidence.js # src/ → names/evidence.json - (待建) src_named/ # 应用重命名后的源码 - (待建) tools/apply_names.js / build_bundle.js + apply_names.js # src/ → src_named/(证据命名;加 --aliases 时附带回填 command_alias.json 的别名) + src_named/ # 应用重命名后的源码(126 个模块,三道校验:node --check / 字符串集合一致 / 标识符计数) + (待建) tools/build_bundle.js ``` 原始 bundle 不复制进本工程,默认引用 `../main.6469b966.js`(可用参数覆盖)。 @@ -152,52 +155,73 @@ getter(`v("codec_名字")` 的报错串就是字段名)/ `q7g`(slot → **上行字段没有可读名**:命令类不像模型 codec 那样保留 `codec_<名字>` getter,555 个上行字段在模块内 没有任何属性访问点,压缩后原可读名已不可恢复,只能人工标注或靠调用点语义推断。 -### 离线模拟(fake 模式) +### 服务器:中继(分析)与真服务器(`server/`) ```bash cd tools -node wss_server.js --mode relay # 中继:客户端 → 本地 → 真实服务器(抓包 + 实时解析) -node wss_server.js --mode fake # 离线:自己回 Hash 握手 + Open Space,按抓包回放 -node wss_server.js --mode fake --replay-scale 0.5 --replay-gap-max 200 +node wss_server.js # 中继:客户端 → 本地 → 真实服务器(抓包 + 实时解析) +node server/index.js --port 9091 # 真服务器(M1):自己握手 / 自己管空间 / 把未实现命令记全 +node server/selftest.js # MakeWriter 往返自检(拿真实抓包逐字节比对) node decode_space_frames.js --dir ../packets/plain/space-100045720 --fields # 事后逐字段解一包 -node pair_flow.js # 重新生成请求→应答配对表 -node ingest.js --label mine-01 # 把一次抓包入库到 packets/plain/ +node pair_flow.js # 重新生成请求→应答配对表 +node ingest.js --label mine-01 # 把一次抓包入库到 packets/plain/ ``` -回放分两类:**主动推送**按抓包时间线(`timeline_s2c.txt`)铺开;**应答**挂在 `Watchers` 上等对应 c2s 到达。 -应答签名(必须与 `pair_flow.js` 的 `Signature` 一致,改一边就要改另一边): +**回放(fake 模式)方案已废弃**(2026-09-16 实测结论)。原因:客户端一次会话是「大厅 + 6 个空间轮流连」 +的链(`mine-01` 的 `session_001…007`:大厅 → 100045260 → 920007382011 → 100119080 → 100072911 → +100045720 → 车库 100073070),导航全部由大厅那几帧 `Open Space` 驱动,且每个连接都会往客户端的 +**全局注册表**(gameType / model / resource / space)里塞数据。只回放单条连接必然缺状态,实测表现为 +进车库后抛 `Class not found exception class=-2147482689`(`src/module_45686.js:117` 的 `ft()` 查 +`gameTypeRegistry` 落空),弹错后页面自动刷新,死循环。**空间层是问答式的,只能真服务器。** -- 上行空间帧 → `S:`(源码常量,跨会话稳定,**能精确到某条具体命令**) -- 其余 → `<命令 id>:<负载前 4 字节 hex>` +`wss_server.js` 只保留 relay(协议分析);真服务器在 `tools/server/`: -于是"客户端点商店/改名/切频道"这类上行都能触发它自己的那组下行,等不到触发的仍按原时间线兜底。 - -### 容器(无 codec 的记录)现状 - -容器的模型恒为 `_t`(`src/module_45686.js:94`),codec 是 `lt`(同文件 483-494),只有一个字段 `idCodec`(i64): -读 i64,`0` → 值是紧跟其后的那个 i64;否则按 modelRegister(`module_45686` 的 `at.k1we()`)里该 id 的 codec 就地展开。 - -容器负载 = `[头部][内层数据]`,头部实测形状是**模式表**: - -``` -[i32 a][i32 b][i64 objId][i32 N][N × i64 modelId] 共 20 + 8N 字节 -``` - -N 个 modelId 就是"容器里出现哪些模型",语义完全对得上: - -| 实测容器 | 模式表 | +| 文件 | 职责 | |---|---| -| `space-100045260/s2c_0000`(30 个) | CaptchaCC / RegistrationModelCC / EntranceResourcesCC / ExternalEntranceCC / ServerHaltEntranceCC … (登录+大厅初始化批次) | -| `space-100045720/s2c_0000`(5 个) | _t / Kz / ChatCC / ClanChatCC / NewsShowingCC(聊天批次) | -| `space-100072911`(2 个) | Jj / ShopCategoryCC(商店) | +| `link.js` | 帧边界 / nullmap / 明文协商(握手回帧里把「启用链路加密」置 0,整条链路明文) | +| `entry.js` | Hash Request·Response / EnterSpace / Open Space / ClientLog | +| `codec.js` | `MakeWriter`(写包)+ `ResolveFields`(按 methodId 取字段表,服务端与自检同一口径) | +| `dispatch.js` | 空间帧识别(两道门)→ 逐条记录解码 → 落地日志 → 记「未实现」 | +| `world.js` | 空间实例表 / 空间分类 / 未实现命令清单 | +| `index.js` | 启动、连接生命周期、日志落盘(`server-logs/