We know that for an .so file the section header for the note.gnu.build-id is this.
idx offset load-addr size algn flags type section 001 0x000001c8 0x000001c8 0x00000024 4 0x00000002 0x00000007 .note.gnu.build-id
So when I try to read the build-id from the given off-set location, I get the wrong result. Here is the snippet of the code I am using.
FILE *f=fopen("lin.so","rb");
char k[40];
fseek(f,456,SEEK_SET);
fread(k,40,1,f);
int j=0;
while(j<40){
printf("%c",k[j]);
j++;
}
Now,the program is giving the correct output as per the code (and verified via hexdump) but the build-id is not present there, so how do I read it?
Where is the build-id stored then?
User contributions licensed under CC BY-SA 3.0