We\'re working on a C program compiled with arm-eabi-gcc under Linux.
We\'re using a dump of a large structure and we\'re having problems determining at which adress we
You can do it from a C program using the standard offsetof()
macro, defined in stddef.h
. However I'm not sure this is what you want, since you may be unable to run it (compiling it on the host will likely return wrong offsets).
#include
#include
struct A {
int a;
char b;
short c;
};
int main() {
printf("Offset of b in A is %zu\n", offsetof(struct A, b));
return 0;
}
However, you may be able to employ some hacks to get the offset from a compiled binary without executing it. Maybe assign a static variable the offset value, and find some way of getting its value.