IDA Pro 转换为指令功能:如何自动化。

逆向工程 艾达 linux idapro插件 蟒蛇
2021-07-10 03:19:23

我正在加载以二进制形式读入 IDA 的各种文件。一旦我在我面前有 GUI,我就可以通过这些段并点击“c”以转换为指令/代码。

但是,我主要是尝试通过 linux 终端(使用命令行./idal -B input-file完成我所有的 ida 工作是否有命令行标志或其他方法来自动从二进制文件生成指令?或者这是我每次都必须手动执行的操作?

2个回答

我会在 IDAPython 中做这样的事情:

# I didn't check this code, please use carefully !This code will pass through all defined segments and will try to make code on any unexplored area
# IDAPython documentation is at https://www.hex-rays.com/products/ida/support/idapython_docs/

import idautils
import idc

for ea in idautils.Segments():
    segend = idc.GetSegmentAttr(ea, idc.SEGATTR_END)
    start = ea
    while start < segend:
        idc.MakeCode(start)
        start = idc.FindUnexplored(start+1, idc.SEARCH_DOWN)

您可以使用-S命令行开关运行它,如上一个答案所述

您可以通过-S开关在命令行中使用指定IDC脚本,您可以尝试调用AnalyzeArea(); 如果这不起作用,您可以使用MakeCode().