diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-05-04 19:28:27 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-05-04 19:28:27 -0400 |
| commit | 7cc163fa72b3ea342a9b061ae8988887edbf198f (patch) | |
| tree | 2803aaffa080a3e63b36d659bbeb8052b5a4cdf6 /python/examples | |
| parent | 26c8f70fd837baec98bcf2aac89ae658c5590013 (diff) | |
Initial support for concrete flags computation
Diffstat (limited to 'python/examples')
| -rw-r--r-- | python/examples/nes.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/examples/nes.py b/python/examples/nes.py index 813b91c9..0018b956 100644 --- a/python/examples/nes.py +++ b/python/examples/nes.py @@ -469,6 +469,15 @@ class M6502(Architecture): return length + def perform_get_flag_write_low_level_il(self, op, size, write_type, flag, operands, il): + if flag == 'c': + if (op == LowLevelILOperation.LLIL_SUB) or (op == LowLevelILOperation.LLIL_SBB): + # Subtraction carry flag is inverted from the commom implementation + return il.not_expr(0, self.get_default_flag_write_low_level_il(op, size, FlagRole.CarryFlagRole, operands, il)) + # Other operations use a normal carry flag + return self.get_default_flag_write_low_level_il(op, size, FlagRole.CarryFlagRole, operands, il) + return Architecture.perform_get_flag_write_low_level_il(self, op, size, write_type, flag, operands, il) + def perform_is_never_branch_patch_available(self, data, addr): if (data[0] == "\x10") or (data[0] == "\x30") or (data[0] == "\x50") or (data[0] == "\x70") or (data[0] == "\x90") or (data[0] == "\xb0") or (data[0] == "\xd0") or (data[0] == "\xf0"): return True |
