File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ def main():
99
1010 input_len = 8
1111 input_chars = [claripy .BVS ('' , 8 ) for _ in range (input_len )]
12- sym_input = claripy .Concat (* input_chars )
12+ sym_input = claripy .Concat (* input_chars , claripy . BVV ( 0 , 8 ) )
1313
1414 # Explicitly use SimFileStream with has_end=False
1515 stdin_stream = angr .SimFileStream (name = 'stdin' , content = sym_input , has_end = False )
1616
17- state = project .factory .full_init_state (stdin = stdin_stream )
17+ state = project .factory .entry_state (stdin = stdin_stream )
1818
1919
2020 for c in input_chars :
@@ -29,9 +29,10 @@ def is_successful(state):
2929 simgr .explore (find = is_successful )
3030
3131 if simgr .found :
32- found = simgr .found [0 ]
33- result = found .solver .eval (sym_input , cast_to = bytes )
34- sys .stdout .buffer .write (result )
32+ sol = simgr .found [0 ].solver .eval (claripy .Concat (* input_chars ), cast_to = bytes )
33+ print (sol .decode (), end = '' )
34+ else :
35+ print ("[-] No solution found." , end = '' )
3536
3637
3738if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments