child.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:amphitrite 作者: cosine0 项目源码 文件源码
def convert_string_to_variable(address, length=None):
    variables = []
    current_value = []
    if length is None:
        for p_byte in itertools.count(address):
            c = getCurrentMemoryValue(p_byte)
            if c == 0:
                break
            current_value.append(chr(c))
            setConcreteMemoryValue(p_byte, c)
            var_id = convertMemoryToSymbolicVariable(MemoryAccess(p_byte, 1)).getId()
            variables.append(var_id)
    else:
        for p_byte in xrange(address, address + length):
            c = getCurrentMemoryValue(p_byte)
            current_value.append(chr(c))
            setConcreteMemoryValue(p_byte, c)
            var_id = convertMemoryToSymbolicVariable(MemoryAccess(p_byte, 1)).getId()
            variables.append(var_id)
    return variables, ''.join(current_value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号