Python: Listing members of a structure using pyelftools

278 views Asked by At

I have a structure in C with several members and an ELF file.

For instance I have the following

typedef struct my_struct {
    int a;
    int c;
    char d;
} MYSTRUCT_T;

MYSTRUCT_T hello;

How am I able to print out the members of hello? Or obtain an object of hello, with members of hello.a, hello.c and hello.d

Is there already a library which does this such as pyelftools?

0

There are 0 answers