# 3、IDA 中的选择操作

本周的文章是关于在 IDA 中选择项目以及您可以使用这些选择做什么。

与之前主要使用键盘的文章相比，我们这次多了一个小变化：使用鼠标！

### 操作及其应用的范围

在 IDA 中执行操作时，默认情况下它仅应用于光标下的项目或当前地址（取决于操作）。但是，有时您可能希望对更多项目或地址范围执行操作，例如：

* 取消定义一系列指令；
* 当 IDA 不能自动将范围内未定义的字节转换为字符串时，手动将其转换为字符串。（例如，字符串不是以 NULL 结尾的）；
* 从中间有一些数据的一系列指令种创建一个函数（例如，当你得到“The function has undefined instruction/data at the specified address”报错时）；
* 仅导出选定函数反汇编或反编译而不是导出整个文件的反汇编或反编译；
* 将选定的反汇编片段复制到剪贴板。

### 在 IDA 中选择

在 IDA 中选择内容的最简单方法与在任何文本编辑器中相同：

* 用鼠标单击并拖动（您也可以在按住左键的同时用滚轮滚动）；
* 按住 `Shift` 并使用光标导航键（← ↑ → ↓ `PgUp` `PgDn` `Home` `End` 等）。

但是，如果您需要选择一个巨大的列表块（例如几个屏幕），这很快就会变得很累。在这种情况下，锚点选择将非常有用。

### 使用锚点选择

1. 移动到需要选择的开头并选择“Edit->Begin”选择（或使用 `Alt`-`L` 快捷键）。
2. 使用任何方式（如：光标键、跳转操作、功能窗口、导航栏等）导航到选择的另一端。
3. 执行操作（通过上下文菜单、键盘快捷键或全局菜单）。它将应用于从锚点到当前位置的选择。

### 例子

一些需要使用选择的操作：

* “File->Produce file”子菜单中的命令（创建 .ASM、.LST、HTML 或 .C 文件）
* “Edit->Export”（`Shift`–`E`）

![export\_data](https://www.hex-rays.com/wp-content/uploads/2020/08/export_data.png)

一些需要选择的更复杂的操作将在即将发布的文章中讨论。敬请期待，下周五见！

***

via: <https://hex-rays.com/blog/igor-tip-of-the-week-03-selection-in-ida/>

作者：Igor Skochinsky 译者：[cease2e](https://github.com/cease2e) 校对：[firmianay](https://github.com/firmianay)


---

# 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://firmianay.gitbook.io/ida-pro-tips/3-selection-in-ida.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.
