Repository navigation
phase-2: CLI 全量修复入契约+skew 缺陷修复;TUI/GUI 设备目录统一 - #23
Merged
Merged
Conversation
fix_so.py repair_elf(CLI 全量路径): - 新增第 0 步 memory-layout 兜底:p_offset 指向 EOF 之外且 p_vaddr 落在 文件范围内时,先按 GUI 基线语义把 p_offset 掰回 p_vaddr。修复实测缺陷: 对 so_offset_skew 契约样例,旧逻辑先被 extent-clamp 把健康段 p_filesz 归零、find_dynamic_offset 找不到 .dynamic 而误杀 PT_DYNAMIC(修反而坏)。 对齐管线(repair_elf_aligned)不受影响;真正截断的输入(双 OOB)不触发。 契约测试扩展: - 新增 run_python_cli.py:以 fix_so.py CLI 语义(classify→repair_elf)跑 SO 样例,输出独立 golden(expected.json schema 2 新增 python_cli 段)+ 两条硬不变量(修复产物必须过 validate_elf_deep;输入的 PT_DYNAMIC 不得被丢)。 - manifest 增加 cli 期望字段;compare 表格加 python_cli 列,--strict/--check 覆盖 CLI 不变量与 golden;REJECTED 语义锁死坏输入不被强行修复。 - 基线重冻:17 go/python + 7 python_cli,本地 --check --strict 全绿。 TUI/GUI 设备目录统一: - nhdd_tui.py DEVICE_DUMP_DIR:/data/local/tmp/.cache/nhdd → /data/local/tmp/nhdd_dump,与 gui/adb.go 及设备二进制默认值一致; 设备端"最近一次运行优先"(TUI 运行前仍清理重建,本地按 run-id 隔离不变)。 - README 双语的设备端流程说明同步改写(不再是"各自管理输出位置")。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
1.
fix_so.pyCLI 全量路径(repair_elf)修掉遗留缺陷p_offset≠p_vaddr输入,旧流程中infer_file_layout_offsets原样透传越界偏移 →clamp_phdr_file_extents把健康段p_filesz归零 →find_dynamic_offset因此找不到.dynamic,按"不可救"清掉PT_DYNAMIC。修复反而破坏文件。p_offset≥EOF且p_vaddr<size→ 先按 Go 基线把p_offset=p_vaddr),条件保守,真正双越界的截断文件不触发,原有 SHT 重建等能力保留。2. CLI 路径进入契约网(独立基线,不与 Go 比字节)
run_python_cli.py+ manifestcli期望 + expected.json schema 2 新增python_cligolden(7 例)。validate_elf_deep;输入含PT_DYNAMIC修复后必须仍在;4 个坏输入必须被 REJECTED(不许强行修)。--strict/--check均覆盖;本地 17+7 全绿。3. TUI/GUI 设备目录统一为
/data/local/tmp/nhdd_dumpgui/adb.go和设备二进制默认值、README 命令行示例一致;消除"两份 dump 存两个地方"的困惑。.dex/.so行为一致)。影响面
fix_so_file(对齐管线):未动(上一轮已镜像 Go)。adb pull /data/local/tmp/.cache/nhdd的老路径不再产生新数据(旧数据留在原地,可自行删)。验证
compare.py --freeze重冻 +--check --strictexit 0;nhdd_tui.py/fix_so.py语法检查通过。🤖 Generated with Claude Code