如何限制 angr 程序中的搜索

问题描述

假设我有一个程序试图破解一个标志,就像 python 中使用 angr 的这个程序:

#!/usr/bin/env python

import angr
import claripy

FLAG_LEN = 15
STDIN_FD = 0
find_addr = 0x001016af
avoid_addr = 0x00100fab
base_addr = 0x00100000

proj = angr.Project("./runnable",main_opts={'base_addr': base_addr}) 
flag_chars = [claripy.BVS('flag_%d' % i,8) for i in range(FLAG_LEN)]
flag = claripy.Concat( *flag_chars + [claripy.BVV(b'\n')]) 

state = proj.factory.full_init_state(
       args=['./runnable'],add_options=angr.options.unicorn,stdin=flag,)


simgr = proj.factory.simulation_manager(state)
simgr.explore(find=find_addr,avoid=avoid_addr)


if (len(simgr.found) > 0):
   for found in simgr.found:
       print(found.posix.dumps(STDIN_FD))

我的代码目前没有返回任何内容,但我知道字符串的长度为 16,并且我知道秘密字符串的前 6 个字符是什么。我怎样才能将这个秘密字符串的搜索限制为以我知道的 6 个字符开头的内容

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)