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.
1 parent 5f1137a commit 450f1b4Copy full SHA for 450f1b4
lab7/sol.py
@@ -0,0 +1,14 @@
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
+simulation.explore(find=success_condition, avoid=fail_condition)
13
+solution = simulation.found[0]
14
+print(solution.posix.dumps(sys.stdin.fileno()))
0 commit comments