I'm trying to parse a binary file and it has a structure similar to this,

struct foo {
   int64_t count_things;
   int64_t offset_to_thing[count];
   int8_t  bytes[];
   int64_t other fields;

struct thing { ; not relevant for example }

Now the catch here is that the amount of things is stored in the struct. I assume the whole rest of this is more or less stored as a flexible array member...

struct foo { int64_t count_things; int8_t bytes[size] }

But I want more specificity as I want to be able to seek to the location and dump this out. Does Radare give me the tools to parse this kind of variable-length struct?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.