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))
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))
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))
def repeat(self, comment): success = idaapi.set_enum_cmt(self._eid, comment, True) if not success: raise exceptions.CantSetEnumComment("Cant set enum comment.")
def __call__(self): idaapi.set_enum_cmt(self.tid, self.cmt.encode('utf-8'), self.repeatable_cmt)
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)
def __call__(self): idaapi.set_enum_cmt(self.tid, self.cmt, self.repeatable_cmt)
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)