【问题标题】:IDA python script, wrong number of argument for over loaded function ERRORIDA python脚本,过载函数错误的参数数量错误
【发布时间】:2012-10-28 08:53:51
【问题描述】:

我有一个为 IDA 编写的简单 python 脚本,但我不知道我做错了什么。

file = open("c:\\example.txt", "r")

for line in file:
    if line == "":
        pass
    else:
        addr =  line.split(None,1)

    if len(addr) < 2:
        pass
    else:
        address = ''.join(addr[0])
        if(idc.Jump(address)):
            sea = ScreenEA()
        else:
            print "There is a problem with the destenation address"

        counter = 0
        for l in addr[1]:
            PatchByte(sea+counter, ord(l))
            counter += 1


file.close()

example.txt 文件中的拖线:

0x1001b3a4               Kernel32.DLL
0x1001b3c8                 CreateToolhelp32Snapshot

我得到的错误信息是:

对我来说很明显错误是在if(idc.Jump(address)): 行,我试图用if(Jump(addr[0])): 调用它,但我得到了相同的错误消息。

我在官方文档中看到了Jump 函数,但似乎我将正确的参数传递给它。

可能是什么问题?

【问题讨论】:

  • 你不要在肯定的结果上使用 pass - 这是浪费和不必要的,你否定条件。在这种情况下,if not line == "": 等价于 if line: - Python 中的非空 strib 等价于 True逻辑表达式(实际上更复杂,但现在就足够了)

标签: python ida


【解决方案1】:

我认为问题在于您将字符串传递给Jump()。根据the docs,它必须是long

【讨论】:

    猜你喜欢
    • 2015-11-13
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-09
    相关资源
    最近更新 更多