Ida pro gragh output batch mode

点点圈 提交于 2019-11-29 16:27:59

If you just want the address of all known functions in the IDB, you could use something like this using IDAPython (just an example):

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()

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

It uses the flow chart class: 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}

Tips:

  • Prototype the script in the IDAPro gui first
  • Opening of the graph processor can cause timing issues, its hacky, but something like delaying execution of the script seemed to help, e.g.

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

    where idacfg is your python function from the example

  • print to stdout doesn't seem to work in batch mode, so you'll want to set stdout to a file for your debugging.

  • Closing the GUI in batch mode is still an issue for me.

Hope that helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!