def showWhatsapp(self): if self.iOSVersion == IPHONE_UNSUPPORTED: QtGui.QMessageBox.information(self, "Information", "Unsupported iOS version...") return if self.extractpath == None: dir = self.work_dir else: dir = self.extractpath self.cursor.execute("select * from indice where mbapp_name Like '%Whatsapp%' order by domain") records = self.cursor.fetchall() if len(records) == 0: QtGui.QMessageBox.information(self, "Information", "Whatsapp not found...") return for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) path2appdomain = "AppDomain/net.whatsapp.WhatsApp" if self.iOSVersion == IPHONE_VERSION8: path2groupdomain = "AppDomainGroup/group.net.whatsapp.WhatsApp.shared" else: path2groupdomain = None self.whatsappUI = whatsappGUI(path2appdomain, path2groupdomain, self.work_dir) self.whatsappUI.show() return
def extractApp(self): if self.is_active == False: return selectedItem = self.ui.treeViewDomains.currentItem() if self.backuppath is None: msg = "No iOS Backup open..." self.informationMessage(msg) return if (self.extractpath == None) or (len(self.extractpath) == 0): self.extractpath = self.getFilepathDialog(self.backuppath) if (self.extractpath == None) or (len(self.extractpath) == 0): return None if selectedItem.text(4) == "AppDomain": search = '%' + selectedItem.text(0) + '%' self.cursor.execute("Select * from indice where mbapp_name like ?", (search,)) else: search = '%' + selectedItem.text(0) + '%' self.cursor.execute("Select * from indice where mbdomain_type = ? and mbfile_path like ?", (selectedItem.text(4),search)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, self.extractpath)
def showThreema(self): if self.isSubWindowOpen("threemaGUI") == True: return mbdomain_type = "AppDomain" mbapp_name = "ch.threema.iapp" if self.extractpath == None: dir = self.work_dir else: dir = self.extractpath self.cursor.execute("Select * from indice where mbdomain_type=? and mbapp_name= ?", (mbdomain_type,mbapp_name)) records = self.cursor.fetchall() if len(records) == 0: QtGui.QMessageBox.information(self, "Information", "Threema not found...") return for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) threemaDB = dir + "/" + mbdomain_type + "/" + mbapp_name + "/Documents/ThreemaData.sqlite" self.threemaUI = threemaGUI(threemaDB, dir) self.threemaUI.show()
def showCallHistory(self): if self.extractpath == None: dir = self.work_dir else: dir = self.extractpath if self.iOSVersion == IPHONE_UNSUPPORTED: QtGui.QMessageBox.information(self, "Information", "Unsupported iOS version...") return if self.iOSVersion == IPHONE_VERSION6 or self.iOSVersion == IPHONE_VERSION7: mbdomain_type = "WirelessDomain" mbfile_name = "call_history.db" elif self.iOSVersion == IPHONE_VERSION8: mbdomain_type = "HomeDomain" mbfile_name = "CallHistory.storedata" self.cursor.execute("Select * from indice where mbdomain_type=? and mbfile_name= ?", (mbdomain_type,mbfile_name)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) callhistorydb = dir + "/" + dbrecord.mbdomain_type + "/" + str(dbrecord.mbfile_path) + "/" + dbrecord.mbfile_name mbdomain_type = "HomeDomain" mbapp_name = "Library/AddressBook" self.cursor.execute("Select * from indice where mbdomain_type=? and mbfile_path= ?", (mbdomain_type,mbapp_name)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) abook = dir + "/HomeDomain/Library/AddressBook/AddressBook.sqlitedb" abimg = dir + "/HomeDomain/Library/AddressBook/AddressBookImages.sqlitedb" self.callhistoryUI = callhistoryGUI(callhistorydb, abook) self.callhistoryUI.show() return
def showMessages(self): if self.isSubWindowOpen("smsGUI") == True: return if self.extractpath == None: dir = self.work_dir else: dir = self.extractpath mbdomain_type = "HomeDomain" mbapp_name = "Library/AddressBook" self.cursor.execute("Select * from indice where mbdomain_type=? and mbfile_path= ?", (mbdomain_type,mbapp_name)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) mbdomain_type = "HomeDomain" mbapp_name = "Library/SMS" self.cursor.execute("Select * from indice where mbdomain_type=? and mbfile_path= ?", (mbdomain_type,mbapp_name)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) abook = dir + "/HomeDomain/Library/AddressBook/AddressBook.sqlitedb" abimg = dir + "/HomeDomain/Library/AddressBook/AddressBookImages.sqlitedb" sms = dir + "/HomeDomain/Library/SMS/sms.db" self.smsUI = smsGUI(sms, abook, abimg) self.smsUI.show()
def showPicture(self, mbd, mbf): mbdomain_type = mbd mbfile_name = mbf self.cursor.execute("Select * from indice where mbdomain_type = ? and mbfile_name like ?", (mbdomain_type,mbfile_name)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) image_data = self.mbdb.readBackupFile(dbrecord) qimg = QtGui.QImage.fromData(image_data) qimg = qimg.scaled(800,600).scaled(400,300, QtCore.Qt.IgnoreAspectRatio, QtCore.Qt.SmoothTransformation) pixmap = QtGui.QPixmap.fromImage(qimg) self.w = ImageViewer(pixmap, self.ui.treeViewDomains) self.w.setWindowTitle(mbf) self.w.show()
def showSQLite(self, mbd, mbf): mbdomain_type = mbd mbfile_name = mbf if self.extractpath == None: dir = self.work_dir else: dir = self.extractpath self.cursor.execute("Select * from indice where mbdomain_type=? and mbfile_name= ?", (mbdomain_type,mbfile_name)) records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, dir) sqlitedb = dir + "/" + dbrecord.mbdomain_type + "/" + str(dbrecord.mbfile_path) + "/" + dbrecord.mbfile_name self.sqlbrowserUI = sqlBrowserGUI(sqlitedb, dir, dbrecord.mbfile_name) self.sqlbrowserUI.show()
def extractAll(self): if self.is_active == False: return if self.backuppath is None: msg = "No iOS Backup open..." self.informationMessage(msg) return if (self.extractpath == None) or (len(self.extractpath) == 0): self.extractpath = self.getFilepathDialog(self.backuppath) if (self.extractpath == None) or (len(self.extractpath) == 0): return None # msg = "Will extract App %s to path %s" % (selectedItem.text(0), self.extractpath) # self.informationMessage(msg) self.cursor.execute("Select * from indice") records = self.cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) self.mbdb.extract_backup_from_db(dbrecord, self.extractpath)
def extract_backup(backup_path, output_path, password="", app=None): ''' if not os.path.exists(backup_path + "/Manifest.plist"): print "Manifest.plist not found" return manifest = readPlist(backup_path + "/Manifest.plist") ''' manifest = readManifest(backup_path) if manifest is None: print("Manifest.plist not found") return # dict = manifest['Applications'] # for apps in dict.iteritems(): # print "App Name: " + apps[0] # for key, value in apps[1].iteritems(): # print key + " : " + value # print "####################################" showinfo = readInfo(backup_path) if showinfo is None: print("Info.plist not found") return for i in showinfo: value = unicode(showinfo.get(i, "missing")) if i == "Product Type": value = value + " (" + getIDeviceProductName(value) + ")" print(i + " : " + value + "...") # print "Extract backup to %s ? (y/n)" % output_path # if raw_input() == "n": # return print("Backup is %sencrypted" % (int(not manifest["IsEncrypted"]) * "not ")) if manifest["IsEncrypted"] and password == "": print ("Enter backup password : "******"BackupKeyBag"): print ("No BackupKeyBag in manifest, assuming iOS 3.x backup") decrypt_backup3(backup_path, output_path, password) else: mbdb = MBDB(backup_path) kb = Keybag.createWithBackupManifest(manifest, password) if not kb: return manifest["password"] = password makedirs(output_path) plistlib.writePlist(manifest, output_path + "/Manifest.plist") mbdb.keybag = kb database, cursor = iOSBackupDB() store2db(cursor, mbdb) database.commit() print_domains(cursor) cursor.execute("Select * from indice where mbapp_name= ?", (app,)) records = cursor.fetchall() for record in records: dbrecord = MBFileRecordFromDB(record) mbdb.extract_backup_from_db(dbrecord, output_path)