通过命令行scrip实现idapython列表函数

2024-09-29 17:20:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我写了一个IDAPython脚本,通过idaprogui在DLL中执行和列出函数。但是,当通过命令提示符执行相同的脚本时,不会列出DLL中存在的函数。 代码如下:

from idautils import *
from idaapi import *
import idc
ea = BeginEA()
dll_functions=[]
fp=open(r"C:\Users\xxx\Documents\check\fun_output.txt","w")
fp.write("check")
for funcea in Functions(SegStart(ea), SegEnd(ea)):
    functionName = GetFunctionName(funcea)
    dll_functions.append(functionName)
    fp.write(functionName)
    print(functionName)
idc.Exit(0)

当通过cmd提示符执行时,它不列出以下函数:

^{pr2}$

Tags: 函数fromimport脚本checkfunctionswritedll
1条回答
网友
1楼 · 发布于 2024-09-29 17:20:17

AFAIK,脚本需要打开IDA数据库才能获得所需的内容。 根据国际开发协会的帮助:

 -S###  Execute a script file when the database is opened.

您可以尝试不发送url dll,只发送IDB文件路径,或者尝试使用创建数据库的-c选项。在

^{pr2}$

你也可以在这里查看http://www.hexblog.com/?p=128关于这个主题的一个非常好的条目

还有IDA的帮助, https://www.hex-rays.com/products/ida/support/idadoc/417.shtml

相关问题 更多 >

    热门问题