angr / angr/archinfo

No arch expresses a 64-bit MIPS ISA in a 32-bit ELF container

未關閉
#368 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
help wanted
主要語言
Python
星號
97
分支
70
平均合併
2 天 6 小時
30 天內合併 PR
8

描述

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Measuring CFG recovery against binaries' own DWARF line tables, symbol tables and `.eh_frame` across a large corpus turned up a class where angr recovers nothing for large parts of an object, and the cause is that no `Arch` can describe the file. It is the single largest source of missed code in that measurement: 36 objects, 859 function symbols with no block at their entry, and 12,439 line-table addresses covered by no block.

The files are ELFCLASS32 MIPS binaries whose `e_flags` report `EF_MIPS_ARCH` of MIPS3 or later — the o32 and n32 ABIs on a 64-bit ISA. `arch_from_id("EM_MIPS", bits=32)` returns `ArchMIPS32`, so `ld`, `sd`, `daddiu` and the rest of the 64-bit instructions fail to decode. Lifting fails per block, and angr's `drop_bad_functions` then removes the surrounding functions, so the result is silent: the CFG simply has a hole where a third of the code was.

Pointer width and register width are not the same thing here, and archinfo currently ties them together. o32/n32 on MIPS III+ needs 64-bit registers with 32-bit pointers, which no existing arch expresses.

The question is whether archinfo should grow that combination, or whether these files should be rejected at load time with a clear error rather than analyzed as MIPS32 and quietly under-recovered. The present behaviour is the worst of the three, because nothing reports a problem.

A reproducer needs no special corpus: `mips64-linux-gnu-gcc -mabi=32 -march=mips64r2` produces an ELFCLASS32 object with `EF_MIPS_ARCH` set to MIPS64, and any function using a 64-bit instruction will be missing from the recovered CFG.

angr/archinfo#369 is the same shape on a different architecture and probably wants the same answer.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start at arch_from_id("EM_MIPS", bits=32) and ArchMIPS32, then reproduce the issue with mips64-linux-gnu-gcc -mabi=32 -march=mips64r2. Compare the MIPS case with angr/archinfo#369 and determine whether the supported outcome is a mixed-width Arch or a clear load-time rejection. Done means the behavior no longer silently omits 64-bit instructions from the CFG.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
reverse-engineering
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。