Exemple #1
0
 def _add_master_account(self):
     plist = PlistHelper.ReadPlist(self.root)
     account = model_im.Account()
     account.source = self.root.AbsolutePath
     account.account_id = account.nickname = account.username = plist[
         'WXLogUtils_lastUsernick'].ToString()
     self.im.db_insert_table_account(account)
     self.im.db_commit()
Exemple #2
0
 def get_order_ticket_method_two(self):
     order_node = self.root.Parent.Parent.GetByPath(
         "Library/Caches/CTMyCtrip")
     if order_node is None:
         return
     for filename in order_node.Files:
         if filename.Name.startswith("pocketData_V2_"):
             plist = PlistHelper.ReadPlist(filename)
             object_list = list(plist["$objects"])
             for i in object_list:
                 if len(str(i)) == 64:
                     self.auth_dicts[str(i)] = filename.Name[14:25].lower()
Exemple #3
0
 def get_master_account(self):
     node = self.node.GetByPath(
         'Documents/TBSUserInfo/TBSettingsUserInfo.json')
     if node is None:
         return
     p = PlistHelper.ReadPlist(node)
     if p is not None:
         try:
             self.master_account = p['userId'].ToString()
         except:
             traceback.print_exc()
             return
Exemple #4
0
 def _generate_search_table(self):
     search_log_by_code = self._search_file("searchFlightByCode.txt$")
     if not search_log_by_code:
         return
     file_data = PlistHelper.ReadPlist(search_log_by_code)
     if file_data is None:
         return
     for d in file_data:
         try:
             search = model_im.Search()
             key = d['flightNo']
             search.key = key
             search.account_id = self.master_account.account_id
             self.model_im_col.db_insert_table_search(search)
         except Exception as e:
             self.logger.error()
     self.model_im_col.db_commit()
Exemple #5
0
 def __init__(self, app_root_dir, extract_deleted, extract_source):
     self.root = app_root_dir
     self.nickname = ''
     self.models = []
     self.accounts = []
     self.friends = collections.defaultdict(str)
     self.contacts = collections.defaultdict(str)  # uin to contact
     self.groups = {}
     self.groupMeminfo = {}
     self.im = IM()
     self.userid = ""
     self.cachepath = ds.OpenCachePath("Signal")
     self.bcppath = ds.OpenCachePath("tmp")
     m = hashlib.md5()
     m.update(self.root.AbsolutePath.encode('utf-8'))
     self.cachedb = self.cachepath + '/' + m.hexdigest().upper() + ".db"
     self.signaldb = self.cachepath + "/signal.sqlite"
     self.designaldb = self.cachepath + "/designal.sqlite"
     self.dbAbsolutePath = self.root.AbsolutePath
     self.VERSION_APP_VALUE = 10000
     self.keychain = 'private/var/tmp/keychain.plist'
     self.initsuccess = 0
     node = self.root.FileSystem.Search(self.keychain)
     self.sqlitekey = None
     if len(list(node)) == 0:
         return
     for k in node:
         x = k.PathWithMountPoint
         plist = PlistHelper.ReadPlist(x)
         for d in plist['genp']:
             try:
                 if ('acct' in d.Keys and 'svce' in d.Keys):
                     if (str(d['acct']) == 'OWSDatabaseCipherKeySpec'
                             and str(d['svce']) == 'TSKeyChainService'):
                         self.sqlitekey = d['v_Data']
                         break
             except Exception as e:
                 print(e)
         break
     if self.sqlitekey is None:
         return []
     if (os.path.exists(self.designaldb)):
         os.remove(self.designaldb)
     shutil.copyfile(self.root.PathWithMountPoint, self.signaldb)
     self.initsuccess = NativeMethod.ExportSqlCipherDatabase(
         self.signaldb, self.designaldb, self.sqlitekey.Bytes, 32)
Exemple #6
0
 def add_master_account_to_db(self):
     node = self.node.GetByPath(
         'Documents/TBSUserInfo/TBSettingsUserInfo.json')
     if node is None:
         return
     p = PlistHelper.ReadPlist(node)
     if p is not None:
         try:
             a = model_im.Account()
             a.account_id = p['userId'].ToString()
             a.nickname = a.username = p['userNick'].ToString()
             # a.photo = 'https://' + p['userLogo'].ToString()
             self.im.db_insert_table_account(a)
             self.im.db_commit()
         except:
             traceback.print_exc()
             return
Exemple #7
0
    def _generate_account_table(self):

        account_file = self._search_account_file()
        if account_file is None:
            return
        file_data = PlistHelper.ReadPlist(account_file)

        account = model_im.Account()
        account.account_id = file_data.Get('uid')
        account.username = file_data.Get('userName')
        account.country = file_data.Get('country')
        account.gender = file_data.Get('gender')
        account.photo = file_data.Get('headUrl')
        account.signature = file_data.Get('homePageEditDesc')
        account.telephone = file_data.Get('mobile')
        account.nickname = file_data.Get('nickName')

        self.master_account = account
        self.history_account_list.append(account.account_id)
        account.insert_db(self.model_im_col)
        self.model_im_col.db_commit()
Exemple #8
0
    def _generate_account_table(self):
        """
        创建account table
        """
        account_file = self._search_account_info_file()
        if not account_file:
            return

        file_info = PlistHelper.ReadPlist(account_file)
        if not file_info:
            return

        for account_id in self._account_list:
            try:
                if not account_file:
                    return
                account = model_im.Account()
                account.account_id = account.username = account.nickname = account_id
                account.email = file_info.Get('USER_MAIL' + account_id)
                birth_day = file_info.Get('currentUserBrithday' + account_id)
                if birth_day:
                    account.birthday = TimeHelper.str_to_ts(
                        birth_day.ToString())
                if str(file_info['userInformation'].Get(
                        "chatUserID")) == account_id:
                    account.password = file_info['userInformation'].Get(
                        "loginUserPassWord")
                    account.telephone = file_info['userInformation'].Get(
                        "loginUserPhone")
                    account.signature = file_info["signatureText"]
                    account.username = file_info["userChatUsername"]
                    account.gender = model_im.GENDER_FEMALE if file_info[
                        "gender"] == "女" else model_im.GENDER_MALE
                account.nickname = account.signature
                # account.photo = account_info.get("account_info", {}).get("photo_url", None)
                account.source = account_file.PathWithMountPoint
                self.model_im_col.db_insert_table_account(account)
            except Exception as e:
                self.logger.error()
        self.model_im_col.db_commit()
 def go(self):
     txt_node = None
     if self.grp_node is not None:
         txt_node = self.grp_node.GetByPath('dict/usr/uud_base.txt')
     if txt_node is not None:
         f = open(txt_node.PathWithMountPoint, 'rb')
         content = bytearray(f.read())
         f.close()
         #decoder = codecs.getdecoder('utf_16_le')
         #r_content = decoder(content)[0]
         r_content = content.decode('utf_16_le')
         rl = r_content.split('\n')
         for r in rl:
             # 跳过前两行
             if not r.__contains__('['):
                 continue
             #[dian][hua]	电话	1
             kl = r.split('\t')
             kw = IMEKeyword()
             kw.set_value_with_idx(kw.key_word, kl[1])
             kw.set_value_with_idx(kw.times, int(kl[2]))
             self.ime.db_insert_key(kw)
     self.ime.db_commit()
     pl_node = None
     if self.grp_node is not None:
         pl_node = self.grp_node.GetByPath('dict/dictSync/userinfo.plist')
     if pl_node is not None:
         b = PlistHelper.ReadPlist(pl_node)
         a = IMEAccount()
         a.set_value_with_idx(a.account, b['userId'].ToString())
         a.set_value_with_idx(a.account_id, b['userId'].ToString())
         a.set_value_with_idx(a.nick, b['uniqName'].ToString())
         a.set_value_with_idx(a.photo, b['largeAvatar'].ToString())
         a.set_value_with_idx(a.gender_code, b['sex'].ToString())
         self.ime.db_insert_account(a)
     self.ime.db_commit()
     self.ime.db_insert_version(IME_DB_KEY, IME_DB_VAL)
     self.ime.db_insert_version(IME_APP_KEY, 1)
     self.ime.db_commit()
     self.ime.db_close()
Exemple #10
0
 def search(self):
     cache_node = self.node.GetByPath('Library/Caches')
     pl = os.listdir(cache_node.PathWithMountPoint)
     al = list()
     for p in pl:
         res = re.search(r'amps3_(.*)\.db$', p, re.I | re.M)
         if res is not None:
             if not al.__contains__(res.group(1)):
                 al.append(res.group(1))
     for a in al:
         ac = TbAccount()
         ac.uid = a
         self.account.append(ac)
     if len(self.account) == 0:
         print('try to load from filesystem')
         node = self.node.GetByPath('Documents/TBDocuments/userInfo')
         if node is None:
             print('failed')
             return
         p = PlistHelper.ReadPlist(node)
         if p is not None:
             try:
                 ac = TbAccount()
                 ac.uid = p['userId'].ToString()
                 ac.tb_nick = p['nick'].ToString()
                 ac.is_from_avfs = True
                 self.account.append(ac)
             except:
                 traceback.print_exc()
                 return
     self.log.m_print('total find %d account(s)' % len(self.account))
     try:
         self.prepare_message_dict()
         self.try_get_avfs_message_dict()
     except Exception as e:
         traceback.print_exc()
         self.log.m_err('get message_dict failed!')
Exemple #11
0
 def open_plist(file_path):
     res = PlistHelper.ReadPlist(file_path)
     return res
Exemple #12
0
    def getData(self, map, t, name):
        url = None
        account = None
        labl = None
        cdat = None
        mdat = None
        password = None
        ptcl_name = None
        name2 = name
        if name == 'com.apple.cfnetwork':
            cls_name = self._get_map_value(map, 'class', 'str')
            atyp_name = self._get_map_value(map, 'atyp', 'str')
            srvr_name = self._get_map_value(map, 'srvr', 'str')
            ptcl_name = self._get_map_value(map, 'ptcl', 'str')
            if ptcl_name is not None:
                if ptcl_name == 'http':
                    url = 'http://' + srvr_name
                elif ptcl_name == 'https':
                    url = 'https://' + srvr_name
                else:
                    url = ptcl_name + '://' + srvr_name
            else:
                url = srvr_name

        if name == 'com.apple.cfnetwork':
            accKey = ['Account', 'acct']
            for key in accKey:
                if key in map.Keys:
                    account = self._get_map_value(map, key, 'str')
            lablKey = ['Label', 'labl']
            for key in lablKey:
                if key in map.Keys:
                    labl = self._get_map_value(map, key, 'str')
        elif name == 'com.apple.ProtectedCloudStorage':
            dsid = None
            genaKey = ['gena', 'srvr']
            for key in genaKey:
                if key in map.Keys:
                    dsid = self._get_map_value(map, key, 'str')
            accKey = ['Account', 'acct']
            for key in accKey:
                if key in map.Keys:
                    account = self._get_map_value(map, key, 'str')
            if dsid is not None:
                name2 = dsid + ' (' + account + ')'
                account = dsid
        else:
            accKey = ['Account', 'acct', 'Label', 'labl', 'srvr']
            for key in accKey:
                if key in map.Keys:
                    account = self._get_map_value(map, key, 'str')

        if name != 'com.apple.ProtectedCloudStorage':
            dataKey = ['Keychain Data', 'v_Data']
            for key in dataKey:
                if key in map.Keys:
                    password = self._get_map_value(map, key, 'str')
                    if '<plist' in password:
                        map_1 = PlistHelper.ReadPlist(
                            Encoding.ASCII.GetBytes(password))
                        if map_1 is not None and str(
                                type(map_1)) == "<type 'NSDictionary'>":
                            for iter in map_1:
                                password = self._get_map_value(
                                    map_1, key, 'str')

        cdatKey = ['Create Date', 'cdat']
        for key in cdatKey:
            if key in map.Keys:
                cdat = self._get_map_value(map, key, 'str')

        mdatKey = ['Modify Date', 'mdat']
        for key in mdatKey:
            if key in map.Keys:
                mdat = self._get_map_value(map, key, 'str')

        param = None
        if name == 'com.apple.cfnetwork':
            param = Param(t, account if labl is None else labl, cdat, mdat,
                          account, password, url, ptcl_name)
            self.params.append(param)
        else:
            param = Param(t, account if name2 is None else name2, cdat, mdat,
                          account, password)
            self.params.append(param)
        return param.extra_id
Exemple #13
0
    def analyze_keychain_plist(self):
        map_0 = PlistHelper.ReadPlist(self.root)
        if map_0 is not None and str(type(map_0)) == "<type 'NSDictionary'>":
            for iter_0 in map_0:
                key_0 = iter_0.Key
                value_0 = iter_0.Value
                if str(type(value_0)) == "<type 'NSArray'>":
                    if value_0.Count == 0:
                        continue

                    array = value_0
                    for val in array:
                        try:
                            map_1 = val
                            keyname = key_0
                            if map_1 is not None and str(
                                    type(map_1)) == "<type 'NSDictionary'>":
                                if len(map_1.Keys) == 2:
                                    continue
                                srvKey = ['Service', 'svce', 'agrp']
                                srvValue = { \
                                    'AirPort' : WiFiAcc, \
                                    'com.apple.account.idms.token' : AppleID, \
                                    'com.apple.account.AppleIDAuthentication.token' : AppleID, \
                                    'com.apple.account.POP.password' : MailAcc, \
                                    'com.apple.account.IMAP.password' : MailAcc, \
                                    'com.apple.account.SMTP.password' : MailAcc, \
                                    'com.apple.cfnetwork' : BrowserPsd, \
                                    'EN_KeyChain_ServiceName_*' : Others, \
                                    'sina_cookie' : Others, \
                                    'com.apple.gs.appleid.auth.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.gs.icloud.auth.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.account.idms.heartbeat-token' : Others, \
                                    'com.apple.account.IdentityServices.token' : Others, \
                                    'com.apple.gs.idms.pet.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.gs.supportapp.auth.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.gs.idms.hb.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.gs.pb.auth.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.gs.news.auth.com.apple.account.AppleIDAuthentication.token' : Others, \
                                    'com.apple.account.GameCenter.token' : Others, \
                                    'com.apple.account.AppleAccount.token' : Others, \
                                    'com.apple.account.AppleAccount.maps-token' : Others, \
                                    'com.apple.account.DeviceLocator.token' : Others, \
                                    'com.apple.account.FindMyFriends.find-my-friends-app-token' : Others, \
                                    'com.apple.account.FindMyFriends.find-my-friends-token' : Others, \
                                    'com.apple.account.CloudKit.token' : Others, \
                                    'com.apple.account.IdentityServices.token' : Others, \
                                    'com.apple.twitter.oauth-token-secret' : Others, \
                                    'com.apple.twitter.oauth-token' : Others, \
                                    'AllEncryptedLoginAccountKeyChainService' : Others, \
                                    'com.apple.ProtectedCloudStorage' : Others, \
                                    'BackupAgent' : BackupPsd \
                                    }

                                extra_id = None
                                for key in srvKey:
                                    if key in map_1.Keys:
                                        for name in srvValue.keys():
                                            value = self._get_map_value(
                                                map_1, key, 'str')
                                            if '*' in name:
                                                if name.replace('*',
                                                                '') in value:
                                                    extra_id = self.getData(
                                                        map_1, srvValue[name],
                                                        value)
                                            else:
                                                if value == name:
                                                    extra_id = self.getData(
                                                        map_1, srvValue[name],
                                                        value)

                                for name in srvValue.keys():
                                    if name.find(key_0) != -1:
                                        extra_id = self.getData(
                                            map_1, srvValue[name], '')

                                if key_0 == 'cert' or key_0 == 'certificates':
                                    cert = Generic.KeychainProfile.Certificate(
                                    )
                                    cert.Deleted = DeletedState.Intact
                                    cert.SourceFile.Value = self.root.AbsolutePath
                                    cert.KeychainID.Value = extra_id
                                    if key_0 == 'cert':
                                        cert.UUID.Value = self._get_map_value(
                                            map_1, 'UUID', 'str')
                                        cert.AccessGroup.Value = self._get_map_value(
                                            map_1, 'agrp', 'str')
                                        cert.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'cdat', 'str'))
                                        cert.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'mdat', 'str'))
                                        cert.Label.Value = self._get_map_value(
                                            map_1, 'labl', 'str')
                                        cert.Data.Value = self._get_map_value(
                                            map_1, 'v_Data', 'data')
                                    else:
                                        cert.AccessGroup = self._get_map_value(
                                            map_1, 'Entitlement Group', 'str')
                                        cert.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Create Date', 'str'))
                                        cert.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Modify Date', 'str'))
                                        cert.Label.Value = self._get_map_value(
                                            map_1, 'Label', 'str')
                                        cert.Data.Value = self._get_map_value(
                                            map_1, 'Keychain Data', 'data')
                                    cert.ProtectionDomain.Value = self._get_map_value(
                                        map_1, 'pdmn', 'str')
                                    cert.Issuer.Value = self._get_map_value(
                                        map_1, 'issr', 'data')
                                    cert.CertificateEncoding.Value = self._get_map_value(
                                        map_1, 'cenc', 'int')
                                    cert.CertificateType.Value = self._get_map_value(
                                        map_1, 'ctyp', 'int')
                                    cert.PublicKeyHash.Value = self._get_map_value(
                                        map_1, 'pkhh', 'data')
                                    cert.SubjectKeyID.Value = self._get_map_value(
                                        map_1, 'skid', 'data')
                                    cert.SerialNumber.Value = self._get_map_value(
                                        map_1, 'slnr', 'data')
                                    cert.Subject.Value = self._get_map_value(
                                        map_1, 'subj')
                                    cert.Synchronizable.Value = self._get_map_value(
                                        map_1, 'sync', 'bool')
                                    self.models.append(cert)
                                elif key_0 == 'genp' or key_0 == 'GenericPassword':
                                    genp = Generic.KeychainProfile.GenericPassword(
                                    )
                                    genp.Deleted = DeletedState.Intact
                                    genp.SourceFile.Value = self.root.AbsolutePath
                                    genp.KeychainID.Value = extra_id
                                    if key_0 == 'genp':
                                        genp.UUID.Value = self._get_map_value(
                                            map_1, 'UUID', 'str')
                                        genp.AccessGroup.Value = self._get_map_value(
                                            map_1, 'agrp', 'str')
                                        genp.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'cdat', 'str'))
                                        genp.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'mdat', 'str'))
                                        genp.Account.Value = self._get_map_value(
                                            map_1, 'acct', 'str')
                                        genp.Service.Value = self._get_map_value(
                                            map_1, 'srvr', 'str')
                                        genp.Data.Value = self._get_map_value(
                                            map_1, 'v_Data', 'data')
                                        genp.Label.Value = self._get_map_value(
                                            map_1, 'Label', 'str')
                                    else:
                                        genp.AccessGroup.Value = self._get_map_value(
                                            map_1, 'Entitlement Group', 'str')
                                        genp.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Create Date', 'str'))
                                        genp.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Modify Date', 'str'))
                                        genp.Account.Value = self._get_map_value(
                                            map_1, 'Account', 'str')
                                        genp.Service.Value = self._get_map_value(
                                            map_1, 'Service', 'str')
                                        genp.Data.Value = self._get_map_value(
                                            map_1, 'Keychain Data', 'data')
                                        genp.Label.Value = self._get_map_value(
                                            map_1, 'labl', 'str')
                                    genp.ProtectionDomain.Value = self._get_map_value(
                                        map_1, 'pdmn', 'str')
                                    genp.Synchronizable.Value = self._get_map_value(
                                        map_1, 'sync', 'bool')
                                    genp.Description.Value = self._get_map_value(
                                        map_1, 'desc', 'str')
                                    self.models.append(genp)
                                elif key_0 == 'inet' or key_0 == 'InternetPassword':
                                    inet = Generic.KeychainProfile.InternetPassword(
                                    )
                                    inet.Deleted = DeletedState.Intact
                                    inet.SourceFile.Value = self.root.AbsolutePath
                                    inet.KeychainID.Value = extra_id
                                    if key_0 == 'inet':
                                        inet.UUID.Value = self._get_map_value(
                                            map_1, 'UUID', 'str')
                                        inet.AccessGroup.Value = self._get_map_value(
                                            map_1, 'agrp', 'str')
                                        inet.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'cdat', 'str'))
                                        inet.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'mdat', 'str'))
                                        inet.Account.Value = self._get_map_value(
                                            map_1, 'acct', 'str')
                                        inet.Server.Value = self._get_map_value(
                                            map_1, 'srvr', 'str')
                                        inet.Data.Value = self._get_map_value(
                                            map_1, 'v_Data', 'data')
                                    else:
                                        inet.AccessGroup.Value = self._get_map_value(
                                            map_1, 'Entitlement Group', 'str')
                                        inet.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Create Date', 'str'))
                                        inet.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Modify Date', 'str'))
                                        inet.Account.Value = self._get_map_value(
                                            map_1, 'Account', 'str')
                                        inet.Server.Value = self._get_map_value(
                                            map_1, 'Service', 'str')
                                        inet.Data.Value = self._get_map_value(
                                            map_1, 'Keychain Data')
                                    inet.ProtectionDomain.Value = self._get_map_value(
                                        map_1, 'pdmn', 'str')
                                    inet.Path.Value = self._get_map_value(
                                        map_1, 'path', 'str')
                                    inet.Port.Value = self._get_map_value(
                                        map_1, 'port', 'str')
                                    inet.Protocol.Value = self._get_map_value(
                                        map_1, 'ptcl', 'str')
                                    inet.SecurityDomain.Value = self._get_map_value(
                                        map_1, 'sdmn', 'str')
                                    inet.Synchronizable.Value = self._get_map_value(
                                        map_1, 'sync', 'bool')
                                    inet.Description.Value = self._get_map_value(
                                        map_1, 'desc', 'str')
                                    self.models.append(inet)
                                elif key_0 == 'keys' or key_0 == 'Keys':
                                    keys = Generic.KeychainProfile.Key()
                                    keys.KeychainID.Value = extra_id
                                    keys.Deleted = DeletedState.Intact
                                    keys.SourceFile.Value = self.root.AbsolutePath
                                    if key_0 == 'keys':
                                        keys.UUID.Value = self._get_map_value(
                                            map_1, 'UUID', 'str')
                                        keys.AccessGroup.Value = self._get_map_value(
                                            map_1, 'agrp', 'str')
                                        keys.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'cdat', 'str'))
                                        keys.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'mdat', 'str'))
                                        keys.ApplicationTag.Value = self._get_map_value(
                                            map_1, 'atag', 'data')
                                        keys.CanEncrypt.Value = self._get_map_value(
                                            map_1, 'encr', 'bool')
                                        keys.CanDecrypt.Value = self._get_map_value(
                                            map_1, 'decr', 'bool')
                                        keys.Data.Value = self._get_map_value(
                                            map_1, 'v_Data', 'data')
                                        keys.Label.Value = self._get_map_value(
                                            map_1, 'labl', 'str')
                                    else:
                                        keys.AccessGroup.Value = self._get_map_value(
                                            map_1, 'Entitlement Group', 'str')
                                        keys.CreationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Create Date', 'str'))
                                        keys.ModificationDate.Value = self._get_timestamp(
                                            self._get_map_value(
                                                map_1, 'Modify Date', 'str'))
                                        keys.Data.Value = self._get_map_value(
                                            map_1, 'keychain Data', 'data')
                                        keys.Label.Value = self._get_map_value(
                                            map_1, 'Label', 'str')
                                    keys.ProtectionDomain.Value = self._get_map_value(
                                        map_1, 'pdmn', 'str')
                                    keys.KeySizeInBits.Value = self._get_map_value(
                                        map_1, 'bsiz', 'str')
                                    keys.EffectiveKeySize.Value = self._get_map_value(
                                        map_1, 'esiz', 'str')
                                    keys.KeyClass.Value = self._get_map_value(
                                        map_1, 'kcls', 'int')
                                    keys.ApplicationLabel.Value = self._get_map_value(
                                        map_1, 'klbl', 'str')
                                    keys.IsPermanent.Value = self._get_map_value(
                                        map_1, 'perm', 'bool')
                                    keys.CanDerive.Value = self._get_map_value(
                                        map_1, 'drve', 'bool')
                                    keys.CanSign.Value = self._get_map_value(
                                        map_1, 'sign', 'bool')
                                    keys.CanWrap.Value = self._get_map_value(
                                        map_1, 'wrap', 'bool')
                                    keys.CanVerify.Value = self._get_map_value(
                                        map_1, 'vrfy', 'bool')
                                    keys.CanUnwrap.Value = self._get_map_value(
                                        map_1, 'unwp', 'bool')
                                    keys.Synchronizable.Value = self._get_map_value(
                                        map_1, 'sync', 'bool')
                                    if 'v_Data' in map_1.Keys or 'Keychain Data' in map_1.Keys:
                                        keys.KeyType.Value = self._get_map_value(
                                            map_1, 'type', 'int')
                                    self.models.append(keys)
                                elif key_0 == 'idnt':
                                    idnt = Generic.KeychainProfile.Identity()
                                    idnt.Deleted = DeletedState.Intact
                                    idnt.SourceFile.Value = self.root.AbsolutePath
                                    idnt.KeychainID.Value = extra_id
                                    idnt.UUID.Value = self._get_map_value(
                                        map_1, 'UUID', 'str')
                                    idnt.AccessGroup.Value = self._get_map_value(
                                        map_1, 'agrp', 'str')
                                    idnt.CreationDate.Value = self._get_timestamp(
                                        self._get_map_value(
                                            map_1, 'cdat', 'str'))
                                    idnt.ModificationDate.Value = self._get_timestamp(
                                        self._get_map_value(
                                            map_1, 'mdat', 'str'))
                                    idnt.Label.Value = self._get_map_value(
                                        map_1, 'labl', 'str')
                                    idnt.Issuer.Value = self._get_map_value(
                                        map_1, 'issr', 'data')
                                    idnt.CertificateEncoding.Value = self._get_map_value(
                                        map_1, 'cenc', 'int')
                                    idnt.CertificateType.Value = self._get_map_value(
                                        map_1, 'ctyp', 'int')
                                    idnt.ProtectionDomain.Value = self._get_map_value(
                                        map_1, 'pdmn', 'str')
                                    idnt.PublicKeyHash.Value = self._get_map_value(
                                        map_1, 'pkhh', 'data')
                                    idnt.SubjectKeyID.Value = self._get_map_value(
                                        map_1, 'skid', 'data')
                                    idnt.SerialNumber.Value = self._get_map_value(
                                        map_1, 'slnr', 'data')
                                    idnt.Subject.Value = self._get_map_value(
                                        map_1, 'subj', 'data')
                                    idnt.Synchronizable.Value = self._get_map_value(
                                        map_1, 'sync', 'bool')
                                    idnt.CertificateData.Value = self._get_map_value(
                                        map_1, 'certdata', 'data')
                                    idnt.ApplicationTag.Value = self._get_map_value(
                                        map_1, 'atag', 'data')
                                    idnt.KeySizeInBits.Value = self._get_map_value(
                                        map_1, 'bsiz', 'str')
                                    idnt.CanEncrypt.Value = self._get_map_value(
                                        map_1, 'encr', 'bool')
                                    idnt.CanDecrypt.Value = self._get_map_value(
                                        map_1, 'decr', 'bool')
                                    idnt.EffectiveKeySize.Value = self._get_map_value(
                                        map_1, 'esiz', 'str')
                                    idnt.KeyClass.Value = self._get_map_value(
                                        map_1, 'kcls', 'int')
                                    idnt.ApplicationLabel.Value = self._get_map_value(
                                        map_1, 'klbl', 'str')
                                    idnt.Data.Value = self._get_map_value(
                                        map_1, 'v_Data', 'data')
                                    if 'v_Data' in map_1.Keys:
                                        idnt.KeyType.Value = self._get_map_value(
                                            map_1, 'type', 'int')
                                    idnt.IsPermanent.Value = self._get_map_value(
                                        map_1, 'perm', 'bool')
                                    idnt.CanDerive.Value = self._get_map_value(
                                        map_1, 'drve', 'bool')
                                    idnt.CanSign.Value = self._get_map_value(
                                        map_1, 'sign', 'bool')
                                    idnt.CanWrap.Value = self._get_map_value(
                                        map_1, 'wrap', 'bool')
                                    idnt.CanVerify.Value = self._get_map_value(
                                        map_1, 'vrfy', 'bool')
                                    idnt.CanUnwrap.Value = self._get_map_value(
                                        map_1, 'unwp', 'bool')
                                    self.models.append(idnt)
                        except:
                            traceback.print_exc()