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 f1738e8 + 91f9c86 commit e78b3b8Copy full SHA for e78b3b8
lab7/sol.py
@@ -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