diff options
| author | serpilliere <devnull@localhost> | 2011-11-18 08:52:02 +0100 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2011-11-18 08:52:02 +0100 |
| commit | e132bbf21e815aaf3c5b85cd4446a430cc72aeea (patch) | |
| tree | c5bf2ce62794d1e533043f437b3518345d2c22fb /example | |
| parent | 0ac5622550d2f335a1aa0f961b729efc3ceb3414 (diff) | |
| parent | 10149e4e7ebff93b4cef05700a7db9ef95df1167 (diff) | |
| download | miasm-e132bbf21e815aaf3c5b85cd4446a430cc72aeea.tar.gz miasm-e132bbf21e815aaf3c5b85cd4446a430cc72aeea.zip | |
merge with graph update
Diffstat (limited to 'example')
| -rwxr-xr-x | example/disas_and_graph.py | 6 | ||||
| -rw-r--r-- | example/sandbox_elf.py | 8 | ||||
| -rw-r--r-- | example/sandbox_pe.py | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py index f7b0fa60..8a41d979 100755 --- a/example/disas_and_graph.py +++ b/example/disas_and_graph.py @@ -38,6 +38,8 @@ parser.add_option('-c', "--followcall", dest="followcall", action="store_true", parser.add_option('-n', "--dontdiscallret", dest="dontdiscallret", action="store_true", default=False, metavar=None, help="dont disasssemble call next instruction") +parser.add_option('-l', "--loadstate", dest="load_state_file", default = None, + help="load state file") (options, args) = parser.parse_args(sys.argv[1:]) @@ -194,4 +196,6 @@ def my_disasm_callback(ad): l.set_args_symbols(o) return all_bloc -graph_blocs(ad_to_dis, all_bloc = [], dis_callback = my_disasm_callback) +graph_blocs(ad_to_dis, symbol_pool, all_bloc = [], + dis_callback = my_disasm_callback, + load_state_file = options.load_state_file) diff --git a/example/sandbox_elf.py b/example/sandbox_elf.py index f8e308e2..dc4aa5df 100644 --- a/example/sandbox_elf.py +++ b/example/sandbox_elf.py @@ -41,8 +41,10 @@ vm_add_memory_page(stack_base_ad, PAGE_READ|PAGE_WRITE, "\x00"*stack_size) dump_memory_page_pool_py() - -ep = e.sh.symtab.symbols['main'].value +try: + ep = e.sh.symtab.symbols['main'].value +except: + ep = e.Ehdr.entry ptr_esp = stack_base_ad+stack_size-0x1000 vm_set_mem(ptr_esp, "/home/toto\x00") @@ -72,7 +74,7 @@ known_blocs = {} code_blocs_mem_range = [] -log_regs = False +log_regs = True log_mn = log_regs must_stop = False def run_bin(my_eip, known_blocs, code_blocs_mem_range): diff --git a/example/sandbox_pe.py b/example/sandbox_pe.py index 75e9b306..fe3aa390 100644 --- a/example/sandbox_pe.py +++ b/example/sandbox_pe.py @@ -90,7 +90,7 @@ log_regs = True log_mn = log_regs def run_bin(my_eip, known_blocs, code_blocs_mem_range): global log_regs, log_mn - while my_eip != 0x1337beef: + while my_eip != 0x1337beef: #dyn dll funcs if my_eip in runtime_dll.fad2cname: @@ -120,9 +120,7 @@ def run_bin(my_eip, known_blocs, code_blocs_mem_range): known_blocs, code_blocs_mem_range = updt_automod_code(known_blocs) else: raise ValueError("except at", hex(my_eip)) - - print "start emulation" run_bin(ep, known_blocs, code_blocs_mem_range) dump_raw_e(e) |