linux – ELF文件中的导入表在哪里?

我在String Table中找到了“.dynsym”,得到了索引.
然后我找到了sh_name = index&&的部分. sh_type = SHT_DYNSYM.
所以我得到了sh_offset = 464和sh_size = 64.
但是你可以在附图中看到,在偏移464上只有零.

我想导入表在偏移528上开始.问题是:如何计算它%)

解决方法

But you can see in the attached picture,that on the offset 464 there are only zeros.

错误:上次我检查时,01,20,29,12等不是“仅零”.

I suppose that Import Table starts on offset 528

不,不是的.出于某种原因,您希望在ELF文件中找到Microsoft PE样式的导入表.它不在那里.

ELF中的导入表的等效项包含在两个表中.一个包含Elf {32,64} _Sym固定大小的记录:

typedef struct
{
  Elf32_Word    st_name;                /* Symbol name (string tbl index) */
  Elf32_Addr    st_value;               /* Symbol value */
  Elf32_Word    st_size;                /* Symbol size */
  unsigned char st_info;                /* Symbol type and binding */
  unsigned char st_other;               /* Symbol visibility */
  Elf32_Section st_shndx;               /* Section index */
} Elf32_Sym;

并包含在.dynsym部分中.

一个表包含在.dynstr部分中(在您的文件中以偏移量528开始),并且只有(可变大小)字符串由NUL字符分隔.

一个表中的.st_name引用.dynstr中的偏移量.

相关文章

insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...