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 fc33a4b commit 32564bbCopy full SHA for 32564bb
lab7/sol.py
@@ -0,0 +1,20 @@
1
+import angr
2
+import sys
3
+
4
+def main():
5
+ def success(state):
6
+ return b"Login successful" in state.posix.dumps(sys.stdout.fileno())
7
8
+ def failed(state):
9
+ return b"Login failed" in state.posix.dumps(sys.stdout.fileno())
10
11
+ proj = angr.Project('./login')
12
+ init_state = proj.factory.entry_state()
13
+ simulation = proj.factory.simgr(init_state)
14
15
+ simulation.explore(find=success, avoid=failed)
16
+ solution = simulation.found[0]
17
+ print(solution.posix.dumps(sys.stdin.fileno()))
18
19
+if __name__ == '__main__':
20
+ main()
0 commit comments