diff options
| author | Camille Mougey <camille.mougey@cea.fr> | 2015-01-18 18:24:13 +0100 |
|---|---|---|
| committer | Camille Mougey <camille.mougey@cea.fr> | 2015-01-23 17:24:43 +0100 |
| commit | 488cb99d4d61a0b3b176f7e3c53431872fc234ef (patch) | |
| tree | 8d443acb6c92669cdeaa50a40af3496917a9448f /example/jitter/arm.py | |
| parent | 829f8b98a658532b40382640223c0c3ea12ab15c (diff) | |
| download | miasm-488cb99d4d61a0b3b176f7e3c53431872fc234ef.tar.gz miasm-488cb99d4d61a0b3b176f7e3c53431872fc234ef.zip | |
Example: Move jitter's examples to a `jitter` directory
Diffstat (limited to 'example/jitter/arm.py')
| -rw-r--r-- | example/jitter/arm.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/example/jitter/arm.py b/example/jitter/arm.py new file mode 100644 index 00000000..5342ee6d --- /dev/null +++ b/example/jitter/arm.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- +import logging +from pdb import pm + +from miasm2.analysis.sandbox import Sandbox_Linux_arml + +# Get arguments +parser = Sandbox_Linux_arml.parser(description="""Sandbox an elf binary with arm + engine (ex: jit_arm.py samples/md5_arm -a A684)""") +parser.add_argument("filename", help="ELF Filename") +parser.add_argument('-v', "--verbose", help="verbose mode", action="store_true") +options = parser.parse_args() + +# Prepare the sandbox +sb = Sandbox_Linux_arml(options.filename, options, globals()) + +# Handle 'verbose' option +if options.verbose is True: + logging.basicConfig(level=logging.INFO) +else: + logging.basicConfig(level=logging.WARNING) + +if options.verbose is True: + sb.jitter.vm.dump_memory_page_pool() + +if options.address is None: + raise ValueError('Invalid address') + +# Run the code +sb.run() |