We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7423d27 + 53d7d7b commit 9f15c1cCopy full SHA for 9f15c1c
lab7/sol.py
@@ -0,0 +1,22 @@
1
+import angr
2
+import sys
3
+
4
+def is_login_successful(state):
5
+ output = state.posix.dumps(sys.stdout.fileno())
6
+ return b"Login successful" in output
7
8
+def is_login_failed(state):
9
10
+ return b"Login failed" in output
11
12
13
+proj = angr.Project('./login')
14
+initial_state = proj.factory.entry_state()
15
+sim_manager = proj.factory.simgr(initial_state)
16
17
18
+sim_manager.explore(find=is_login_successful, avoid=is_login_failed)
19
20
21
+solution = sim_manager.found[0]
22
+print(solution.posix.dumps(sys.stdin.fileno()))
0 commit comments