Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __int64 __fastcall AccountManager_GetDefaultAccountOldCredentials_sub_4B3ED0(__int64 a1, char a2, __int64 *a3, __int64 a4, __int64 ARG_a5, _DWORD *ARG_a6, __int64 ARG_a7, _DWORD *ARG_a8, _QWORD *ARG_a9)
- {
- const char *v12; // rax
- __int64 v13; // rax
- int v14; // eax
- unsigned int v15; // ebx
- __int64 v16; // rax
- __int64 **v17; // rax
- __int64 v18; // rax
- __int64 (__fastcall *v19)(__int64, unsigned __int64 *); // rcx
- __int64 v20; // rax
- bool v21; // al
- __int64 v22; // rax
- __int64 **v23; // rbx
- __int64 v24; // r13
- __int64 v25; // r14
- int v26; // ecx
- unsigned int v27; // eax
- int v28; // ecx
- bool v29; // al
- int v30; // ecx
- char *v31; // rbx
- _BYTE *v32; // r15
- char *v33; // rbx
- __int64 v34; // r15
- _BYTE *v35; // rax
- __int64 v36; // rax
- void *v37; // r14
- int v38; // er15
- __int64 v39; // rbx
- unsigned __int64 v40; // rax
- __int64 _LEN_v41; // r14
- __int64 _DATA_v43; // r13
- char *v44; // rsi
- unsigned int CRC32_v45; // ecx
- _BYTE *v46; // rax
- __int64 v47; // rsi
- int v48; // edi
- spl *v49; // rax
- int v50; // eax
- spl *v51; // rax
- unsigned __int64 a2a[2]; // [rsp+0h] [rbp-1E0h]
- char *v53; // [rsp+10h] [rbp-1D0h]
- __int64 (__fastcall **v54)(); // [rsp+110h] [rbp-D0h]
- __int64 v55; // [rsp+118h] [rbp-C8h]
- char v56; // [rsp+120h] [rbp-C0h]
- __int64 *v58; // [rsp+148h] [rbp-98h]
- __int64 a1a; // [rsp+150h] [rbp-90h]
- MEMORY MEM; // [rsp+160h] [rbp-80h]
- __int64 v62; // [rsp+170h] [rbp-70h]
- __int64 Remain_v63; // [rsp+178h] [rbp-68h]
- __int64 CRC32_v64; // [rsp+180h] [rbp-60h]
- unsigned int LEN_SUB_v65; // [rsp+18Ch] [rbp-54h]
- int attrc_v67; // [rsp+190h] [rbp-50h]
- unsigned int v67; // [rsp+198h] [rbp-48h]
- void *v68; // [rsp+1A0h] [rbp-40h]
- v12 = (const char *)std_string_c_sub_2BBBA0(a3);
- v13 = sub_4B0FE0((spl *)a1, v12);
- if ( !*(_BYTE *)(v13 + 4) )
- {
- v62 = a1;
- v58 = a3;
- MEM.Ptr = 0LL;
- MEM.Size = 0;
- if ( a2 )
- {
- _mm_store_si128((__m128i *)&attrc_v67, (__m128i)0LL);
- v68 = 0LL;
- v16 = GetConfig_sub_4C57D0(*(_QWORD *)(v62 + 32));
- v17 = (__int64 **)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v16 + 80LL))(v16);
- sub_2BB240((__int64 **)&CRC32_v64, v17);
- if ( *(_DWORD *)qword_93C108 <= 70 )
- {
- a2a[1] = (unsigned __int64)"GetOldCredentials";
- a2a[0] = 34818LL;
- v53 = (char *)&attrc_v67 + 1;
- auf::LogComponent::log(qword_93C108, 81990LL, 2857999256LL, "%s: missing coexistence creds, err: %s\n", a2a);
- }
- sub_2BBB20(&CRC32_v64);
- if ( attrc_v67 & 1 )
- operator delete(v68);
- goto LABEL_45;
- }
- v18 = sub_2B9FA0(*(_QWORD *)(v62 + 32));
- v19 = *(__int64 (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v18 + 40LL);
- _mm_store_si128((__m128i *)a2a, (__m128i)0LL);
- v53 = 0LL;
- v20 = v19(v18, a2a);
- (*(void (__fastcall **)(__int64 *, __int64, const char *))(*(_QWORD *)v20 + 16LL))(
- &CRC32_v64,
- v20,
- "*Lib/Account/Default");
- if ( a2a[0] & 1 )
- operator delete(v53);
- std_string_ctor_sub_2BB200(&Remain_v63);
- v21 = std_string_c_sub_2BBD60((unsigned __int8 **)&CRC32_v64);
- a1a = a4;
- if ( v21 )
- {
- _mm_store_si128((__m128i *)a2a, (__m128i)0LL);
- v22 = sub_2B9FA0(*(_QWORD *)(v62 + 32));
- (*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v22 + 64LL))(v22, a2a);
- if ( HIDWORD(a2a[1]) )
- {
- v23 = (__int64 **)a2a[0];
- v24 = 8LL * HIDWORD(a2a[1]);
- v25 = v62;
- while ( 1 )
- {
- Read_Credentials3_sub_4B4810(&attrc_v67, *(_QWORD *)(v25 + 32), (__int64)v23);
- std_string_sub_2BB330((__int64 **)&Remain_v63, (__int64 **)&attrc_v67);
- std_string_sub_2BBB60((__int64)&attrc_v67);
- if ( !std_string_c_sub_2BBD60((unsigned __int8 **)&Remain_v63) )
- break;
- ++v23;
- v24 -= 8LL;
- if ( !v24 )
- goto LABEL_22;
- }
- std_string_sub_2BB330((__int64 **)&CRC32_v64, v23);
- LABEL_22:
- v26 = HIDWORD(a2a[1]);
- v27 = --HIDWORD(a2a[1]);
- if ( v26 )
- {
- do
- {
- std_string_sub_2BBB60(a2a[0] + 8LL * v27);
- v28 = HIDWORD(a2a[1]);
- v27 = --HIDWORD(a2a[1]);
- }
- while ( v28 );
- }
- }
- else
- {
- HIDWORD(a2a[1]) = -1;
- }
- MEMMORY_SetSize_sub_2B99E0((__int64)a2a, 0);
- ++HIDWORD(a2a[1]);
- MEMORY_dtor_sub_2B9CA0((void **)a2a);
- }
- else
- {
- Read_Credentials3_sub_4B4810(a2a, *(_QWORD *)(v62 + 32), (__int64)&CRC32_v64);
- std_string_sub_2BB330((__int64 **)&Remain_v63, (__int64 **)a2a);
- std_string_sub_2BBB60((__int64)a2a);
- }
- v29 = std_string_c_sub_2BBD60((unsigned __int8 **)&Remain_v63);
- v30 = *(_DWORD *)qword_93C108;
- if ( v29 )
- {
- if ( v30 <= 60 )
- {
- a2a[0] = 2049LL;
- a2a[1] = (unsigned __int64)"GetOldCredentials";
- auf::LogComponent::log(
- qword_93C108,
- (char *)&loc_1333A + 2,
- 719622844LL,
- "%s: did not find credentials for default user\n",
- a2a);
- }
- std_string_sub_2BBB60((__int64)&Remain_v63);
- std_string_sub_2BBB60((__int64)&CRC32_v64);
- v15 = 0;
- goto LABEL_46;
- }
- if ( v30 <= 50 )
- {
- a2a[0] = 2049LL;
- a2a[1] = (unsigned __int64)"GetOldCredentials";
- auf::LogComponent::log(qword_93C108, 79410LL, 1053985249LL, "%s: found credentials for default user\n", a2a);
- }
- v31 = (char *)std_string_c_sub_2BBBA0(&Remain_v63);
- v32 = memchr("0123456789ABCDEF", *v31, 0x11uLL);
- if ( v32 )
- {
- v33 = v31 + 2;
- do
- {
- v34 = v32 - "0123456789ABCDEF";
- if ( v34 > 15 )
- break;
- v35 = memchr("0123456789ABCDEF", *(v33 - 1), 0x11uLL);
- if ( !v35 )
- break;
- v36 = v35 - "0123456789ABCDEF";
- if ( v36 > 15 )
- break;
- LOBYTE(a2a[0]) = v36 + 16 * v34;
- MEMORY_sub_C5F10(&MEM, (unsigned __int64)a2a, 1);
- v32 = memchr("0123456789ABCDEF", *v33, 0x11uLL);
- v33 += 2;
- }
- while ( v32 );
- }
- *(_QWORD *)&attrc_v67 = 0LL;
- v67 = 0;
- if ( loadCryptedToken("skype") )
- {
- v37 = (void *)operator new[](0x20uLL);
- _mm_store_si128(
- (__m128i *)a2a,
- _mm_unpacklo_epi64((__m128i)(unsigned __int64)off_91F3E0, (__m128i)(unsigned __int64)&off_91F420));
- v54 = off_91F438;
- seq_ctor_sub_29B730((unsigned __int64)&a2a[1]);
- v38 = 0;
- seq_init_sub_29B450((__int64)&v56, 0LL);
- v55 = 0LL;
- encryptor_sub_29B620((__int64)v37, 0x20u, *(__int64 *)&attrc_v67, v67);
- __bzero(*(_QWORD *)&attrc_v67, v67);
- MEMMORY_SetSize_sub_2B99E0((__int64)&attrc_v67, 0);
- ((void (__fastcall *)(__int64 (__fastcall ***)(), void *))v54[2])(&v54, v37);
- v55 = 0LL;
- LEN_SUB_v65 = MEM.Size;
- if ( MEM.Size > 1u )
- {
- v39 = MEM.Ptr;
- v40 = encryptor_sub_29B4A0((__int64)&v56, (unsigned int *)&v56, (unsigned __int8 *)MEM.Ptr, (int *)&LEN_SUB_v65);
- encryptor_aes_sub_29C240((__int64)&a2a[1], v39, LEN_SUB_v65, v40, 0, HIDWORD(v55));
- v38 = LEN_SUB_v65;
- }
- else
- {
- LEN_SUB_v65 = 0;
- }
- MEMORY_Resize_sub_C5ED0(&MEM, v38);
- operator delete[](v37);
- }
- std_string_sub_2BB330((__int64 **)v58, (__int64 **)&CRC32_v64);
- MEMORY_dtor_sub_2B9CB0((__int64)&attrc_v67);
- std_string_sub_2BBB60((__int64)&Remain_v63);
- std_string_sub_2BBB60((__int64)&CRC32_v64);
- _LEN_v41 = (unsigned int)MEM.Size;
- if ( (unsigned int)MEM.Size < 145uLL )
- {
- if ( *(_DWORD *)qword_93C108 <= 70 )
- {
- a2a[0] = 2049LL;
- a2a[1] = (unsigned __int64)"GetOldCredentials";
- auf::LogComponent::log(
- qword_93C108,
- 84806LL,
- 1888273893LL,
- "%s: not enough data to retrieve password hash\n",
- a2a);
- v15 = 0;
- LABEL_46:
- MEMORY_Resize_sub_C5ED0(&MEM, 0);
- return v15;
- }
- LABEL_45:
- v15 = 0;
- goto LABEL_46;
- }
- _DATA_v43 = MEM.Ptr;
- rt::BASE64::encode((__int64)a2a, MEM.Ptr, 16LL);
- v44 = (char *)a2a + 1;
- if ( a2a[0] & 1 )
- v44 = v53;
- std_string_sub_2BBBD0(a1a, v44);
- LODWORD(CRC32_v64) = -1;
- spl::memcpy_s(&attrc_v67, 0x10uLL, (const void *)_DATA_v43, 0x10uLL);
- CRC32_sub_C44F0(&CRC32_v64, (unsigned __int8 *)&attrc_v67, 16);
- CRC32_v45 = CRC32_v64;
- v46 = (_BYTE *)(_DATA_v43 + 16);
- v47 = (_LEN_v41 & 1) + 16 - _LEN_v41;
- do
- {
- v48 = 69069 * CRC32_v45 + 17009;
- *v46 ^= HIBYTE(v48);
- CRC32_v45 = 69069 * v48 + 17009;
- v15 = (CRC32_v45 >> 24) ^ (unsigned __int8)v46[1];
- v46[1] ^= HIBYTE(CRC32_v45);
- v46 += 2;
- v47 += 2LL;
- }
- while ( v47 );
- if ( _LEN_v41 & 1 )
- *v46 ^= (0x10DCD * CRC32_v45 + 0x4271) >> 24;
- if ( _byteswap_ulong(*(_DWORD *)(_DATA_v43 + 16)) == 0x140 )
- {
- LOBYTE(v15) = 1;
- if ( (unsigned int)_LEN_v41 >= 0x154 )
- {
- CRC32_v64 = _DATA_v43 + 340;
- LEN_SUB_v65 = _LEN_v41 - 340;
- _mm_store_si128((__m128i *)&attrc_v67, (__m128i)0LL);
- LODWORD(Remain_v63) = 307200;
- if ( AttributeContainer_Decode_sub_29A520(
- (__int64)&attrc_v67,
- &CRC32_v64,
- (int *)&LEN_SUB_v65,
- 0LL,
- 8u,
- &Remain_v63) )
- {
- v49 = AttributeContainer_GetAttrStr_sub_299EF0((__int64)&attrc_v67, 2, "");
- std_string_sub_2BBBD0(ARG_a5, (const char *)v49);
- v50 = AttributeContainer_GetAttr_sub_299D30((__int64)&attrc_v67, 12, 0);
- *ARG_a6 = v50;
- v51 = AttributeContainer_GetAttrStr_sub_299EF0((__int64)&attrc_v67, 6, 0LL);
- std_string_sub_2BBBD0(ARG_a7, (const char *)v51);
- *ARG_a8 = AttributeContainer_GetAttr_sub_299D30((__int64)&attrc_v67, 7, 0);
- *ARG_a9 = AttributeContainer_GetAttr_sub_299D80(&attrc_v67, 3, 0LL, 0);
- }
- AttributeContainer_dtor_sub_29A000((LIST *)&attrc_v67);
- if ( !(a2a[0] & 1) )
- goto LABEL_46;
- goto LABEL_65;
- }
- }
- else
- {
- if ( *(_DWORD *)qword_93C108 <= 70 )
- {
- *(_QWORD *)&attrc_v67 = 2049LL;
- *(_QWORD *)&v67 = "GetOldCredentials";
- auf::LogComponent::log(qword_93C108, 87622LL, 4258734260LL, "%s: credentials decryption failed\n", &attrc_v67);
- v15 = 0;
- if ( !(a2a[0] & 1) )
- goto LABEL_46;
- goto LABEL_65;
- }
- v15 = 0;
- }
- if ( !(a2a[0] & 1) )
- goto LABEL_46;
- LABEL_65:
- operator delete(v53);
- goto LABEL_46;
- }
- if ( *(_DWORD *)qword_93C108 <= 60 )
- {
- v14 = *(_DWORD *)v13;
- a2a[0] = 257LL;
- LODWORD(a2a[1]) = v14;
- auf::LogComponent::log(
- qword_93C108,
- &loc_1193C,
- 83748489LL,
- "AccountManager::GetDefaultAccountOldCredentials: account object already created: %u\n",
- a2a);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement