Skip to content

Commit 3e3e824

Browse files
authored
Update sol.py
1 parent 3a9853d commit 3e3e824

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lab7/sol.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import angr
2+
proj = angr.Project('./login', auto_load_libs=False)
3+
start_state = proj.factory.entry_state()
4+
simgr = proj.factory.simgr(start_state)
5+
6+
simgr.explore(find=lambda s: b'Login success' in s.posix.dumps(1))
7+
8+
if simgr.found:
9+
solution_state = simgr.found[0]
10+
password = solution_state.posix.dumps(0).strip()
11+
print(password.decode())
12+
else:
13+
print("Password not found.")

0 commit comments

Comments
 (0)