about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWilliam Bruneau <william.bruneau@epfedu.fr>2022-02-23 16:48:43 +0100
committerWilliam Bruneau <william.bruneau@epfedu.fr>2022-02-23 16:48:43 +0100
commit35bb4bc0a147672c970962c187515ab67adf2212 (patch)
treee044faa689a89c3d2c14bea8dd9ea892bad920e0
parent321d298a5265e94fde00c3c8068dc87612ac1e5a (diff)
downloadfocaccia-miasm-35bb4bc0a147672c970962c187515ab67adf2212.tar.gz
focaccia-miasm-35bb4bc0a147672c970962c187515ab67adf2212.zip
Add test for memory breakpoint example
-rw-r--r--example/jitter/memory_breakpoint.py3
-rwxr-xr-xtest/test_all.py5
2 files changed, 7 insertions, 1 deletions
diff --git a/example/jitter/memory_breakpoint.py b/example/jitter/memory_breakpoint.py
index fc41eae8..900b1621 100644
--- a/example/jitter/memory_breakpoint.py
+++ b/example/jitter/memory_breakpoint.py
@@ -48,7 +48,8 @@ def memory_breakpoint_handler(jitter):
     jitter.vm.set_exception(jitter.vm.get_exception() ^ EXCEPT_BREAKPOINT_MEMORY)
     jitter.vm.reset_memory_access()
 
-    return True
+    # Stop the jitter
+    return False
 sb.jitter.add_exception_handler(EXCEPT_BREAKPOINT_MEMORY, memory_breakpoint_handler)
 
 # Run
diff --git a/test/test_all.py b/test/test_all.py
index a49f6ff9..1ec49324 100755
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -796,6 +796,11 @@ for jitter in ExampleJitter.jitter_engines:
                              products=[Example.get_sample("box_upx_exe_unupx.bin")],
                              tags=tags.get(jitter, []))
 
+    testset += ExampleJitter(["memory_breakpoint.py",
+                              Example.get_sample("box_upx.exe")] +
+                             ["--jitter", jitter] +
+                             ["-o", "0x401130", "0x100", "--access", "rw"],
+                             tags=tags.get(jitter, []))
 
 for script, dep in [(["x86_32.py", Example.get_sample("x86_32_sc.bin")], []),
                     (["arm.py", Example.get_sample("md5_arm"), "--mimic-env"],