Пример #1
0
  def run(self, arg):
    global qira_address
    idaapi.msg("[QIRA Plugin] Syncing with Qira\n")


    # sync names
    for i in range(idaapi.get_nlist_size()):
      ws_send("setname 0x%x %s" % (idaapi.get_nlist_ea(i), idaapi.get_nlist_name(i)))

    # sync comment
    addr = idaapi.get_segm_base(idaapi.get_first_seg())
    while addr != idaapi.BADADDR:
      for rpt in [True, False]:
        update_comment(addr, rpt)
      addr = idaapi.nextaddr(addr)
Пример #2
0
    def send_comments(self):
        start = idaapi.get_segm_base(idaapi.get_first_seg())
        cur = start
        while True:
            if cur != idc.BADADDR:
                cmt = idaapi.get_cmt(cur, 0)
                if (cmt is not None) and (cmt != idc.BADADDR):
                    self.cmd = "setcmt 0x%x %s" % (cur, cmt)
                    # debugging
                    if DEBUG:
                        idaapi.msg(
                            "[%s] send_comments: EA [0x%x], Comment [%s]\n" %
                            (self.wanted_name, cur, cmt,))
                    self.ws_send(self.cmd)
            else:
                break
            cur = idc.NextAddr(cur)

        return True
Пример #3
0
                else:
                    _position = _position + numName * 2
                _count = _count + 1

        final_map = "\n\n " + modName + "\n" + map_header + map_origin + map_body + map_content + "\nProgram entry point at " + _entry + "\n"
        print final_map
        data = final_map.split('\n')

    else:
        with open(filename, "r") as f:
            data = f.read().split('\n')

    real_base = {}
    map_base = {}

    real_base['DGROUP'] = idaapi.get_segm_base(idaapi.get_segm_by_name("DATA"))
    real_base['IGROUP'] = idaapi.get_segm_base(idaapi.get_segm_by_name("TEXT"))
    real_base['_TEXT'] = idaapi.get_segm_base(
        idaapi.get_segm_by_name("TEXT"))  # just add _TEXT for now

    insection = None

    for line in data:
        if line.strip() == 'Origin   Group':
            insection = "groups"
        elif line.strip() == 'Address         Publics by Value':
            insection = "publics_"
        elif line.strip() == '' and insection == "publics_":
            insection = "publics"
        elif line.strip() == '':
            insection = None