diff options
| author | Tim Blazytko <tim.blazytko@rub.de> | 2015-07-03 16:07:15 +0200 |
|---|---|---|
| committer | Tim Blazytko <tim.blazytko@rub.de> | 2015-07-03 16:07:15 +0200 |
| commit | 0ca69488498779b47390348ce2cdd0b810e76ccc (patch) | |
| tree | aa6ef88f4d6ccc5850c40cc15150e23a69a51130 | |
| parent | 62b99a75e0de39019f68bbc4813159e5837a42c6 (diff) | |
| download | miasm-0ca69488498779b47390348ce2cdd0b810e76ccc.tar.gz miasm-0ca69488498779b47390348ce2cdd0b810e76ccc.zip | |
sandbox: added sandbox for Linux_x86_64
| -rw-r--r-- | miasm2/analysis/sandbox.py | 24 |
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): |