Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int __fastcall xGen::cPackage::loadHeader(xGen::cPackage *this)
- {
- xGen::cPackage *v1; // r8@1
- _DWORD *v2; // r5@1
- xGen::cLowFile *v3; // r0@1
- unsigned int v4; // r0@8
- signed int v5; // r1@8
- bool v6; // zf@9
- signed int v7; // r4@9
- void *v8; // r5@12
- unsigned int v9; // r11@12
- int v10; // r0@12
- int i; // r1@14
- int v12; // r4@17
- int v13; // r6@17
- _DWORD *v14; // r5@17
- int *v15; // r5@17
- int v16; // t1@17
- int v17; // r11@17
- int v18; // r10@17
- int v19; // r5@18
- int v20; // t1@18
- _BYTE *v21; // r4@18
- int v22; // r5@18
- char v23; // r8@18
- size_t v24; // r0@18
- int v25; // r0@18
- __int16 v26; // r2@18
- int result; // r0@21
- void *v28; // [sp+Ch] [bp-85Ch]@17
- void *ptr; // [sp+10h] [bp-858h]@17
- int v30; // [sp+18h] [bp-850h]@17
- int v31; // [sp+1Ch] [bp-84Ch]@17
- int v32; // [sp+20h] [bp-848h]@18
- int v33; // [sp+24h] [bp-844h]@18
- int v34; // [sp+28h] [bp-840h]@18
- unsigned int v35; // [sp+30h] [bp-838h]@8
- char v36; // [sp+34h] [bp-834h]@5
- int v37; // [sp+38h] [bp-830h]@3
- __int16 v38; // [sp+3Dh] [bp-82Bh]@18
- char v39; // [sp+3Fh] [bp-829h]@18
- int v40; // [sp+40h] [bp-828h]@2
- char v41; // [sp+44h] [bp-824h]@2
- char v42[2048]; // [sp+48h] [bp-820h]@18
- int v43; // [sp+848h] [bp-20h]@1
- v1 = this;
- v2 = &_stack_chk_guard;
- v43 = _stack_chk_guard;
- v3 = (xGen::cLowFile *)*((_DWORD *)this + 3);
- if ( v3 )
- {
- v41 = 0;
- v40 = 0;
- xGen::cLowFile::Read(v3, &v40, 4);
- if ( !strcmp((const char *)&v40, "XPAK") )
- {
- xGen::cLowFile::Read(*((xGen::cLowFile **)v1 + 3), &v37, 4);
- if ( v37 < 2 )
- {
- xGen::cLowFile::Read(*((xGen::cLowFile **)v1 + 3), &v36, 4);
- if ( v37 < 1 )
- {
- *(_DWORD *)((char *)v1 + 34) = 0;
- *(_DWORD *)((char *)v1 + 30) = 0;
- *(_DWORD *)((char *)v1 + 26) = 0;
- *(_DWORD *)((char *)v1 + 22) = 0;
- }
- else
- {
- xGen::cLowFile::Read(*((xGen::cLowFile **)v1 + 3), (char *)v1 + 22, 16);
- }
- xGen::cLowFile::Read(*((xGen::cLowFile **)v1 + 3), (char *)v1 + 17, 5);
- *(_DWORD *)((char *)v1 + 17) ^= 0xAC54DF34;
- xGen::cLowFile::Read(*((xGen::cLowFile **)v1 + 3), &v35, 4);
- v4 = v35;
- v5 = 1;
- do
- {
- v6 = v5 << 31 == 0;
- v7 = v4;
- v4 ^= 0xAC54DF34;
- v5 = 0;
- }
- while ( !v6 );
- v35 = v7;
- if ( v7 >= 5 )
- {
- v8 = (void *)operator new[](v7);
- xGen::cLowFile::Read(*((xGen::cLowFile **)v1 + 3), v8, v7);
- v9 = v35;
- v10 = 4;
- if ( (signed int)v35 / 4 < 4 )
- v10 = (signed int)v35 / 4;
- for ( i = 0; i < v10; ++i )
- *((_DWORD *)v8 + i) ^= 0xAC54DF34;
- v28 = v8;
- v13 = (int)v8 + 4;
- v12 = *(_DWORD *)v8;
- v14 = (_DWORD *)operator new[](*(_DWORD *)v8 | (*(_DWORD *)v8 >> 31));
- j_LzmaDecompress(v13, v9, v14, v12);
- ptr = v14;
- v16 = *v14;
- v15 = v14 + 1;
- v31 = v16;
- v17 = xGen::cLowFile::Tell(*((xGen::cLowFile **)v1 + 3));
- v18 = 0;
- v30 = (int)v1 + 40;
- while ( v18 < v31 )
- {
- v20 = *v15;
- v19 = (int)(v15 + 1);
- _aeabi_memcpy(v42, v19, v20);
- v42[v20] = 0;
- v21 = (_BYTE *)(v19 + v20 + 4);
- v22 = *(_DWORD *)(v19 + v20);
- v34 = 0;
- v23 = *v21;
- v32 = 0;
- v33 = 0;
- v24 = strlen(v42);
- std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>::__init(
- &v32,
- v42,
- v24);
- v25 = std::__ndk1::unordered_map<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,xGen::cPackage::sFileInfo,std::__ndk1::hash<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>,std::__ndk1::equal_to<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>,std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>> const,xGen::cPackage::sFileInfo>>>::operator[](
- v30,
- &v32);
- *(_BYTE *)(v25 + 8) = v23;
- *(_DWORD *)v25 = v22;
- *(_DWORD *)(v25 + 4) = v17;
- v26 = v38;
- *(_BYTE *)(v25 + 11) = v39;
- *(_WORD *)(v25 + 9) = v26;
- std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>::~basic_string(&v32);
- v17 += v22;
- ++v18;
- v15 = (int *)(v21 + 1);
- }
- operator delete[](ptr);
- operator delete[](v28);
- v2 = &_stack_chk_guard;
- }
- }
- else
- {
- xGen::cLogger::logInternal(4, "unsupported xpk version: %d");
- }
- }
- }
- result = *v2 - v43;
- if ( *v2 != v43 )
- _stack_chk_fail(result);
- return result;
- }
- signed int __fastcall xGen::cPackage::loadFile(xGen::cPackage *this, xGen::cFile *a2, const char *a3)
- {
- xGen::cPackage *v3; // r10@1
- xGen::cFile *v4; // r8@1
- signed int v5; // r4@1
- size_t v6; // r0@2
- int v7; // r4@2
- int v8; // r9@3
- void *v9; // r6@3
- int v10; // r0@3
- int v11; // r1@3
- int i; // r2@5
- void *v13; // r4@10
- signed int v14; // r5@10
- signed int v15; // r0@14
- int v17; // [sp+10h] [bp-430h]@2
- int v18; // [sp+14h] [bp-42Ch]@2
- int v19; // [sp+18h] [bp-428h]@2
- char dest; // [sp+20h] [bp-420h]@2
- int v21; // [sp+420h] [bp-20h]@1
- v3 = this;
- v4 = a2;
- v5 = 0;
- v21 = _stack_chk_guard;
- if ( *((_DWORD *)this + 3) )
- {
- strcpy(&dest, a3);
- _strlwr_s<1024u>(&dest);
- v19 = 0;
- v17 = 0;
- v18 = 0;
- v6 = strlen(&dest);
- std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>::__init(&v17, &dest, v6);
- v7 = std::__ndk1::__hash_table<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,xGen::cPackage::sFileInfo>,std::__ndk1::__unordered_map_hasher<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,xGen::cPackage::sFileInfo>,std::__ndk1::hash<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>,true>,std::__ndk1::__unordered_map_equal<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,xGen::cPackage::sFileInfo>,std::__ndk1::equal_to<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>,true>,std::__ndk1::allocator<std::__ndk1::__hash_value_type<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>,xGen::cPackage::sFileInfo>>>::find<std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>>(
- (char *)v3 + 40,
- &v17);
- std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>::~basic_string(&v17);
- if ( !v7 )
- {
- v5 = 0;
- goto LABEL_17;
- }
- v8 = *(_DWORD *)(v7 + 20);
- v9 = (void *)operator new[](v8 | (v8 >> 31));
- xGen::cLowFile::Seek(*((xGen::cLowFile **)v3 + 3), *(_DWORD *)(v7 + 24));
- v10 = xGen::cLowFile::Read(*((xGen::cLowFile **)v3 + 3), v9, v8);
- v11 = 4;
- if ( v8 / 4 < 4 )
- v11 = v8 / 4;
- for ( i = 0; i < v11; ++i )
- *((_DWORD *)v9 + i) ^= 2891243316u;
- if ( v10 )
- {
- if ( (signed int)*(_BYTE *)(v7 + 28) > -1 )
- {
- v13 = v9;
- v14 = v8;
- LABEL_14:
- xGen::cFile::setData(v4, v13, v14);
- v15 = 2;
- LABEL_16:
- *((_DWORD *)v4 + 5) = v15;
- v5 = 1;
- goto LABEL_17;
- }
- if ( v8 >= 4 )
- {
- v14 = *(_DWORD *)v9;
- v13 = (void *)operator new[](v14 | (v14 >> 31));
- j_LzmaDecompress((char *)v9 + 4, v8, v13, v14);
- operator delete[](v9);
- goto LABEL_14;
- }
- }
- operator delete[](v9);
- v15 = 0;
- goto LABEL_16;
- }
- LABEL_17:
- if ( _stack_chk_guard != v21 )
- _stack_chk_fail(_stack_chk_guard - v21);
- return v5;
- }
Advertisement
Add Comment
Please, Sign In to add comment