Indexing into arrays in structures with multiple structure members may target the wrong member array #6450
Labels
Component: Core
Issue needs changes to the core
Core: HLIL
Issue involves High Level IL
Core: MLIL
Issue involves Medium Level IL
IL Optimization
Issue involving optimization of representation (not correctness)
State: Awaiting Triage
Issue is waiting for more in-depth triage from a developer
Type: Bug
Issue is a non-crashing bug with repro steps
Milestone
Version and Platform (required):
Bug Description:
If a structure contains two array members one after another, attempts to index into the second array member may decompile as indexing into the first array.
Screenshot from original slack post:

From minimal repro:

Steps To Reproduce:
arg1->fw[arg2+0x15]
which is beyond the bounds of thefw
member.Expected Behavior:
HLIL at 0x00000014 should show
arg1->fwHandles[arg2]
.Screenshots/Video Recording:
If applicable, please add screenshots/video recording here to help explain your problem.
Binary:
Repro.bndb.txt
Additional Information:
From pubslack user @VisualEhrmanntraut
https://binaryninja.slack.com/archives/C0CV88A83/p1739906675594239
Initial Analysis
It appears the problem is in part due to MLIL typing/valuing an intermediate value (in
r12
) as a pointer to the first member array, so that whenr12
is reused to index into the second member array, it is still considered as a pointer to the first array:The text was updated successfully, but these errors were encountered: