Skip to content

Commit

Permalink
update carry flags in cmpxchg since it's also part of the output
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Kyle committed Nov 17, 2020
1 parent 1d4713b commit 71622cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions angr/procedures/linux_kernel/arm_user_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def run(self, oldval, newval, ptr):
# handle cmpxchg
if self.state.solver.is_true(retval == 0):
self.state.memory.store(ptr, newval)
# set CARRY flag
self.state.regs.flags |= 0x20000000
else:
# zero CARRY flag
self.state.regs.flags &= 0xdfffffff
return retval

class _kuser_memory_barrier(angr.SimProcedure):
Expand Down

0 comments on commit 71622cd

Please sign in to comment.