How to find the offset of the section header string table of an elf file?

前端 未结 4 1581
醉酒成梦
醉酒成梦 2020-12-08 17:48

I have to write a C program that prints an ELF file. I\'m having trouble figuring out where the section header string table is.

Let\'s say I have a file that gave me

4条回答
  •  长情又很酷
    2020-12-08 18:10

    It seems that the one you want is STRTAB, which has an offset of 0x441c (line [20]). The headers start 17636 bytes into the file (according to

    Start of section headers:          17636 (bytes into file)
    

    So I am going to guess that your string table starts at 17636 + 17436 = 35072 bytes from the start of the file.

    I could be completely wrong, but that's where I would start. Do you know how to use od or some such utility to do a dump of file bytes?

提交回复
热议问题