about summary refs log tree commit diff stats
path: root/example/symbol_exec/dse_crackme.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2017-08-09 15:51:34 +0200
committerAjax <commial@gmail.com>2017-09-05 13:39:23 +0200
commitb2b0abbcb1d7cb0c80874436d2d5c72d4f5cb150 (patch)
treedf44edc90a1f95a4aa3e480c5fc12f5af28705e6 /example/symbol_exec/dse_crackme.py
parent06f2c39c95602f995d5d7d36e6dbd82dd5524cfc (diff)
downloadmiasm-b2b0abbcb1d7cb0c80874436d2d5c72d4f5cb150.tar.gz
miasm-b2b0abbcb1d7cb0c80874436d2d5c72d4f5cb150.zip
DSE: update example to use compute_solution
Diffstat (limited to 'example/symbol_exec/dse_crackme.py')
-rw-r--r--example/symbol_exec/dse_crackme.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/example/symbol_exec/dse_crackme.py b/example/symbol_exec/dse_crackme.py
index 34c39138..0b63f890 100644
--- a/example/symbol_exec/dse_crackme.py
+++ b/example/symbol_exec/dse_crackme.py
@@ -216,17 +216,17 @@ class DSEGenFile(DSEPathConstraint):
     """DSE with a specific solution creation:
     The solution is the content of the FILE to be read
 
-    The politics of exploration is the branch coverage: create a solution only
+    The politics of exploration is the code coverage: create a solution only
     if the target address has never been seen
     """
 
+    def compute_solution(self, destination):
+        # Skip this destination, already treated
+        return destination not in done
+
     def handle_solution(self, model, destination):
         global todo, done
 
-        if destination in done:
-            # Skip this path, already treated
-            return
-
         finfo = FILE_to_info_symb[FILE_stream]
 
         # Build corresponding file