mirror of
https://github.com/mandiant/capa.git
synced 2025-12-22 23:26:21 -08:00
pep8: black
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
'''
|
||||
"""
|
||||
IDAPython script to export DOT files of function graphs.
|
||||
|
||||
Example usage (via IDA autonomous mode):
|
||||
ida.exe -A -S_export_fimages.py "<output dir>" <fva1> [<fva2> ...] <sample_path>
|
||||
'''
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
@@ -26,13 +26,19 @@ def main():
|
||||
|
||||
for fva in fvas:
|
||||
fstart = idc.get_func_attr(fva, idc.FUNCATTR_START)
|
||||
name = '%s_0x%x' % (idb_name.replace('.', '_'), fstart)
|
||||
name = "%s_0x%x" % (idb_name.replace(".", "_"), fstart)
|
||||
out_path = os.path.join(out_dir, name)
|
||||
fname = idc.get_name(fstart)
|
||||
|
||||
if not ida_gdl.gen_flow_graph(out_path, '%s (0x%x)' % (fname, fstart), idaapi.get_func(fstart), 0, 0,
|
||||
ida_gdl.CHART_GEN_DOT | ida_gdl.CHART_PRINT_NAMES):
|
||||
print 'IDA error generating flow graph'
|
||||
if not ida_gdl.gen_flow_graph(
|
||||
out_path,
|
||||
"%s (0x%x)" % (fname, fstart),
|
||||
idaapi.get_func(fstart),
|
||||
0,
|
||||
0,
|
||||
ida_gdl.CHART_GEN_DOT | ida_gdl.CHART_PRINT_NAMES,
|
||||
):
|
||||
print "IDA error generating flow graph"
|
||||
# TODO add label to DOT file, see https://stackoverflow.com/a/6452088/10548020
|
||||
# TODO highlight where rule matched
|
||||
|
||||
@@ -40,5 +46,5 @@ def main():
|
||||
idc.qexit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user