docs:补上 90CN.dll 自校验 CRC 工具的文档说明
- 新增 docs/客户端补丁与CRC校验.md:SelfCrcSlot 结构、CRC32 算法与种子坑、 槽位为什么只在 .data/.rdata 里找、info/verify/patch 用法与退出码、 build_90cn.ps1 集成、与「服务端 DLL 指纹」的区别、六类故障排查 - 新增 client-patch/tools/README.md:脚本清单与常用命令速查 - docs/README.md:文档索引与上手路径补一条 - 根 README:关键设计说明补「客户端自校验(CRC32)」小节,文档索引补一行 - 90CN.cpp:清掉过期的重复注释(旧的 patch_selfcrc.py / .text 段说法),与实现对齐
This commit is contained in:
1 parent
9bdaf28683
commit
da502b3524
5 files changed
+174
-8
No files matched your search
@@ -13159,16 +13159,11 @@ static bool VerifyBoundMoviePresent()
|
||||
|
||||
// ── 自校验(self-integrity-crc)────────────────────────────────────────
|
||||
//
|
||||
// 构建后由 patch_selfcrc.py 把自身 .text 段的 CRC32 写进 g_selfCrcExpected。
|
||||
// 运行时重新读取磁盘上的本 DLL,算 .text 段 CRC 并比对:
|
||||
// 任何字节被改动(比如 patch 掉校验分支)→ CRC 不符 → 客户端无法启动。
|
||||
// 占位初值必须是 0xC0DEC0DE,脚本靠它定位写入位置。
|
||||
// ── 自校验(self-integrity-crc)────────────────────────────────────────
|
||||
//
|
||||
// 构建后由 patch_dll_crc.py 写入两个字段:
|
||||
// 构建后由 tools/patch_dll_crc.py 写入两个字段:
|
||||
// offset = 本结构 expected 字段在文件中的绝对偏移
|
||||
// expected = 整个文件的 CRC32(计算时跳过 [offset, offset+4),避免自指)
|
||||
// 运行时重新读盘、用同样规则重算并比对;任何字节被改动 → 不符 → 客户端无法启动。
|
||||
// 占位初值必须是 0xC0DEC0DE,脚本靠它定位写入位置(详见 docs/客户端补丁与CRC校验.md)。
|
||||
static struct SelfCrcSlot {
|
||||
// volatile:这三个字段只由构建后脚本改文件字节,代码里从不写。
|
||||
// 不加 volatile 时 /O2 会把 offset/expected 当常量折叠成 0,补丁写对了也读不到。
|
||||
@@ -14996,7 +14991,7 @@ DWORD WINAPI InstallTransportWorkerInner(void*)
|
||||
bool tclsInstalled = InstallTclsCompatibility();
|
||||
LogLine("TCLS early bootstrap result=%d", tclsInstalled);
|
||||
|
||||
// 自校验:本 DLL 的 .text 段 CRC 必须与构建时写入的值一致。
|
||||
// 自校验:本 DLL 整个文件的 CRC32 必须与构建时写入的值一致。
|
||||
if (!VerifySelfIntegrity()) {
|
||||
LogLine("self crc check failed: terminating client");
|
||||
MessageBoxW(nullptr,
|
||||
|
||||
Reference in new issue
Block a user