Example #1
0
 def remove(cls, mid):
     '''Remove the enumeration member with the given `mid`.'''
     eid, value = cls.parent(mid), cls.value(mid)
     # XXX: is a serial of 0 valid?
     res = idaapi.del_enum_member(eid, value, 0, idaapi.BADADDR & cls.mask(mid))
     if not res:
         raise E.DisassemblerError(u"{:s}.member.remove({:#x}) : Unable to remove member from enumeration.".format(__name__, mid))
     return res
Example #2
0
 def remove(cls, mid):
     '''Remove the enumeration member with the given `mid`.'''
     eid, value = cls.parent(mid), cls.value(mid)
     # XXX: is a serial of 0 valid?
     res = idaapi.del_enum_member(eid, value, 0, idaapi.BADADDR & cls.mask(mid))
     if not res:
         raise E.DisassemblerError(u"{:s}.member.remove({:#x}) : Unable to remove member from enumeration.".format(__name__, mid))
     return res
Example #3
0
 def _remove(cls, identifier):
     '''Given a member id, remove it from it's enumeraiton'''
     value = cls.value(identifier)
     # XXX: is a serial of 0 valid?
     res = idaapi.del_enum_member(cls.parent(identifier), value, 0, -1&cls.bmask(identifier))
     if not res:
         raise Exception, "enum.member._remove(%x):Unable to remove enum member"% identifier
     return res
Example #4
0
    def remove(self, name):
        """Remove an enum member by name"""
        member = self[name]
        serial = member.serial
        value = member.value
        bmask = member.bmask

        success = idaapi.del_enum_member(self._eid, value, serial, bmask)
        if not success:
            raise exceptions.CantDeleteEnumMember("Can't delete enum member {!r}.".format(name))
Example #5
0
 def remove(cls, mid):
     '''Remove the enumeration member with the given ``mid``.'''
     value = cls.value(mid)
     # XXX: is a serial of 0 valid?
     res = idaapi.del_enum_member(cls.parent(mid), value, 0,
                                  -1 & cls.mask(mid))
     if not res:
         raise LookupError(
             "{:s}.member._remove({:x}) : Unable to remove member from enumeration."
             .format(__name__, mid))
     return res
Example #6
0
 def __call__(self):
     idaapi.del_enum_member(self.id, self.value, self.serial, self.bmask)
Example #7
0
 def __call__(self):
     idaapi.del_enum_member(idaapi.get_enum(self.ename.encode('utf-8')),
                            self.value, self.serial, self.bmask)