Skip to content

Commit e78b3b8

Browse files
authored
Merge pull request #592 from gren26/lab7
[LAB7] 512558008
2 parents f1738e8 + 91f9c86 commit e78b3b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lab7/sol.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import angr
2+
import sys
3+
4+
proj = angr.Project('./login')
5+
init_state = proj.factory.entry_state()
6+
simulation = proj.factory.simgr(init_state)
7+
def success_condition(state):
8+
return b"Login successful" in state.posix.dumps(sys.stdout.fileno())
9+
10+
def fail_condition(state):
11+
return b"Login failed" in state.posix.dumps(sys.stdout.fileno())
12+
13+
simulation.explore(find=success_condition, avoid=fail_condition)
14+
found = simulation.found[0]
15+
print(found.posix.dumps(0))

0 commit comments

Comments
 (0)