ELF中的字符串表 [英] String table in ELF

查看:400
本文介绍了ELF中的字符串表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我得到一些符号,并且得到了elf文件的hexedit。我怎么知道这个符号出现在哪个部分?

  1. I get some symbol and I get the hexedit of an elf file. How can I know in which section this symbol appear?

strtab shstrtab ?还有一个符号字符串数组吗?

What is the different between strtab and shstrtab? there is also an array of symbol strings?

当我在名称表中获得索引时,它在 strtab shstrtab

When I get index in the names table, is it index in strtab or shstrtab?

推荐答案

对于第一个问题,我们需要妖精文件的hexedit才能正确理解。

For the first question, we would need the hexedit of the elf file to understand properly.

对于第二个问题-
strtab代表String表
shstrtab代表节头字符串表。

For the second question - strtab stands for String Table shstrtab stands for Section Header String table.

当我们阅读ELF头时,我们看到每个ElfHeader结构都包含一个名为e_shstrndx的成员。这是shstrtab的索引。如果使用此索引,然后从shstrtab中读取,则可以找到该部分的名称。

When we read ELF header, we see that every ElfHeader structure contains a member called e_shstrndx. This is an index to the shstrtab. If you use this index and then read from shstrtab you can find the name of that section.

strtab,是所有其他引用的字符串表。从ELF对象读取符号时,每个SYmbol结构(Elf32_Sym)都有一个名为st_name的成员。这是strtab的索引,用于获取该符号的字符串名称。

strtab, is the string table for all other references. When you read symbols from an ELF object, every SYmbol structure (Elf32_Sym) has a member called st_name. This is an index into strtab to get the string name of that symbol.

能否请您详细说明一下符号字符串数组?另外,名称表是什么意思?

Can you please elaborate more on array of symbol strings? Also, what do you mean by names table?

您可以参考以下链接-

You can refer to the following link - Reading ELF String Table on Linux from C

希望这能回答您的问题。

Hope this answers your question.

这篇关于ELF中的字符串表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆