diff options
| author | Pierre Lalet <pierre@droids-corp.org> | 2015-03-12 13:22:49 +0100 |
|---|---|---|
| committer | Pierre Lalet <pierre@droids-corp.org> | 2015-03-12 13:22:49 +0100 |
| commit | ba7981e458f868ff6c233ea57a17a895440a8a16 (patch) | |
| tree | 2528ae2e182cf049e9ed583bb529812035010b39 /miasm2/analysis/depgraph.py | |
| parent | ebc16824f28464419d76f82636e5534ebf7df55f (diff) | |
| parent | f1dc968b10f577f0f1c35dac583ccdc3614adf9e (diff) | |
| download | miasm-ba7981e458f868ff6c233ea57a17a895440a8a16.tar.gz miasm-ba7981e458f868ff6c233ea57a17a895440a8a16.zip | |
Merge pull request #108 from serpilliere/fix_depgraph_emul
Fix depgraph emul
Diffstat (limited to 'miasm2/analysis/depgraph.py')
| -rw-r--r-- | miasm2/analysis/depgraph.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/miasm2/analysis/depgraph.py b/miasm2/analysis/depgraph.py index 7ec9d7fa..bb827c00 100644 --- a/miasm2/analysis/depgraph.py +++ b/miasm2/analysis/depgraph.py @@ -346,7 +346,7 @@ class DependencyResult(object): def input(self): return self._input_depnodes - def emul(self): + def emul(self, step=False): """Symbolic execution of relevant nodes according to the history Return the values of input nodes' elements @@ -354,13 +354,13 @@ class DependencyResult(object): """ # Init new_ira = (self._ira.__class__)() - lines = self.relevant_nodes + depnodes = self.relevant_nodes affects = [] # Build a single affectation block according to history for label in self.relevant_labels[::-1]: - affected_lines = [line.line_nb for line in lines - if line.label == label] + affected_lines = set(depnode.line_nb for depnode in depnodes + if depnode.label == label) irs = self._ira.blocs[label].irs for line_nb in sorted(affected_lines): affects.append(irs[line_nb]) @@ -368,7 +368,7 @@ class DependencyResult(object): # Eval the block temp_label = asm_label("Temp") sb = symbexec(new_ira, new_ira.arch.regs.regs_init) - sb.emulbloc(irbloc(temp_label, affects)) + sb.emulbloc(irbloc(temp_label, affects), step=step) # Return only inputs values (others could be wrongs) return {depnode.element: sb.symbols[depnode.element] |