Skip to content

Fix IL lookups that used the wrong kind of index - #8698

Merged
bdash merged 3 commits into
devfrom
test_il_index_confusion
Oct 30, 2026
Merged

bdash merged 3 commits into
devfrom
test_il_index_confusion

Conversation

@bdash

@bdash bdash commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Several APIs passed an index to the wrong type of IL function, or passed an expression index where core expects an instruction index, or the reverse. The lookups silently returned unrelated expressions as the indexes are not strongly typed.

This PR fixes the Rust MLIL/HLIL bindings, MediumLevelILInstruction::GetLowLevelIL, and one lookup in efi_resolver. In Rust, ILReferenceSource::expr_idx is now instr_idx, because it is an instruction index rather than an expression index.

@bdash
bdash requested a review from emesare October 29, 2026 01:47
bdash added 3 commits October 30, 2026 11:52
Several MLIL and HLIL wrappers passed or interpreted the wrong kind of
index, so they silently returned results for unrelated expressions.
`ILReferenceSource::expr_idx` is now `instr_idx`, since core stores an
instruction index there.
…pression

Core maps MLIL expressions to LLIL SSA expressions, but this looked
them up in non-SSA LLIL.
It asked non-SSA HLIL for the definition, but used the returned index
to fetch an expression from SSA HLIL.
@bdash
bdash force-pushed the test_il_index_confusion branch from 6eca5b2 to 547ae57 Compare October 30, 2026 19:05
@bdash
bdash merged commit 547ae57 into dev Oct 30, 2026
9 of 10 checks passed
@bdash
bdash deleted the test_il_index_confusion branch October 30, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants