about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2014-12-10 17:43:26 +0100
committerserpilliere <serpilliere@users.noreply.github.com>2014-12-10 17:43:26 +0100
commit98a3f868f70660ddbb901a2a557cfa0774bc01fa (patch)
tree39e3571e09a3af5920a016cbd9aafb14d2d6a11e
parent3d309ba48a816dc3a634e90b40c5214c3f16dc09 (diff)
parent915a3e1ae946bf2a7b773f4dbdfe76dcff025d3e (diff)
downloadmiasm-98a3f868f70660ddbb901a2a557cfa0774bc01fa.tar.gz
miasm-98a3f868f70660ddbb901a2a557cfa0774bc01fa.zip
Merge pull request #16 from commial/fix-sandbox-ELF
SandboxLinux: entry_point was inexistant, options.address was ignored
-rw-r--r--miasm2/analysis/sandbox.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/miasm2/analysis/sandbox.py b/miasm2/analysis/sandbox.py
index 8676f373..f7009f3e 100644
--- a/miasm2/analysis/sandbox.py
+++ b/miasm2/analysis/sandbox.py
@@ -232,6 +232,8 @@ class OS_Linux(OS):
         self.elf = elf
         preload_elf(self.jitter.vm, elf, libs)
 
+        self.entry_point = elf.Ehdr.entry
+
         # Library calls handler
         self.jitter.add_lib_handler(libs, custom_methods)
 
@@ -348,7 +350,7 @@ class Sandbox_Linux_x86_32(Sandbox, Arch_x86_32, OS_Linux):
         """
         If addr is not set, use entrypoint
         """
-        if addr is None:
+        if addr is None and self.options.address is None:
             addr = self.entry_point
         super(Sandbox_Linux_x86_32, self).run(addr)