def parseLSSharedFileListPlist(self, mru_file): plist = self.load_bplist(mru_file) if plist == None: return [] bookmarks = [] try: for n, item in enumerate( plist["RecentDocuments"]["CustomListItems"]): bookmarks.append(Bookmark(data=item["Bookmark"]).parse()) except Exception as e: pass return bookmarks
def parseRecentItemsPlist(self, mru_file): plist = self.load_bplist(mru_file) if plist == None: return [], [] bookmarks = [] aliases = [] try: for n, item in enumerate( plist["RecentApplications"]["CustomListItems"]): bookmarks.append(Bookmark(data=item["Bookmark"]).parse()) except: pass try: for n, item in enumerate( plist["RecentDocuments"]["CustomListItems"]): bookmarks.append(Bookmark(data=item["Bookmark"]).parse()) except: pass try: for n, item in enumerate( plist["RecentServers"]["CustomListItems"]): bookmarks.append(Bookmark(data=item["Bookmark"]).parse()) except: pass try: for n, item in enumerate(plist["Applications"]["CustomListItems"]): aliases.append(Alias(data=item["Alias"]).parse()) except: pass try: for n, item in enumerate(plist["Documents"]["CustomListItems"]): aliases.append(Alias(data=item["Alias"]).parse()) except: pass try: for n, item in enumerate(plist["Servers"]["CustomListItems"]): aliases.append(Alias(data=item["Alias"]).parse()) except: pass return bookmarks, aliases
def parseSFL(self, mru_file): plist_objects = self.load_plist_objects(mru_file) if plist_objects == None: return [] bookmarks = [] try: if plist_objects["root"]["NS.keys"][2] == "items": items = plist_objects["root"]["NS.objects"][2]["NS.objects"] for n, item in enumerate(items): if "LSSharedFileList.RecentHosts" not in mru_file: bookmarks.append( Bookmark(data=item["bookmark"]).parse()) except Exception as e: pass return bookmarks
def parseMSOffice2016Plist(self, mru_file): bookmarks = [] try: plistfile = plistlib.readPlist(mru_file) for n, item in enumerate(plistfile): try: bookmarkdata = plistfile[item]["kBookmarkDataKey"] for attr, blob in bookmarkdata.__dict__.items(): try: bookmarks.append(Bookmark(data=blob).parse()) except: pass except: pass except: pass return bookmarks
def parseSFL2_FavoriteVolumes(self, mru_file): plist_objects = self.load_plist_objects(mru_file) if plist_objects == None: return [] bookmarks = [] try: if plist_objects["root"]["NS.keys"][0] == "items": items = plist_objects["root"]["NS.objects"][0]["NS.objects"] for n, item in enumerate(items): attribute_keys = plist_objects["root"]["NS.objects"][0][ "NS.objects"][n]["NS.keys"] attribute_values = plist_objects["root"]["NS.objects"][0][ "NS.objects"][n]["NS.objects"] attributes = dict(zip(attribute_keys, attribute_values)) if "LSSharedFileList.RecentHosts" not in mru_file: bookmarks.append( Bookmark(data=attributes["Bookmark"]).parse()) except Exception as e: pass return bookmarks
def parseFinderPlist(self, mru_file): plist = self.load_bplist(mru_file) if plist == None: return [], [] bookmarks = [] aliases = [] try: for n, item in enumerate(plist["FXRecentFolders"]): try: bookmarks.append( Bookmark(data=item["file-bookmark"]).parse()) except: pass try: pass aliases.append( Alias( data=item["file-data"]["_CFURLAliasData"]).parse()) except: pass except: pass return bookmarks, aliases