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)
评论列表
文章目录