gpt4 book ai didi

disassembly - 如何理解 Mach-O 符号表

转载 作者:行者123 更新时间:2023-12-02 01:12:11 24 4
gpt4 key购买 nike

我目前正在学习如何反汇编 Mach-O 二进制文件,并且我正在尝试弄清楚如何理解“符号表”(在加载命令 LC_SYMTAB 中)。

如何阅读/解释符号表及其条目?我不是 100%,但看起来每个条目都是 8 个字节? (如果我错了请纠正我)

我知道字符串表是由空字节分隔的一组字符串,但什么是符号表及其用途?

谢谢。

最佳答案

直接来自 <mach-o/nlist.h> :

struct nlist {
union {
uint32_t n_strx; /* index into the string table */
} n_un;
uint8_t n_type; /* type flag, see below */
uint8_t n_sect; /* section number or NO_SECT */
int16_t n_desc; /* see <mach-o/stab.h> */
uint32_t n_value; /* value of this symbol (or stab offset) */
};

struct nlist_64 {
union {
uint32_t n_strx; /* index into the string table */
} n_un;
uint8_t n_type; /* type flag, see below */
uint8_t n_sect; /* section number or NO_SECT */
uint16_t n_desc; /* see <mach-o/stab.h> */
uint64_t n_value; /* value of this symbol (or stab offset) */
};

所以不,不应该是 8 个字节,对于 32 位二进制文​​件应该是 12 个字节,对于 64 位二进制文​​件应该是 16 个字节。

关于disassembly - 如何理解 Mach-O 符号表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44770226/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com