binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

HLIL dose not show nested structures

Open nitrogar opened this issue 3 years ago • 3 comments

Version and Platform (required):

  • Binary Ninja Version: latest

Bug Description: nested types are not used in the HLIL

Screenshot 2023-02-04 050702 Screenshot 2023-02-04 050555

nitrogar avatar Feb 04 '23 02:02 nitrogar

or mybe the problem is with arrays inside nested structures

nitrogar avatar Feb 04 '23 02:02 nitrogar

How would that be represented?

ccarpenter04 avatar Feb 05 '23 22:02 ccarpenter04

well as close as possible to the provided C code , the main issue is that binja dose no show the usage of element l2 and l3 in the structures Level1 and Level2 even though they are defied in the types

nitrogar avatar Feb 08 '23 03:02 nitrogar

Here is a repro with original source, executable and bndb repro.zip

plafosse avatar Nov 06 '24 20:11 plafosse

The problem is that the compiler optimized two array lookups into a single multiply, because the index is the same for both. Because the multiplication factor doesn't match the size of any of the structures, it doesn't resolve the array access. We would need to account for this optimization.

D0ntPanic avatar Nov 07 '24 18:11 D0ntPanic