-
-
Save felberj/99f50660b6adf9740d34d51363e6090c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p = angr.Project(exe) | |
stdin = simuvex.storage.file.SimFile("/dev/stdin", "r", size=flag_len) | |
files = {'/dev/stdin': stdin} | |
st = p.factory.entry_state(fs=files) | |
state = st | |
for j in xrange(flag_len): | |
byte = stdin.read_from(1) | |
state.add_constraints(byte >= ord('a')) | |
state.add_constraints(byte <= ord('r')) | |
for i in xrange(ord('a'), ord('r')): | |
if chr(i) in ['a','b','d','l','r','u']: | |
continue | |
state.add_constraints(byte != i) | |
stdin.seek(0) | |
path = p.factory.path(state=st) | |
ex = p.surveyors.Explorer(start=path, find=(good, ), avoid=(bad,)) | |
ex.run() |
Author
felberj
commented
May 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment