# 诊断脚本说明 这 4 个脚本是 2026-09-16 那轮定位用到的全部工具,用 Python 标准库写的,**不需要装任何第三方包**。 对应的技术报告见 `../文章/奥日2崩溃研究报告.md` 第 5 节(动态实验设计及结果)。 --- ## 每个脚本做什么 ### 1. `ori_debug.py` — 核心诊断器 用 Windows 调试接口**启动自己的游戏子进程**(不是附加到别的进程,也不装系统钩子), 在音频线程初始化附近的指令上打临时断点(INT3),记录寄存器、参数、返回值和**目标线程自己的** LastError。 这是抓到"`SetThreadAffinityMask` 返回 0、错误码 87"那个关键证据的工具。 ```powershell # 只校验 DLL 哈希,不启动游戏 python ori_debug.py --game "D:\Games\Ori and the Will of the Wisps" --check # 原始运行:只下断点观察,不做任何修改 python ori_debug.py --game "D:\Games\..." --seconds 40 --output ori-evidence/runtime-original # 对照实验 A:把掩码截断到进程可用范围(用来否掉"高位越界"假设) python ori_debug.py --game "D:\Games\..." --clamp-affinity # 对照实验 B:在进程内把 setter 写入的掩码改成 0(临时验证,不落盘) python ori_debug.py --game "D:\Games\..." --automatic-affinity ``` **两道安全检查:** - 启动前先算 `AkSoundEngine.dll` 的 SHA-256,不符就拒绝下断点 - 关闭时只终止**自己创建的那个**进程,不会碰任何其它游戏会话 ### 2. `ori_launch.py` — 普通启动器 不带调试器、不改内存,用来验证"**普通启动也通过**"——这才排除了"只有调试器下才成功"的可能。 ```powershell python ori_launch.py --game "D:\Games\Ori and the Will of the Wisps" --label normal-patched-1 ``` 它会先确认补丁已安装(校验**补丁后**的哈希),没装就直接退出。输出目录是相对于当前目录的 `ori-evidence/