Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
849 stars 194 forks source link

Jump to a function pointer struct field is treated as unresolved control flow #5171

Open VisualEhrmanntraut opened 4 months ago

VisualEhrmanntraut commented 4 months ago

Version and Platform (required):

Bug Description: Jump to a function pointer struct field is treated as unresolved control flow, wrecking analysis.

image Screenshot 2024-03-11 at 18 18 01 Screenshot 2024-03-11 at 18 20 18

Expected Behavior: It's supposed to look something like this

Screenshot 2024-03-11 at 18 21 48

Additional Information: The jumps (braa) is what I would assume a compiler optimisation. The issue doesn't seem to happen if it's using an instruction like blraa.

xusheng6 commented 4 months ago

I am not expecting this to happen -- is the vt variable global? Could you please share the binary so that we can make sure of the cause of the issue?

VisualEhrmanntraut commented 4 months ago

is the vt variable global?

311779126-aac90d1b-f667-4a5e-857c-447c2acef0e3

(pointer to struct for dynamic dispatch, so the values are defined globally, but the field is instantiated in runtime at type construction)

xusheng6 commented 4 months ago

is the vt variable global?

311779126-aac90d1b-f667-4a5e-857c-447c2acef0e3

(pointer to struct for dynamic dispatch, so the values are defined globally, but the field is instantiated in runtime at type construction)

Could you please also show the disassembly?

VisualEhrmanntraut commented 4 months ago

Could you please also show the disassembly?

Certainly.

Screenshot 2024-03-12 at 07 46 58 Screenshot 2024-03-12 at 07 47 14
VisualEhrmanntraut commented 4 months ago

(IOCommandGate_vt is a struct with __ptr_offset(0x10))

xusheng6 commented 4 months ago

Thx for all the info!

plafosse commented 4 months ago

This might be related to https://github.com/Vector35/binaryninja-api/issues/1060