Esempio n. 1
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
Esempio n. 2
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 ida_bytes.is_byte(flags):
        return read_word(ea, 1), 1
    elif ida_bytes.is_word(flags):
        return read_word(ea, 2), 2
    elif ida_bytes.is_dword(flags):
        return read_word(ea, 4), 4
    elif ida_bytes.is_qword(flags):
        return read_word(ea, 8), 8
    elif ida_bytes.is_oword(flags):
        return read_word(ea, 16), 16
    elif ida_bytes.is_strlit(flags):
        return idc.get_bytes(ea, size), size
    elif ida_bytes.is_float(flags):
        return idc.Float(ea), 4
    elif ida_bytes.is_double(flags):
        return idc.Double(ea), 8
    elif ida_bytes.is_struct(flags):
        value = read_struct(ea, sid=member_sid, asobject=asobject)
        return value, member_size
    return None, size