about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-08-04 09:12:11 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-08-09 00:38:39 +0200
commit3e168dc130dbf8183eaa023441d57dd2f09b80d1 (patch)
tree7c1680260a0e3b418c0142d261cab6127cffd7ff
parent47898689e5898f91a61a4c39042b86acacce18f6 (diff)
downloadmiasm-3e168dc130dbf8183eaa023441d57dd2f09b80d1.tar.gz
miasm-3e168dc130dbf8183eaa023441d57dd2f09b80d1.zip
Add aarch64l md5 sandbox and test
-rw-r--r--example/jitter/sandbox_elf_aarch64l.py28
-rwxr-xr-xexample/samples/md5_aarch64lbin0 -> 18888 bytes
-rw-r--r--test/test_all.py2
3 files changed, 30 insertions, 0 deletions
diff --git a/example/jitter/sandbox_elf_aarch64l.py b/example/jitter/sandbox_elf_aarch64l.py
new file mode 100644
index 00000000..0a4c88db
--- /dev/null
+++ b/example/jitter/sandbox_elf_aarch64l.py
@@ -0,0 +1,28 @@
+import os
+from pdb import pm
+from miasm2.analysis.sandbox import Sandbox_Linux_aarch64l
+from miasm2.jitter.jitload import log_func
+import logging
+
+
+# Python auto completion
+filename = os.environ.get('PYTHONSTARTUP')
+if filename and os.path.isfile(filename):
+    execfile(filename)
+
+# Insert here user defined methods
+
+# Parse arguments
+parser = Sandbox_Linux_aarch64l.parser(description="ELF sandboxer")
+parser.add_argument("filename", help="ELF Filename")
+options = parser.parse_args()
+
+# Create sandbox
+sb = Sandbox_Linux_aarch64l(options.filename, options, globals())
+
+log_func.setLevel(logging.ERROR)
+
+# Run
+sb.run()
+
+assert(sb.jitter.run is False)
diff --git a/example/samples/md5_aarch64l b/example/samples/md5_aarch64l
new file mode 100755
index 00000000..700b58bd
--- /dev/null
+++ b/example/samples/md5_aarch64l
Binary files differdiff --git a/test/test_all.py b/test/test_all.py
index b5dc0abf..5f8f6ea7 100644
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -363,6 +363,8 @@ for jitter in ExampleJitter.jitter_engines:
 for script, dep in [(["x86_32.py", Example.get_sample("x86_32_sc.bin")], []),
                     (["arm.py", Example.get_sample("md5_arm"), "-a", "A684"],
                      []),
+                    (["sandbox_elf_aarch64l.py", Example.get_sample("md5_aarch64l"), "-a", "0x400A00"],
+                     []),
                     (["msp430.py", Example.get_sample("msp430_sc.bin"), "0"],
                      [test_msp430]),
                     (["mips32.py", Example.get_sample("mips32_sc_l.bin"), "0"],