Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding:utf8
- import os
- import sys
- import pexpect
- def new_solve(ans):
- c = pexpect.spawn("./amida")
- if len(ans) == 0:
- return c
- for a in ans:
- c.expect('\?')
- c.send(a+"\n")
- return c
- if __name__ == '__main__':
- ans = []
- for count in range(1000):
- c = new_solve(ans)
- for i in range(1, 9):
- c.expect('\?')
- test = str(i)
- c.send(test + "\n")
- c.expect('\?|Wrong|FLAG\{.*?\}')
- response = c.after
- if response != 'Wrong':
- ans.append(test)
- print "collect " + test + ' ' + str(count)
- print response
- break
- else:
- print "wrong " + test + ' ' + str(count)
- c = new_solve(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement