Пример #1
0
def handle_enums(delta, segs):
    for idx in range(idaapi.get_enum_qty()):
        e = idaapi.getn_enum(idx)
        for cmt_type in (True, False):
            cmt = idaapi.get_enum_cmt(e, cmt_type)
            if cmt:
                new_cmt = rebase_comment(segs, delta, cmt)
                if new_cmt:
                    idaapi.set_enum_cmt(e, new_cmt, cmt_type)
        idaapi.for_all_enum_members(e, enum_memb_visitor(segs, delta))
Пример #2
0
def comment(enum, comment, **repeatable):
    """Set the comment for the enumeration `enum` to `comment`.

    If the bool `repeatable` is specified, then modify the repeatable comment.
    """
    eid, res = by(enum), utils.string.to(comment)
    return idaapi.set_enum_cmt(eid, res, repeatable.get('repeatable', True))
Пример #3
0
def comment(enum, comment, **repeatable):
    """Set the comment for the enumeration `enum` to `comment`.

    If the bool `repeatable` is specified, then modify the repeatable comment.
    """
    eid, res = by(enum), utils.string.to(comment)
    return idaapi.set_enum_cmt(eid, res, repeatable.get('repeatable', True))
Пример #4
0
def comment(enum, comment, **repeatable):
    """Set the comment for the enumeration identified by ``enum`` to ``comment``.
    If the bool ``repeatable`` is specified, then modify the repeatable comment.
    """
    eid = by(enum)
    return idaapi.set_enum_cmt(eid, comment,
                               repeatable.get('repeatable', True))
Пример #5
0
 def repeat(self, comment):
     success = idaapi.set_enum_cmt(self._eid, comment, True)
     if not success:
         raise exceptions.CantSetEnumComment("Cant set enum comment.")
Пример #6
0
 def __call__(self):
     idaapi.set_enum_cmt(self.tid, self.cmt.encode('utf-8'),
                         self.repeatable_cmt)
Пример #7
0
def comment(identifier, comment=None):
    '''Given an enum id, get/set it's /comment/'''
    if commment is None:
        return idaapi.get_enum_cmt(identifier)
    return idaapi.set_enum_cmt(identifier, comment)
Пример #8
0
 def __call__(self):
     idaapi.set_enum_cmt(self.tid, self.cmt, self.repeatable_cmt)
Пример #9
0
 def __call__(self):
     idaapi.set_enum_cmt(
         idaapi.get_enum_member_by_name(self.emname.encode('utf-8')),
         self.cmt.encode('utf-8') if self.cmt else '', self.repeatable_cmt)