Esempio n. 1
0
def size(identifier, width=None):
    '''Given an enum id, get/set it's size'''
    if width is None:
        res = idaapi.get_enum_width(identifier)
        return 2**(res-1) if res > 0 else 0
    res = int(math.log(width, 2))
    return idaapi.set_enum_width(identifier, int(res)+1)
Esempio n. 2
0
def size(enum):
    '''Return the number of bytes for the enumeration `enum`.'''
    eid = by(enum)
    return idaapi.get_enum_width(eid)
Esempio n. 3
0
 def width(self):
     """Width of the enum"""
     return idaapi.get_enum_width(self.eid)
Esempio n. 4
0
def size(enum):
    '''Return the number of bits for the enumeration `enum`.'''
    eid = by(enum)
    res = idaapi.get_enum_width(eid)
    return res * 8
Esempio n. 5
0
def size(enum):
    '''Return the number of bits for the enumeration ``enum``.'''
    eid = by(enum)
    res = idaapi.get_enum_width(eid)
    return res * 8
Esempio n. 6
0
def size(enum):
    '''Return the size of the enumeration identified by ``enum``.'''
    eid = by(enum)
    res = idaapi.get_enum_width(eid)
    return 2**(res - 1) if res > 0 else 0