Exemplo n.º 1
0
    def comment(cls, mid, **repeatable):
        """Return the comment for the enumeration member `mid`.

        If the bool `repeatable` is specified, then return the repeatable comment.
        """
        return idaapi.get_enum_member_cmt(mid,
                                          repeatable.get('repeatable', True))
Exemplo n.º 2
0
    def comment(cls, mid, **repeatable):
        """Return the comment for the enumeration member `mid`.

        If the bool `repeatable` is specified, then return the repeatable comment.
        """
        res = idaapi.get_enum_member_cmt(mid, repeatable.get('repeatable', True))
        return utils.string.of(res)
Exemplo n.º 3
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
Exemplo n.º 4
0
    def comment(cls, mid, **repeatable):
        """Return the comment for the enumeration member `mid`.

        If the bool `repeatable` is specified, then return the repeatable comment.
        """
        if not interface.node.is_identifier(mid):
            raise E.MemberNotFoundError(u"{:s}.comment({:#x}) : Unable to locate member by the specified identifier.".format('.'.join((__name__, cls.__name__)), mid))
        res = idaapi.get_enum_member_cmt(mid, repeatable.get('repeatable', True))
        return utils.string.of(res)
Exemplo n.º 5
0
 def repeat(self):
     return idaapi.get_enum_member_cmt(self._cid, True)
Exemplo n.º 6
0
 def regular(self):
     return idaapi.get_enum_member_cmt(self._cid, False)
Exemplo n.º 7
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)