diff options
| author | Camille Mougey <commial@gmail.com> | 2019-03-07 14:37:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-07 14:37:07 +0100 |
| commit | 4c2320b46250a8d6f8774e1218544b72a154cd8e (patch) | |
| tree | b67e7b072439f84109bd39dad8ed7f3f135224f8 /example/jitter/msp430.py | |
| parent | eab809932871f91d6f4aa770fc321af9e156e0f5 (diff) | |
| parent | 26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff) | |
| download | miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip | |
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'example/jitter/msp430.py')
| -rwxr-xr-x | example/jitter/msp430.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/example/jitter/msp430.py b/example/jitter/msp430.py index 36e45421..972a1fdc 100755 --- a/example/jitter/msp430.py +++ b/example/jitter/msp430.py @@ -1,9 +1,10 @@ #! /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 * -from miasm2.analysis.machine import Machine +from miasm.analysis import debugging +from miasm.jitter.csts import * +from miasm.analysis.machine import Machine parser = ArgumentParser( description="""Sandbox raw binary with msp430 engine @@ -39,12 +40,16 @@ def jit_msp430_binary(args): trace_new_blocks=args.log_newbloc ) - myjit.vm.add_memory_page(0, PAGE_READ | PAGE_WRITE, open(filepath, "rb").read()) + myjit.vm.add_memory_page( + 0, + PAGE_READ | PAGE_WRITE, + open(filepath, "rb").read() + ) myjit.add_breakpoint(0x1337, lambda _: exit(0)) # 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 |