Skip to content

Commit

Permalink
update lab7
Browse files Browse the repository at this point in the history
  • Loading branch information
s123tg committed May 7, 2024
1 parent 72cf8d1 commit 2f0151a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lab7/sol.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import angr, sys
proj = angr.Project('./login')
init_state = proj.factory.entry_state()
simulation = proj.factory.simgr(init_state)
def success_condition(state):
return b"Login successful" in state.posix.dumps(sys.stdout.fileno())
def fail_condition(state):
return b"Login failed" in state.posix.dumps(sys.stdout.fileno())
proj = angr.Project('./login')
init_state = proj.factory.entry_state()
simulation = proj.factory.simgr(init_state)
simulation.explore(find=success_condition, avoid=fail_condition)
solution = simulation.found[0]
print(solution.posix.dumps(sys.stdin.fileno()))

0 comments on commit 2f0151a

Please sign in to comment.