about summary refs log tree commit diff stats
path: root/example/jitter/mips32.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-25 11:09:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-03-05 16:52:49 +0100
commit02bbb30efea4980c9d133947cbbf69fb599071ad (patch)
tree3fea6826fcc5354840a27cb1dc99ff31eef81896 /example/jitter/mips32.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadmiasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'example/jitter/mips32.py')
-rwxr-xr-xexample/jitter/mips32.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/example/jitter/mips32.py b/example/jitter/mips32.py
index 70181a2a..2eb06c87 100755
--- a/example/jitter/mips32.py
+++ b/example/jitter/mips32.py
@@ -1,5 +1,6 @@
 #! /usr/bin/env python2
 #-*- coding:utf-8 -*-
+from __future__ import print_function
 from argparse import ArgumentParser
 from miasm2.analysis import debugging
 from miasm2.jitter.csts import *
@@ -44,12 +45,16 @@ def jit_mips32_binary(args):
         trace_new_blocks=args.log_newbloc
     )
 
-    myjit.vm.add_memory_page(0, PAGE_READ | PAGE_WRITE, open(filepath).read())
+    myjit.vm.add_memory_page(
+        0,
+        PAGE_READ | PAGE_WRITE,
+        open(filepath, 'rb').read()
+    )
     myjit.add_breakpoint(0x1337BEEF, code_sentinelle)
 
 
     # for stack
-    myjit.vm.add_memory_page(0xF000, PAGE_READ | PAGE_WRITE, "\x00"*0x1000)
+    myjit.vm.add_memory_page(0xF000, PAGE_READ | PAGE_WRITE, b"\x00"*0x1000)
 
     myjit.cpu.SP = 0xF800