def value(cls, mid, value, **bitmask): """Set the `value` for the enumeration `member` belonging to `enum`. If the integer `bitmask` is specified, then use it as a bitmask. Otherwise assume all bits are set. """ bmask = bitmask.get('bitmask', idaapi.BADADDR & cls.mask(mid)) return idaapi.set_enum_member_value(mid, value, bmask)
def value(cls, mid, value, **bitmask): """Set the `value` for the enumeration `member` belonging to `enum`. If the integer `bitmask` is specified, then use it as a bitmask. Otherwise assume all bits are set. """ if not interface.node.is_identifier(mid): raise E.MemberNotFoundError(u"{:s}.value({:#x}, {:#x}) : Unable to locate member by the specified identifier.".format('.'.join((__name__, cls.__name__)), mid, value)) bmask = bitmask.get('bitmask', idaapi.BADADDR & cls.mask(mid)) return idaapi.set_enum_member_value(mid, value, bmask)
def value(cls, enum, member, value, **bitmask): """Set the ``value`` for the enumeration ``member`` belonging to ``enum``. If the integer ``bitmask`` is specified, then use it as a bitmask. Otherwise assume all bits are set. """ eid = by(enum) mid = cls.by(enum, member) #bmask = bitmask.get('bitmask', -1 & mask(eid)) bmask = bitmask.get('bitmask', -1 & cls.mask(mid)) return idaapi.set_enum_member_value(mid, value, bmask)
def value(identifier, value=None, **kwds): '''Given a member id, fetch/set it's /value/''' if value is None: return idaapi.get_enum_member_value(identifier) bmask = kwds.get('mask', -1&mask(enum)) return idaapi.set_enum_member_value(identifier, value, bmask)