Ejemplo n.º 1
0
 def saveDatabase(self):
     cur = self.db.cursor()
     sql = """insert into functions (name, processor, nodes, edges, points, size, instructions, mnemonics, prototype)
                             values (?, ?, ?, ?, ?, ?, ?, ?, ?)"""
     
     for row in self.functions:
         name, nodes, edges, points, size, instructions, mnems, prototype = self.functions[row]
         cur.execute(sql, (name, idaapi.get_idp_name(), nodes, edges, points, size, instructions, str(mnems), prototype))
     
     self.db.commit()
     cur.close()
     return True
Ejemplo n.º 2
0
    def saveDatabase(self):
        cur = self.db.cursor()
        sql = """insert into functions (name, processor, nodes, edges, points, size, instructions, mnemonics)
                                values (?, ?, ?, ?, ?, ?, ?, ?)"""

        for row in self.functions:
            name, nodes, edges, points, size, instructions, mnems = self.functions[
                row]
            cur.execute(sql, (name, idaapi.get_idp_name(), nodes, edges,
                              points, size, instructions, str(mnems)))

        self.db.commit()
        cur.close()
        return True
Ejemplo n.º 3
0
 def searchExact(self, f):
     name, nodes, edges, points, size, instructions, mnems, prototype = f
     
     cur = self.db.cursor()
     sql = """ select name, prototype
                 from functions
                where processor = ?
                  and nodes = ?
                  and edges = ?
                  and points = ?
                  and size = ?
                  and instructions = ?
                  and mnemonics = ? """
     cur.execute(sql, (idaapi.get_idp_name(), nodes, edges, points, size, instructions, str(mnems)))
     
     res = None
     for row in cur.fetchall():
         res = row[0], row[1]
     
     cur.close()
     
     return res
Ejemplo n.º 4
0
    def searchExact(self, f):
        name, nodes, edges, points, size, instructions, mnems = f

        cur = self.db.cursor()
        sql = """ select name
                    from functions
                   where processor = ?
                     and nodes = ?
                     and edges = ?
                     and points = ?
                     and size = ?
                     and instructions = ?
                     and mnemonics = ? """
        cur.execute(sql, (idaapi.get_idp_name(), nodes, edges, points, size,
                          instructions, str(mnems)))

        res = None
        for row in cur.fetchall():
            res = row[0]

        cur.close()

        return res
Ejemplo n.º 5
0
 def nw_database_init(cls, nw_code, is_old_database):
     idp_modname = idaapi.get_idp_name()
     return cls.database_init(idp_modname)
Ejemplo n.º 6
0
def nw_on_init(nw_code, is_old_database):
    idp_modname = idaapi.get_idp_name()
    return on_init(idp_modname)
Ejemplo n.º 7
0
 def __nw_init_tagcache__(cls, nw_code, is_old_database):
     idp_modname = idaapi.get_idp_name()
     return cls.__init_tagcache__(idp_modname)
Ejemplo n.º 8
0
 def getArch(self):
     return idaapi.get_idp_name()
Ejemplo n.º 9
0
 def getArch(self):
     return idaapi.get_idp_name()