Beispiel #1
0
 def visit_enum_member(self, cid, val):
     for cmt_type in (True, False):
         cmt = idaapi.get_enum_member_cmt(cid, cmt_type)
         if cmt:
             new_cmt = rebase_comment(self.segs, self.delta, cmt)
             if new_cmt:
                 idaapi.set_enum_member_cmt(cid, new_cmt, cmt_type)
     return 0
Beispiel #2
0
    def comment(cls, mid, comment, **repeatable):
        """Set the comment for the enumeration member id `mid` to `comment`.

        If the bool `repeatable` is specified, then set the repeatable comment.
        """
        return idaapi.set_enum_member_cmt(mid, comment,
                                          kwds.get('repeatable', True))
Beispiel #3
0
    def comment(cls, mid, comment, **repeatable):
        """Set the comment for the enumeration member id `mid` to `comment`.

        If the bool `repeatable` is specified, then set the repeatable comment.
        """
        res = utils.string.to(comment)
        return idaapi.set_enum_member_cmt(mid, res, repeatable.get('repeatable', True))
Beispiel #4
0
    def comment(cls, mid, comment, **repeatable):
        """Set the comment for the enumeration member id `mid` to `comment`.

        If the bool `repeatable` is specified, then set the repeatable comment.
        """
        if not interface.node.is_identifier(mid):
            raise E.MemberNotFoundError(u"{:s}.comment({:#x}, {!r}) : Unable to locate member by the specified identifier.".format('.'.join((__name__, cls.__name__)), mid, comment))
        res = utils.string.to(comment)
        return idaapi.set_enum_member_cmt(mid, res, repeatable.get('repeatable', True))
Beispiel #5
0
 def repeat(self, comment):
     success = idaapi.set_enum_member_cmt(self._cid, comment, True)
     if not success:
         raise exceptions.CantSetEnumMemberComment("Cant set enum member comment.")
Beispiel #6
0
 def comment(identifier, comment=None, repeatable=True):
     '''Given a member id, fetch/set it's /comment/'''
     if comment is None:
         return idaapi.get_enum_member_cmt(identifier, repeatable)
     return idaapi.set_enum_member_cmt(identifier, comment, repeatable)