简体   繁体   English

Ida Pro Gragh输出批处理模式

[英]Ida pro gragh output batch mode

Can anyone let me know how we are going to output all the subroutine's graphs in batch mode suing IDC . 谁能让我知道我们将如何使用IDC以批处理方式输出所有子例程的图形。 ie I have 447 subroutine's and wanna be output them all and I would like to make sure I first retrieve all the routines address automatically, cuz by knowing the address I can simply use GenFuncCall . 即我有447个子例程,想全部输出,我想确保我先自动检索所有例程地址,因为知道该地址我可以简单地使用GenFuncCall PS: Is this the only cfg that I can get from Ida Pro given a binary dis-assembled file? PS:给定二进制反汇编文件后,这是我从Ida Pro可获得的唯一CFG吗?

I needed a CFG of my whole program,the base example I started from was: https://code.google.com/p/idapython/source/browse/trunk/examples/ex_gdl_qflow_chart.py 我需要整个程序的CFG,我从这里开始的基本示例是: https : //code.google.com/p/idapython/source/browse/trunk/examples/ex_gdl_qflow_chart.py

It uses the flow chart class: https://www.hex-rays.com/products/ida/support/idapython_docs/idaapi.FlowChart-class.html 它使用流程图类: https : //www.hex-rays.com/products/ida/support/idapython_docs/idaapi.FlowChart-class.html

also worth noting to trigger in batch mode, you'll want something like this 同样值得注意的是在批处理模式下触发,您需要这样的东西

idal64 -A -S{yourscriptname}.py {yourbinary} idal64 -A -S {yourscriptname} .py {yourbinary}

Tips: 提示:

  • Prototype the script in the IDAPro gui first 首先在IDAPro gui中对脚本进行原型制作
  • Opening of the graph processor can cause timing issues, its hacky, but something like delaying execution of the script seemed to help, eg 打开图形处理器可能会导致计时问题,使其变黑,但是诸如延迟执行脚本之类的事情似乎有所帮助,例如

    idaapi.autoWait() Timer(2, idacfg).start()

    where idacfg is your python function from the example idacfg是示例中的python函数

  • print to stdout doesn't seem to work in batch mode, so you'll want to set stdout to a file for your debugging. 打印到stdout似乎在批处理模式下不起作用,因此您需要将stdout设置为文件以进行调试。

  • Closing the GUI in batch mode is still an issue for me. 对我来说,以批处理模式关闭GUI仍然是一个问题。

Hope that helps. 希望能有所帮助。

If you just want the address of all known functions in the IDB, you could use something like this using IDAPython (just an example): 如果您只想获取IDB中所有已知函数的地址,则可以使用IDAPython(仅作为示例)使用类似以下的内容:

def main():
    for count, func_ea in enumerate(Functions()):
        if func_ea == BADADDR:
            break
        func_name = GetFunctionName(funcea)
        func_start = func_ea

        print("[{:4}] name: {}; start address: {:#x}".format(count, func_name, func_start))

if __name__ == "__main__":
    main()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM