根因:重写的 patch_dll_crc.py 用 binascii.crc32(data, 0xFFFFFFFF) 计算 CRC,
该参数是"末值异或之后的运行值",再喂回去等于重复施加了条件化,得到的是
CRC32 的另一个变体,与 90CN.cpp 里 Crc32Update 的实现不一致。结果是补丁写
入的 expected 永远校验不过,客户端在 VerifySelfIntegrity 失败后安装流程中断,
transport 钩子(codec/decode/route/dproto)全部没装上,表现为"无法连接频道"。
改动:
- tools/patch_dll_crc.py
* CRC 改为标准 zlib.crc32(init 默认 0),与 C 端 Crc32Update 完全一致;
已用旧版本 DLL 反向验证(10-20、11-03、10-28 三份的存储值均能复算一致)
* 槽位改为按 PE 段表定位,只接受 .data/.rdata 内的候选,拒绝把补丁写进
.text 机器码(此前曾命中 cmp ..., 0C0DEC0DEh 的立即数导致访问违例)
* 新增 info/verify 子命令,patch 后自动回读校验
- 90CN.cpp
* SelfCrcSlot 三个字段加 volatile,避免 /O2 把 offset/expected 折叠成常量
* VerifySelfIntegrity 增加分步诊断日志,便于定位安装线程中断点
- client_build_id.go
* 指纹重绑为本次构建产物:1215488 / C7BE377C…8247071A
验证:客户端日志 self crc check computed==expected==0x80AFC116 ok=1,
transport DLL installed codec=1 decode=1 route=1 dproto=1,
channel connect result=1,first-login watchdog server_seen=1 client_seen=1。
Go server source
This module is the minimal source closure needed to build and test the current DNF90 service.
Key locations:
cmd/server/dnf90: product entry.cmd/server/doctor: deployment preflight.cmd/server/control: native BAT-facing deployment controller.internal/app/dnf90: single composition root.internal/services/dnfbridge: current-client transport and session implementation.internal/modules/dnf: DNF domain modules.internal/services/logic/dnf: MySQL repository assembly.internal/platform: only framework packages reachable by the DNF90 build/tests.
Runtime assets and generated configs intentionally do not live in this module. Build from this directory:
go build -buildvcs=false -mod=readonly -trimpath -o ..\runtime\bin\DNF90Control.exe ./cmd/server/control
go build -buildvcs=false -mod=readonly -trimpath -o ..\runtime\bin\DNF90Server.exe ./cmd/server/dnf90
go build -buildvcs=false -mod=readonly -trimpath -o ..\runtime\bin\DNF90Doctor.exe ./cmd/server/doctor