def brute(i):
global flag
global last_breakpoint
for c in charset:
flag[i] = c
output = gdb.execute('r < <(echo {})'.format(shlex.quote(''.join(flag))), True, True)
# skip floating point exception
while "SIGFPE" in output:
output = gdb.execute('c', True, True)
output = gdb.execute('x $pc', True, True)
pc = output.split(":")[0]
pc = int(pc, 16)
if pc > last_breakpoint:
last_breakpoint = pc
break
print(''.join(flag))
评论列表
文章目录