Skip to content

Commit

Permalink
Merge pull request #604 from Otmeal/lab7
Browse files Browse the repository at this point in the history
[LAB7] 111550054
  • Loading branch information
TaiYou-TW authored Jun 27, 2024
2 parents 299e600 + 730ebba commit 0a6cf0f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lab7/sol.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import angr,sys
project = angr.Project('./login')
init_state = project.factory.entry_state()
simulation = project.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())

simulation.explore(find=success_condition, avoid=fail_condition)

solution_state = simulation.found[0]

print (solution_state.posix.dumps(sys.stdin.fileno()))

0 comments on commit 0a6cf0f

Please sign in to comment.