about summary refs log tree commit diff stats
path: root/miasm2/analysis/sandbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/analysis/sandbox.py')
-rw-r--r--miasm2/analysis/sandbox.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/miasm2/analysis/sandbox.py b/miasm2/analysis/sandbox.py
index 1179a592..26212e25 100644
--- a/miasm2/analysis/sandbox.py
+++ b/miasm2/analysis/sandbox.py
@@ -392,6 +392,30 @@ class Sandbox_Linux_x86_32(Sandbox, Arch_x86_32, OS_Linux):
         super(Sandbox_Linux_x86_32, self).run(addr)
 
 
+class Sandbox_Linux_x86_64(Sandbox, Arch_x86_64, OS_Linux):
+
+    def __init__(self, *args, **kwargs):
+        Sandbox.__init__(self, *args, **kwargs)
+
+        # reserve stack for local reg
+        for i in xrange(0x4):
+            self.jitter.push_uint64_t(0)
+
+        # Pre-stack some arguments
+        self.jitter.push_uint64_t(0x1337beef)
+
+        # Set the runtime guard
+        self.jitter.add_breakpoint(0x1337beef, self.__class__.code_sentinelle)
+
+
+    def run(self, addr = None):
+        """
+        If addr is not set, use entrypoint
+        """
+        if addr is None and self.options.address is None:
+            addr = self.entry_point
+        super(Sandbox_Linux_x86_64, self).run(addr)
+
 
 class Sandbox_Linux_arml(Sandbox, Arch_arml, OS_Linux):