//
// cocos2d::unzOpenCurrentFilePassword from 0x1800a5540 to 0x1800a575a (538 bytes)
//
// 6 xrefs:
// > ??> @ 0x180148668
// > ??> @ 0x180148680
// > ??> @ 0x18014869c
// > ??> @ 0x1801486b8
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c1be4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:22:15 +0000
//
__int64 __fastcall cocos2d::unzOpenCurrentFilePassword(cocos2d *this, void *a2, const char *a3)
{
__int64 result; // rax
char *v5; // rbx
void *v6; // rax
__int128 v7; // xmm0
_QWORD *v8; // rcx
__int128 v9; // xmm1
int v10; // edx
__int64 v11; // rax
__int128 v12; // xmm0
__int128 v13; // xmm1
__int128 v14; // xmm0
__int64 v15; // rdx
__int64 v16; // rcx
unsigned int v17; // esi
unsigned int v18; // [rsp+48h] [rbp+10h] BYREF
unsigned int v19; // [rsp+50h] [rbp+18h] BYREF
__int64 v20; // [rsp+58h] [rbp+20h] BYREF
if ( a2 || !this || !*((_QWORD *)this + 18) )
return 4294967194LL;
if ( *((_QWORD *)this + 34) )
cocos2d::unzCloseCurrentFile(this, nullptr);
if ( (unsigned int)sub_1800A3760((__int64)this, &v19, &v20, &v18) )
return 4294967193LL;
v5 = (char *)malloc(0x120u);
if ( !v5 )
return 4294967192LL;
v6 = malloc(0x4000u);
*((_QWORD *)v5 + 14) = v20;
*((_DWORD *)v5 + 30) = v18;
*(_QWORD *)v5 = v6;
*((_QWORD *)v5 + 16) = 0;
*((_DWORD *)v5 + 70) = 0;
if ( !v6 )
{
free(v5);
return 4294967192LL;
}
v7 = *(_OWORD *)this;
v8 = v5 + 8;
v9 = *((_OWORD *)this + 1);
v10 = *((_DWORD *)this + 47);
*((_DWORD *)v5 + 37) = *((_DWORD *)this + 49);
*((_QWORD *)v5 + 32) = *((_QWORD *)this + 12);
v11 = *((_QWORD *)this + 15);
*((_DWORD *)v5 + 26) = 0;
*((_DWORD *)v5 + 36) = 0;
*((_QWORD *)v5 + 17) = 0;
*((_DWORD *)v5 + 66) = v10;
*((_QWORD *)v5 + 34) = v11;
*((_DWORD *)v5 + 9) = 0;
*(_OWORD *)(v5 + 168) = v7;
v12 = *((_OWORD *)this + 2);
*(_OWORD *)(v5 + 184) = v9;
v13 = *((_OWORD *)this + 3);
*(_OWORD *)(v5 + 200) = v12;
v14 = *((_OWORD *)this + 4);
*(_OWORD *)(v5 + 216) = v13;
*(_QWORD *)&v13 = *((_QWORD *)this + 10);
*(_OWORD *)(v5 + 232) = v14;
*((_QWORD *)v5 + 31) = v13;
if ( v10 == 12 )
{
*((_DWORD *)v5 + 70) = 1;
}
else if ( v10 == 8 )
{
*((_QWORD *)v5 + 7) = 0;
*((_QWORD *)v5 + 8) = 0;
*((_QWORD *)v5 + 9) = 0;
*v8 = 0;
*((_DWORD *)v5 + 4) = 0;
v17 = inflateInit2_(v8, 4294967281LL, "1.3.0", 88);
if ( v17 )
{
free(v5);
return v17;
}
*((_DWORD *)v5 + 26) = 8;
}
result = 0;
v15 = v19 + 30LL;
*((_QWORD *)v5 + 19) = *((_QWORD *)this + 25);
v16 = *((_QWORD *)this + 26);
*((_QWORD *)v5 + 12) = *((_QWORD *)this + 33) + v15;
*((_QWORD *)v5 + 20) = v16;
*((_DWORD *)v5 + 4) = 0;
*((_QWORD *)this + 34) = v5;
*((_DWORD *)this + 70) = 0;
return result;
}