def make_comments(comments, base, remote_base): if not comments: return ptrdiff = remote_base - base for cmt in comments: if not is_valid_addr(cmt.ea + ptrdiff): continue api.QuickinsertnameW(cmt.ea + ptrdiff, api.NM_COMMENT, truncate_text_to_max(cmt.name)) api.Mergequickdata() api.Redrawcpudisasm()
def make_names(names, base, remote_base): if not names: return ptrdiff = 0 if base != remote_base: ptrdiff = remote_base - base for n in names: if not is_valid_addr(n.ea + ptrdiff): continue api.QuickinsertnameW(n.ea + ptrdiff, api.NM_LABEL, truncate_text_to_max(str(n.name).decode('utf8'))) api.Mergequickdata() api.Redrawcpudisasm()