# 10.通过符号表找到符号

## 一、需要用到的结构

### 1.1 懒加载符号表

懒加载符号表是再用到的时候才会进行符号绑定的表。 我们分析MachO可以发现NSLog就在这里面

![1](/files/-M_uxpzTgWl19HKzN8yL)

### 1.2 总符号表

完整的符号表在这里

![](/files/-M_uxpzVtYQo-zK_AXVP)

### 1.3 间接符号表

在懒加载符号表中，我们发现，都有个`Indirect Pointer`。 这就说名这里是间接符号。 先在我们来到间接符号表：

![](/files/-M_uxpzWsnSG2PXPstX_)

我们可以发现这里面和懒加载符号表中标有`Indirect Pointer`的有对应关系。

### 二、找到NSLog的符号

在`IndirectSymbols`中我们找到NSLog。

![](/files/-M_uxpzX8cxt2buD3d_8)

#### 2.1 Data=000000B8

这里的值代表了当前间接符号在总表中的下标。我们换算一下十进制：`184`

#### 2.2 Symbols

找到下标184的，Data为`000000CE`，description:`String table index`。也就是`String Table`的下标。

#### 2.3 StringTables

来到`StringTable`，第一个地址为`00011230`，我们加上下标`000000CE`，得到`0x112FE`

![](/files/-M_uxpzYSDqYCkVbCty3)

这里我们就找到了`_NSLog`

## 三、fishhook是和我们这种反向的一个过程

[11.fishhook原理](/wiki/ni-xiang/11.fishhook-yuan-li.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ryukiedev.gitbook.io/wiki/ni-xiang/10.-tong-guo-fu-hao-biao-zhao-dao-fu-hao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
