about summary refs log tree commit diff stats
path: root/example
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2012-12-03 11:30:02 +0100
committerserpilliere <devnull@localhost>2012-12-03 11:30:02 +0100
commit688ef20af335c6829a4156d0d37d3ad98b55ff21 (patch)
treef18d98e3ba7eaa00c15a645d9a3f1bb2c6dc7774 /example
parentdeb4200cf4b13039dea5b889d3f4cb47e8bd3221 (diff)
downloadmiasm-688ef20af335c6829a4156d0d37d3ad98b55ff21.tar.gz
miasm-688ef20af335c6829a4156d0d37d3ad98b55ff21.zip
parse_asm: clean space; fix examples asm_bloc api
Diffstat (limited to 'example')
-rwxr-xr-xexample/asm_arm.py2
-rw-r--r--example/asm_box.py4
-rwxr-xr-xexample/asm_x86.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/example/asm_arm.py b/example/asm_arm.py
index 2072f519..8cd5e303 100755
--- a/example/asm_arm.py
+++ b/example/asm_arm.py
@@ -45,7 +45,7 @@ open("graph.txt" , "w").write(g)
 for b in all_bloc[0]:
     print b
 symbol_pool.add_label('base_address', 0x0)
-symbol_pool.getby_name("toto").offset = 0x0
+symbol_pool.set_offset(symbol_pool.getby_name("toto"), 0x0)
 
 resolved_b, patches = asmbloc.asm_resolve_final(my_mn, all_bloc[0], symbol_pool)
 print patches
diff --git a/example/asm_box.py b/example/asm_box.py
index f1e4bde5..e610eda1 100644
--- a/example/asm_box.py
+++ b/example/asm_box.py
@@ -27,8 +27,8 @@ msg:
 .string "World!"
 ''')
 symbol_pool.add_label('base_address', 0)
-symbol_pool.getby_name("MessageBoxA").offset = e.DirImport.get_funcvirt('MessageBoxA')
-symbol_pool.getby_name("main").offset = e.rva2virt(s_text.addr)
+symbol_pool.set_offset(symbol_pool.getby_name("MessageBoxA"),e.DirImport.get_funcvirt('MessageBoxA'))
+symbol_pool.set_offset(symbol_pool.getby_name("main"), e.rva2virt(s_text.addr))
 resolved_b, patches = asmbloc.asm_resolve_final(x86_mn, all_bloc[0], symbol_pool)
 for p in patches:
     e.virt[p] = patches[p]
diff --git a/example/asm_x86.py b/example/asm_x86.py
index 82bba972..d4a621f6 100755
--- a/example/asm_x86.py
+++ b/example/asm_x86.py
@@ -57,7 +57,7 @@ eend:
 
 #fix shellcode addr
 symbol_pool.add_label('base_address', 0x400000)
-symbol_pool.getby_name("main").offset = 0x401000
+symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x401000)
 e.Opthdr.AddressOfEntryPoint = s_text.addr
 
 for b in all_bloc[0]: