Skip to content

Feat: Make Artifacts support in-structure commenting #102

@mahaloz

Description

@mahaloz

Background

In most decompilers, like IDA Pro, you can have types that have comments in them, like:

struct Elf64_Vernaux // sizeof=0x10
{                                       // XREF: LOAD:0000000000400410/r
     unsigned __int32 vna_hash;         // this is some comment on this first member
     unsigned __int16 vna_flags;
     unsigned __int16 vna_other;
     unsigned __int32 vna_name __offset(OFF64,0x400390);
     unsigned __int32 vna_next;
};

Which libbs does not currently support. An ideal solution would look like this:

my_struct = deci.structs["Elf64_Bernaux"]
print(my_struct.comments[0]) // this is some comment on this first member
print(my_struct.members[0].comment) // // this is some comment on this first member

Implementation

To support this type of commenting, we'll need to do a few things:

  • Update member-like Artifacts to have the comment attribute
  • Support setting/getting these in each decompiler (as much as possible)
  • Refactor Function to support comments
  • Remove the old comments system that simply stored all comments globally

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    paused

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions