about summary refs log tree commit diff stats
path: root/example/expression/symbolic_exec.py
diff options
context:
space:
mode:
Diffstat (limited to 'example/expression/symbolic_exec.py')
-rw-r--r--example/expression/symbolic_exec.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/example/expression/symbolic_exec.py b/example/expression/symbolic_exec.py
deleted file mode 100644
index 40e9dc07..00000000
--- a/example/expression/symbolic_exec.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import sys
-from miasm.arch.ia32_arch import *
-from miasm.tools.emul_helper import *
-from miasm.core.bin_stream import bin_stream
-
-print "symbolic execution & simplification demo"
-
-def loop_emul(ad, machine, all_bloc):
-    ad = ExprInt(uint32(ad))
-    while isinstance(ad, ExprInt):
-        b = asmbloc.getblocby_offset(all_bloc, ad.arg)
-        if not b:
-            raise ValueError('unknown bloc', repr(ad))
-        print '*'*20, 'emul bloc:', '*'*20
-        print b
-        ad = emul_bloc(machine, b)
-    return ad
-
-if len(sys.argv) != 2:
-    print "%s obf.bin"%sys.argv[0]
-    sys.exit(-1)
-
-data = open(sys.argv[1]).read()
-in_str = bin_stream(data)
-
-symbol_pool = asmbloc.asm_symbol_pool()
-ad = 0
-
-all_bloc = asmbloc.dis_bloc_all(x86_mn, in_str, ad, set(), symbol_pool, dontdis_retcall = True)
-
-machine = x86_machine()
-ad = loop_emul(ad, machine, all_bloc)
-print
-print "emulation result:"
-print dump_reg(machine.pool)
-print "eip", ad
-print
-print dump_mem(machine.pool)