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

Psudo-C displays empty structure access

Open bb33bb opened this issue 1 year ago • 11 comments

image

bb33bb avatar Aug 04 '24 12:08 bb33bb

Can you share the type definitions of wait_queue_head and whatever type the lock field is?

negasora avatar Aug 04 '24 17:08 negasora

Can you share the type definitions of wait_queue_head and whatever type the lock field is?

struct raw_spinlock __packed
{
    struct __packed
    {
        unsigned short owner;
        unsigned short next;
    } raw_lock;
};
struct list_head __packed
{
    struct list_head* next;
    struct list_head* prev;
};
struct swait_queue_head __packed
{
    struct raw_spinlock lock;
    struct list_head task_list;
};

for the reason of copy past in Ninja, I can not copy offset together with defination. if we need the offset, plz tell me

bb33bb avatar Aug 04 '24 23:08 bb33bb

if need this file , i can upload it. but the file is a little big.

bb33bb avatar Aug 05 '24 00:08 bb33bb

What version of binja? On what I think is a close approximation of the binary I'm seeing this: image

If you can share the exact binary I can see if it still repros

negasora avatar Aug 05 '24 00:08 negasora

image

bb33bb avatar Aug 05 '24 02:08 bb33bb

I will retest , i am keeping update everytime I am waked up

bb33bb avatar Aug 05 '24 02:08 bb33bb

after u see this, i will close it , after the retest, if still exist , i will make it open. Thank u.

bb33bb avatar Aug 05 '24 02:08 bb33bb

I think the problem is related to pseudo-C, a workaround for now is to view the HLIL, which is far less likely to run into corner cases like this.

On the other hand, this does look like a bug, and we should fix it. Please upload the file and share with us a link either here or in private

xusheng6 avatar Aug 05 '24 03:08 xusheng6

I will check again. For the sake of everyone's time saving, I close it first. After checking this again, I will make it reopen.

bb33bb avatar Aug 05 '24 07:08 bb33bb

i find the right case here image image

https://drive.google.com/file/d/15f_Z5GdhYeDYMbASg07rYXG9x83ziNSH/view?usp=sharing

bb33bb avatar Aug 19 '24 10:08 bb33bb

this is really very small issue, if really not deserved to patch , just leave it alone. I'm ok about this

bb33bb avatar Aug 19 '24 10:08 bb33bb