about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCaroline Leman <CarolineLe@users.noreply.github.com>2020-05-18 15:30:42 +0200
committerCaroline Leman <CarolineLe@users.noreply.github.com>2020-05-18 15:32:00 +0200
commit9693085d3c8510c3182f1c1a65eecfe60a2dd25c (patch)
treeeaf97b87f380cb41cd9bebb1001d10daa867c5c2
parent9d73a9baa14e6062250a56a95182dc23de3ba779 (diff)
downloadmiasm-9693085d3c8510c3182f1c1a65eecfe60a2dd25c.tar.gz
miasm-9693085d3c8510c3182f1c1a65eecfe60a2dd25c.zip
Jitter: new feature run_until
-rw-r--r--miasm/jitter/jitload.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/miasm/jitter/jitload.py b/miasm/jitter/jitload.py
index 68f9c40d..34690425 100644
--- a/miasm/jitter/jitload.py
+++ b/miasm/jitter/jitload.py
@@ -422,6 +422,17 @@ class Jitter(object):
         self.init_run(addr)
         return self.continue_run()
 
+    def run_until(self, addr):
+        """PRE: init_run.
+        Continue the run of the current session until iterator returns, run is
+        set to False or addr is reached.
+        Return the iterator value"""
+
+        def stop_exec(jitter):
+            jitter.remove_breakpoints_by_callback(stop_exec)
+            return False
+        self.add_breakpoint(addr, stop_exec)
+        return self.continue_run()
 
     def init_stack(self):
         self.vm.add_memory_page(