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 2545bad + ec4087d commit c24a9acCopy full SHA for c24a9ac
lab7/sol.py
@@ -0,0 +1,14 @@
1
+import angr, sys
2
+
3
+def success_condition(state):
4
+ return b"Login successful" in state.posix.dumps(sys.stdout.fileno())
5
+def fail_condition(state):
6
+ return b"Login failed" in state.posix.dumps(sys.stdout.fileno())
7
8
+proj = angr.Project('./login')
9
+init_state = proj.factory.entry_state()
10
+simulation = proj.factory.simgr(init_state)
11
+simulation.explore(find = success_condition, avoid = fail_condition)
12
13
+solution = simulation.found[0]
14
+print(solution.posix.dumps(sys.stdin.fileno()))
0 commit comments