diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-01-26 16:46:40 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-01-26 16:46:40 +0100 |
| commit | 97df9f649b0bfc59aebc622711aedb3afa4eefad (patch) | |
| tree | 9a1292d4ed3aed6ac3b5545f31820291fa98fe9a | |
| parent | 00dabff2ee39c7f46a6383a76ba956077ce56f8d (diff) | |
| download | miasm-97df9f649b0bfc59aebc622711aedb3afa4eefad.tar.gz miasm-97df9f649b0bfc59aebc622711aedb3afa4eefad.zip | |
Msp430: fix execflow code
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/msp430/arch.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/miasm2/arch/msp430/arch.py b/miasm2/arch/msp430/arch.py index 34993ebc..dff91e7b 100644 --- a/miasm2/arch/msp430/arch.py +++ b/miasm2/arch/msp430/arch.py @@ -16,6 +16,9 @@ console_handler.setFormatter(logging.Formatter("%(levelname)-5s: %(message)s")) log.addHandler(console_handler) log.setLevel(logging.DEBUG) +conditional_branch = ['jnz', 'jz', 'jnc', 'jc', + 'jn', 'jge', 'jl'] +unconditional_branch = ['jmp'] def deref2expr_nooff(s, l, t): t = t[0] @@ -152,7 +155,7 @@ class instruction_msp430(instruction): self.args[0] = s def breakflow(self): - if self.name.startswith('j'): + if self.name in conditional_branch + unconditional_branch: return True if self.name.startswith('ret'): return True @@ -163,10 +166,10 @@ class instruction_msp430(instruction): return self.name in ['call'] def splitflow(self): - if self.name.startswith('jmp'): - return False - if self.name.startswith('j'): + if self.name in conditional_branch: return True + if self.name in unconditional_branch: + return False return self.name in ['call'] def setdstflow(self, a): |