Пример #1
0
def make_array(ea, size):
    if ea != idc.BADADDR and ea != 0:
        flags = idc.get_full_flags(ea)
        if not idc.isByte(flags) or idc.get_item_size(ea) != 1:
            idc.del_items(ea, idc.DOUNK_SIMPLE, 1)
            idc.MakeByte(ea)
        idc.MakeArray(ea, size)
Пример #2
0
def make_array(ea, size):
    if ea != idc.BADADDR and ea != 0:
        flags = idc.GetFlags(ea)
        if not idc.isByte(flags) or idc.ItemSize(ea) != 1:
            idc.MakeUnknown(ea, 1, idc.DOUNK_SIMPLE)
            idc.MakeByte(ea)
        idc.MakeArray(ea, size)
Пример #3
0
def make_array(ea, size):
  if ea != idc.BADADDR and ea != 0:
    flags = idc.GetFlags(ea)
    if not idc.isByte(flags) or idc.ItemSize(ea) != 1:
      idc.MakeUnknown(ea, 1, idc.DOUNK_SIMPLE)
      idc.MakeByte(ea)
    idc.MakeArray(ea, size)
Пример #4
0
	def datify(self):
		n = 0
		ea = self.get_start_ea(self.DATA)

		print "\nLooking for possible strings starting at: %s:0x%X" % (idc.SegName(ea), ea)

		for s in idautils.Strings():
			if s.ea > ea:
				if not idc.isASCII(idc.GetFlags(s.ea)) and idc.MakeStr(s.ea, idc.BADADDR):
					n += 1

		print "Created %d new ASCII strings" % n
	
		print "Converting remaining data to DWORDs...",
	
		while ea != idc.BADADDR:
			flags = idc.GetFlags(ea)
		            
			if idc.isUnknown(flags) or idc.isByte(flags):
				idc.MakeDword(ea)
				idc.OpOff(ea, 0, 0)

			ea = idc.NextAddr(ea)

		print "done.\n"
Пример #5
0
def make_array(ea, size):
  if ea != idc.BADADDR and ea != 0:
    flags = idc.get_full_flags(ea)
    if not idc.isByte(flags) or idc.get_item_size(ea) != 1:
      idc.del_items(ea, idc.DOUNK_SIMPLE, 1)
      idc.MakeByte(ea)
    idc.MakeArray(ea, size)
Пример #6
0
def make_array(ea, size):
  if ea != idc.BADADDR and ea != 0:
    flags = idc.get_full_flags(ea)
    if not idc.isByte(flags) or idc.get_item_size(ea) != 1:
      idc.del_items(ea, idc.DOUNK_SIMPLE, 1)
      ida_bytes.create_data(ea, ida_bytes.FF_BYTE, 1, ida_idaapi.BADADDR)
    idc.make_array(ea, size)
Пример #7
0
    def datify(self):
        ea = self.get_start_ea(self.DATA)
        if ea == idc.BADADDR:
            ea = idc.FirstSeg()

        print "Converting remaining data to DWORDs...",

        while ea != idc.BADADDR:
            flags = idc.GetFlags(ea)

            if idc.isUnknown(flags) or idc.isByte(flags):
                idc.MakeDword(ea)
                idc.OpOff(ea, 0, 0)

            ea = idc.NextAddr(ea)

        print "done."
Пример #8
0
    def datify(self):
        ea = self.get_start_ea(self.DATA)
        if ea == idc.BADADDR:
            ea = idc.FirstSeg()

        print "Converting remaining data to DWORDs...",

        while ea != idc.BADADDR:
            flags = idc.GetFlags(ea)

            if (idc.isUnknown(flags) or idc.isByte(flags)) and ((ea % 4) == 0):
                idc.MakeDword(ea)
                idc.OpOff(ea, 0, 0)

            ea = idc.NextAddr(ea)

        print "done."
Пример #9
0
    def datify(self):
        ea = self.get_start_ea(self.DATA)
        if ea == idc.BADADDR:
            ea = idc.FirstSeg()

        self.say("Converting remaining data to DWORDs...", )

        while ea != idc.BADADDR:
            flags = idc.GetFlags(ea)

            if (idc.isUnknown(flags) or idc.isByte(flags)) and ((ea % 4) == 0):
                idc.MakeDword(ea)
                idc.OpOff(ea, 0, 0)

            ea = idc.NextAddr(ea)

        self.say("done.")

        self._fix_data_offsets()
Пример #10
0
def _read_struct_member_once(ea, flags, size, member_sid, member_size, asobject):
    """Read part of a struct member for _read_struct_member."""
    if idc.isByte(flags):
        return read_word(ea, 1), 1
    elif idc.isWord(flags):
        return read_word(ea, 2), 2
    elif idc.isDwrd(flags):
        return read_word(ea, 4), 4
    elif idc.isQwrd(flags):
        return read_word(ea, 8), 8
    elif idc.isOwrd(flags):
        return read_word(ea, 16), 16
    elif idc.isASCII(flags):
        return idc.GetManyBytes(ea, size), size
    elif idc.isFloat(flags):
        return idc.Float(ea), 4
    elif idc.isDouble(flags):
        return idc.Double(ea), 8
    elif idc.isStruct(flags):
        value = read_struct(ea, sid=member_sid, asobject=asobject)
        return value, member_size
    return None, size
Пример #11
0
 def is_byte(self):
     return idc.isByte(self.flags)