Exemplo n.º 1
0
def read_bytes_slowly(start, end):
    bytestr = []
    for i in xrange(start, end):
        if idc.has_value(idc.get_full_flags(i)):
            bt = idc.get_wide_byte(i)
            bytestr.append(chr(bt))
        else:
            bytestr.append("\x00")
    return "".join(bytestr)
Exemplo n.º 2
0
def read_bytes_slowly(start, end):
  bytestr = []
  for i in xrange(start, end):
    if idc.has_value(idc.get_full_flags(i)):
      bt = idc.get_wide_byte(i)
      bytestr.append(chr(bt))
    else:
      bytestr.append("\x00")
  return "".join(bytestr)
Exemplo n.º 3
0
def read_bytes_slowly(start, end):
    bytestr = bytearray()
    for i in xrange(start, end):
        if idc.has_value(idc.get_full_flags(i)):
            bt = idc.get_wide_byte(i)
            bytestr.append(bt)
        else:
            bytestr.append(0)
    return bytes(bytestr)
Exemplo n.º 4
0
    def has_data(self):
        """
            Property which indicate if an element has a value. If an element
            has no value a default value of ``0xFF`` will be returned in
            general. This correspond to element in IDA which are marked with
            a ``?`` in value. Wrapper on ``idc.has_value``.

            :return: True if the current element has a value, False otherwise.
        """
        return idc.has_value(self.flags)
Exemplo n.º 5
0
 def getSegmentDefinedSize(self, addr):
     size = 0
     segEnd = self.getSegmentEnd(addr)
     addr = self.getSegmentStart(addr)
     while idc.has_value(idc.get_full_flags(addr)):
         if addr >= segEnd:
             break
         size += 1
         addr += 1
     return size