From a8f8ca6c93e184687f33a682b85befdd00bfbbc6 Mon Sep 17 00:00:00 2001 From: serpilliere Date: Fri, 7 Oct 2011 14:05:24 +0200 Subject: add option follow call --- example/disas_and_graph.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'example/disas_and_graph.py') diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index 268af176..ac99678a 100755 --- a/example/disas_and_graph.py +++ b/example/disas_and_graph.py @@ -32,6 +32,14 @@ parser.add_option('-r', "--rawfile", dest="rawfile", action="store_true", default=False, metavar=None, help="dont use PE/ELF/CLASS autodetect, disasm raw file") +parser.add_option('-c', "--followcall", dest="followcall", action="store_true", + default=False, metavar=None, + help="follow call dst") +parser.add_option('-n', "--dontdiscallret", dest="dontdiscallret", action="store_true", + default=False, metavar=None, + help="dont disasssemble call next instruction") + + (options, args) = parser.parse_args(sys.argv[1:]) if not args: parser.print_help() @@ -157,7 +165,9 @@ def my_disasm_callback(ad): raise ValueError('bad machine options') all_bloc = asmbloc.dis_bloc_all(mnemo, in_str, ad, set(), symbol_pool=symbol_pool, - amode = admode) + amode = admode, + dontdis_retcall = options.dontdiscallret, + follow_call = options.followcall) g = asmbloc.bloc2graph(all_bloc) open('graph.txt', 'w').write(g) if mnemo == ia32_arch.x86_mn: -- cgit 1.4.1