about summary refs log tree commit diff stats
path: root/example
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-12-13 13:38:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-12-16 15:55:55 +0100
commit8ebdbffdc6c86e9b832869046dfc6e11a8fb21be (patch)
treebde0bed0794fd7e52130c00c954212dbc9bed7f3 /example
parentb998b1a8b2814585692e885e656c48357fbbb9b8 (diff)
downloadfocaccia-miasm-8ebdbffdc6c86e9b832869046dfc6e11a8fb21be.tar.gz
focaccia-miasm-8ebdbffdc6c86e9b832869046dfc6e11a8fb21be.zip
Update api according to Elfesteem
Diffstat (limited to 'example')
-rw-r--r--example/asm/shellcode.py9
-rw-r--r--example/jitter/unpack_upx.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/example/asm/shellcode.py b/example/asm/shellcode.py
index 253386b5..ce84238a 100644
--- a/example/asm/shellcode.py
+++ b/example/asm/shellcode.py
@@ -96,8 +96,13 @@ if args.encrypt:
     patches = new_patches
 
 print patches
-for offset, raw in patches.items():
-    virt[offset] = raw
+if isinstance(virt, StrPatchwork):
+    for offset, raw in patches.items():
+        virt[offset] = raw
+else:
+    for offset, raw in patches.items():
+        virt.set(offset, raw)
+
 
 # Produce output
 open(args.output, 'wb').write(str(output))
diff --git a/example/jitter/unpack_upx.py b/example/jitter/unpack_upx.py
index 58507506..c27ecdd8 100644
--- a/example/jitter/unpack_upx.py
+++ b/example/jitter/unpack_upx.py
@@ -86,7 +86,7 @@ def update_binary(jitter):
     logging.info('updating binary')
     for s in sb.pe.SHList:
         sdata = sb.jitter.vm.get_mem(sb.pe.rva2virt(s.addr), s.rawsize)
-        sb.pe.virt[sb.pe.rva2virt(s.addr)] = sdata
+        sb.pe.rva.set(s.addr, sdata)
 
     # Stop execution
     jitter.run = False