about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--example/asm/shellcode.py6
-rw-r--r--example/asm/simple.py4
-rw-r--r--example/expression/asm_to_ir.py1
-rw-r--r--example/expression/solve_condition_stp.py2
-rw-r--r--test/arch/aarch64/unit/asm_test.py2
-rw-r--r--test/arch/mips32/unit/asm_test.py2
-rw-r--r--test/arch/x86/sem.py4
-rw-r--r--test/arch/x86/unit/asm_test.py2
8 files changed, 11 insertions, 12 deletions
diff --git a/example/asm/shellcode.py b/example/asm/shellcode.py
index 3f3aa877..945cac8c 100644
--- a/example/asm/shellcode.py
+++ b/example/asm/shellcode.py
@@ -76,14 +76,14 @@ if args.PE:
                            pe.DirImport.get_funcvirt('MessageBoxA'))
 
 # Print and graph firsts blocs before patching it
-for bloc in blocs[0]:
+for bloc in blocs:
     print bloc
-graph = asmbloc.bloc2graph(blocs[0])
+graph = asmbloc.bloc2graph(blocs)
 open("graph.txt", "w").write(graph)
 
 # Apply patches
 patches = asmbloc.asm_resolve_final(machine.mn,
-                                    blocs[0],
+                                    blocs,
                                     symbol_pool,
                                     dst_interval)
 if args.encrypt:
diff --git a/example/asm/simple.py b/example/asm/simple.py
index 1929961f..45954f91 100644
--- a/example/asm/simple.py
+++ b/example/asm/simple.py
@@ -27,10 +27,10 @@ loop:
 symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
 
 # Spread information and resolve instructions offset
-patches = asmbloc.asm_resolve_final(mn_x86, blocs[0], symbol_pool)
+patches = asmbloc.asm_resolve_final(mn_x86, blocs, symbol_pool)
 
 # Show resolved blocs
-for bloc in blocs[0]:
+for bloc in blocs:
     print bloc
 
 # Print offset -> bytes
diff --git a/example/expression/asm_to_ir.py b/example/expression/asm_to_ir.py
index 942e5e19..19ffd659 100644
--- a/example/expression/asm_to_ir.py
+++ b/example/expression/asm_to_ir.py
@@ -23,7 +23,6 @@ loop:
    RET
 ''')
 
-blocs = blocs[0]
 
 symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
 for b in blocs:
diff --git a/example/expression/solve_condition_stp.py b/example/expression/solve_condition_stp.py
index a25a7072..385c5d78 100644
--- a/example/expression/solve_condition_stp.py
+++ b/example/expression/solve_condition_stp.py
@@ -170,7 +170,7 @@ if __name__ == '__main__':
     ''')
 
 
-    b = blocs[0][0]
+    b = blocs[0]
     print b
     # add fake address and len to parsed instructions
     for i, l in enumerate(b.lines):
diff --git a/test/arch/aarch64/unit/asm_test.py b/test/arch/aarch64/unit/asm_test.py
index 60ed418e..9e0d5ea8 100644
--- a/test/arch/aarch64/unit/asm_test.py
+++ b/test/arch/aarch64/unit/asm_test.py
@@ -41,7 +41,7 @@ class Asm_Test(object):
         # fix shellcode addr
         symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
         s = StrPatchwork()
-        patches = asmbloc.asm_resolve_final(mn_aarch64, blocs[0], symbol_pool)
+        patches = asmbloc.asm_resolve_final(mn_aarch64, blocs, symbol_pool)
         for offset, raw in patches.items():
             s[offset] = raw
 
diff --git a/test/arch/mips32/unit/asm_test.py b/test/arch/mips32/unit/asm_test.py
index b6cb7b2d..a00d0842 100644
--- a/test/arch/mips32/unit/asm_test.py
+++ b/test/arch/mips32/unit/asm_test.py
@@ -41,7 +41,7 @@ class Asm_Test(object):
         # fix shellcode addr
         symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
         s = StrPatchwork()
-        patches = asmbloc.asm_resolve_final(mn_mips32, blocs[0], symbol_pool)
+        patches = asmbloc.asm_resolve_final(mn_mips32, blocs, symbol_pool)
         for offset, raw in patches.items():
             s[offset] = raw
 
diff --git a/test/arch/x86/sem.py b/test/arch/x86/sem.py
index b80ab33d..617b929b 100644
--- a/test/arch/x86/sem.py
+++ b/test/arch/x86/sem.py
@@ -47,9 +47,9 @@ def compute(ir, mode, asm, inputstate={}, debug=False):
 def compute_txt(ir, mode, txt, inputstate={}, debug=False):
     blocs, symbol_pool = parse_asm.parse_txt(mn, mode, txt)
     symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
-    patches = asmbloc.asm_resolve_final(mn, blocs[0], symbol_pool)
+    patches = asmbloc.asm_resolve_final(mn, blocs, symbol_pool)
     interm = ir(symbol_pool)
-    for bbl in blocs[0]:
+    for bbl in blocs:
         interm.add_bloc(bbl)
     return symb_exec(interm, inputstate, debug)
 
diff --git a/test/arch/x86/unit/asm_test.py b/test/arch/x86/unit/asm_test.py
index c6381d9e..bf609aa5 100644
--- a/test/arch/x86/unit/asm_test.py
+++ b/test/arch/x86/unit/asm_test.py
@@ -41,7 +41,7 @@ class Asm_Test(object):
         # fix shellcode addr
         symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
         s = StrPatchwork()
-        patches = asmbloc.asm_resolve_final(mn_x86, blocs[0], symbol_pool)
+        patches = asmbloc.asm_resolve_final(mn_x86, blocs, symbol_pool)
         for offset, raw in patches.items():
             s[offset] = raw