Ida pro gragh output batch mode

前端 未结 2 1173
别跟我提以往
别跟我提以往 2020-12-21 23:06

Can anyone let me know how we are going to output all the subroutine\'s graphs in batch mode suing IDC. i.e. I have 447 subroutine\'s and wanna be output them a

相关标签:
2条回答
  • 2020-12-22 00:00

    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.

    0 讨论(0)
  • 2020-12-22 00:09

    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()
    
    0 讨论(0)
提交回复
热议问题