pep8: black

This commit is contained in:
William Ballenthin
2020-07-02 10:32:26 -06:00
parent db2b1caeae
commit c185e9ef09
32 changed files with 765 additions and 810 deletions

View File

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