{"type": "func", "start": 6443120352, "end": 6443120693, "name": "cocos2d::ZipUtils::ccInflateCCZFile", "pseudocode": "// \n// cocos2d::ZipUtils::ccInflateCCZFile from 0x1800a36e0 to 0x1800a3835 (341 bytes)\n// \n// 6 xrefs:\n// > sub_1800AA090 @ 0x1800aa2ec\n// > <???> @ 0x18013f9ec\n// > <???> @ 0x18013fa00\n// > <???> @ 0x18013fa10\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b7ab8\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall cocos2d::ZipUtils::ccInflateCCZFile(const char *a1, unsigned __int8 **a2)\n{\n  struct cocos2d::CCFileUtils *v4; // rax\n  __int64 v5; // rax\n  unsigned int *v6; // rdi\n  unsigned __int32 v8; // esi\n  unsigned __int8 *v9; // rax\n  int v10; // ebx\n  int v11; // [rsp+60h] [rbp+18h] BYREF\n  unsigned __int32 v12; // [rsp+68h] [rbp+20h] BYREF\n\n  v11 = 0;\n  v4 = cocos2d::CCFileUtils::sharedFileUtils();\n  v5 = ((__int64 (__fastcall *)(struct cocos2d::CCFileUtils *, const char *, const char *, int *))v4->addSearchResolutionsOrder)(\n         v4,\n         a1,\n         \"rb\",\n         &v11);\n  v6 = (unsigned int *)v5;\n  if ( !v5 || !v11 )\n    return 0xFFFFFFFFLL;\n  if ( *(_BYTE *)v5 != 67 || *(_BYTE *)(v5 + 1) != 67 || *(_BYTE *)(v5 + 2) != 90 )\n    goto LABEL_9;\n  if ( *(_BYTE *)(v5 + 3) == 33 )\n  {\n    if ( (HIBYTE(*(unsigned __int16 *)(v5 + 6)) | ((unsigned __int8)*(_WORD *)(v5 + 6) << 8)) > 2u\n      || HIBYTE(*(unsigned __int16 *)(v5 + 4)) | ((unsigned __int8)*(_WORD *)(v5 + 4) << 8) )\n    {\n      goto LABEL_9;\n    }\n  }\n  else\n  {\n    if ( *(_BYTE *)(v5 + 3) != 112\n      || HIBYTE(*(unsigned __int16 *)(v5 + 6)) | ((unsigned __int8)*(_WORD *)(v5 + 6) << 8)\n      || HIBYTE(*(unsigned __int16 *)(v5 + 4)) | ((unsigned __int8)*(_WORD *)(v5 + 4) << 8) )\n    {\n      goto LABEL_9;\n    }\n    cocos2d::ZipUtils::ccDecodeEncodedPvr((unsigned int *)(v5 + 12), (unsigned int)(v11 - 12) >> 2);\n  }\n  v8 = _byteswap_ulong(v6[3]);\n  v9 = (unsigned __int8 *)malloc(v8);\n  *a2 = v9;\n  if ( !v9 )\n  {\nLABEL_9:\n    j_j_free_0(v6);\n    return 0xFFFFFFFFLL;\n  }\n  v12 = v8;\n  v10 = uncompress(v9, &v12, (unsigned int)((_DWORD)v6 + 16), (unsigned int)(v11 - 16));\n  j_j_free_0(v6);\n  if ( v10 )\n  {\n    free(*a2);\n    *a2 = nullptr;\n    return 0xFFFFFFFFLL;\n  }\n  return v8;\n}", "assembly": "; \n; cocos2d::ZipUtils::ccInflateCCZFile from 0x1800a36e0 to 0x1800a3835 (341 bytes)\n; \n; 6 xrefs:\n; > sub_1800AA090 @ 0x1800aa2ec\n; > <???> @ 0x18013f9ec\n; > <???> @ 0x18013fa00\n; > <???> @ 0x18013fa10\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b7ab8\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\npush    rbx                                                            ; +0x0, 0x1800a36e0\npush    rdi                                                            ; +0x2, 0x1800a36e2\npush    r14                                                            ; +0x3, 0x1800a36e3\nsub     rsp, 30h                                                       ; +0x5, 0x1800a36e5\nmov     r14, rdx                                                       ; +0x9, 0x1800a36e9\nmov     [rsp+48h+arg_10], 0                                            ; +0xc, 0x1800a36ec\nmov     rbx, rcx                                                       ; +0x14, 0x1800a36f4\ncall    ?sharedFileUtils@CCFileUtils@cocos2d@@SAPEAV12@XZ; cocos2d::CCFileUtils::sharedFileUtils(void) ; +0x17, 0x1800a36f7\nlea     r9, [rsp+48h+arg_10]                                           ; +0x1c, 0x1800a36fc\nmov     rdx, rbx                                                       ; +0x21, 0x1800a3701\nlea     r8, aRb_0; \"rb\"                                                ; +0x24, 0x1800a3704\nmov     rcx, rax                                                       ; +0x2b, 0x1800a370b\nmov     r10, [rax]                                                     ; +0x2e, 0x1800a370e\ncall    qword ptr [r10+18h]                                            ; +0x31, 0x1800a3711\nmov     rdi, rax                                                       ; +0x35, 0x1800a3715\ntest    rax, rax                                                       ; +0x38, 0x1800a3718\njz      loc_1800A3827                                                  ; +0x3b, 0x1800a371b\nmov     edx, [rsp+48h+arg_10]                                          ; +0x41, 0x1800a3721\ntest    edx, edx                                                       ; +0x45, 0x1800a3725\njz      loc_1800A3827                                                  ; +0x47, 0x1800a3727\ncmp     byte ptr [rax], 43h ; 'C'                                      ; +0x4d, 0x1800a372d\nmov     [rsp+48h+arg_0], rsi                                           ; +0x50, 0x1800a3730\njnz     short loc_1800A376E                                            ; +0x55, 0x1800a3735\ncmp     byte ptr [rax+1], 43h ; 'C'                                    ; +0x57, 0x1800a3737\njnz     short loc_1800A376E                                            ; +0x5b, 0x1800a373b\ncmp     byte ptr [rax+2], 5Ah ; 'Z'                                    ; +0x5d, 0x1800a373d\njnz     short loc_1800A376E                                            ; +0x61, 0x1800a3741\ncmp     byte ptr [rax+3], 21h ; '!'                                    ; +0x63, 0x1800a3743\njnz     short loc_1800A3789                                            ; +0x67, 0x1800a3747\nmovzx   eax, word ptr [rax+6]                                          ; +0x69, 0x1800a3749\nmovzx   ecx, al                                                        ; +0x6d, 0x1800a374d\nshl     ecx, 8                                                         ; +0x70, 0x1800a3750\nshr     eax, 8                                                         ; +0x73, 0x1800a3753\nor      ecx, eax                                                       ; +0x76, 0x1800a3756\ncmp     ecx, 2                                                         ; +0x78, 0x1800a3758\nja      short loc_1800A376E                                            ; +0x7b, 0x1800a375b\nmovzx   ecx, word ptr [rdi+4]                                          ; +0x7d, 0x1800a375d\nmovzx   eax, cl                                                        ; +0x81, 0x1800a3761\nshl     eax, 8                                                         ; +0x84, 0x1800a3764\nshr     ecx, 8                                                         ; +0x87, 0x1800a3767\nor      eax, ecx                                                       ; +0x8a, 0x1800a376a\njz      short loc_1800A37C0                                            ; +0x8c, 0x1800a376c\nmov     rcx, rdi; Block                                                ; +0x8e, 0x1800a376e\ncall    j_j_free_0                                                     ; +0x91, 0x1800a3771\nmov     rsi, [rsp+48h+arg_0]                                           ; +0x96, 0x1800a3776\nmov     eax, 0FFFFFFFFh                                                ; +0x9b, 0x1800a377b\nadd     rsp, 30h                                                       ; +0xa0, 0x1800a3780\npop     r14                                                            ; +0xa4, 0x1800a3784\npop     rdi                                                            ; +0xa6, 0x1800a3786\npop     rbx                                                            ; +0xa7, 0x1800a3787\nretn                                                                   ; +0xa8, 0x1800a3788\ncmp     byte ptr [rax+3], 70h ; 'p'                                    ; +0xa9, 0x1800a3789\njnz     short loc_1800A376E                                            ; +0xad, 0x1800a378d\nmovzx   ecx, word ptr [rax+6]                                          ; +0xaf, 0x1800a378f\nmovzx   eax, cl                                                        ; +0xb3, 0x1800a3793\nshl     eax, 8                                                         ; +0xb6, 0x1800a3796\nshr     ecx, 8                                                         ; +0xb9, 0x1800a3799\nor      eax, ecx                                                       ; +0xbc, 0x1800a379c\nja      short loc_1800A376E                                            ; +0xbe, 0x1800a379e\nmovzx   ecx, word ptr [rdi+4]                                          ; +0xc0, 0x1800a37a0\nmovzx   eax, cl                                                        ; +0xc4, 0x1800a37a4\nshl     eax, 8                                                         ; +0xc7, 0x1800a37a7\nshr     ecx, 8                                                         ; +0xca, 0x1800a37aa\nor      eax, ecx                                                       ; +0xcd, 0x1800a37ad\njnz     short loc_1800A376E                                            ; +0xcf, 0x1800a37af\nadd     edx, 0FFFFFFF4h                                                ; +0xd1, 0x1800a37b1\nlea     rcx, [rdi+0Ch]; unsigned int *                                 ; +0xd4, 0x1800a37b4\nshr     edx, 2; int                                                    ; +0xd8, 0x1800a37b8\ncall    ?ccDecodeEncodedPvr@ZipUtils@cocos2d@@CAXPEAIH@Z; cocos2d::ZipUtils::ccDecodeEncodedPvr(uint *,int) ; +0xdb, 0x1800a37bb\nmov     esi, [rdi+0Ch]                                                 ; +0xe0, 0x1800a37c0\nbswap   esi                                                            ; +0xe3, 0x1800a37c3\nmov     ecx, esi; Size                                                 ; +0xe5, 0x1800a37c5\ncall    cs:__imp_malloc                                                ; +0xe7, 0x1800a37c7\nmov     [r14], rax                                                     ; +0xed, 0x1800a37cd\ntest    rax, rax                                                       ; +0xf0, 0x1800a37d0\njz      short loc_1800A376E                                            ; +0xf3, 0x1800a37d3\nmov     r9d, [rsp+48h+arg_10]                                          ; +0xf5, 0x1800a37d5\nlea     r8d, [rdi+10h]                                                 ; +0xfa, 0x1800a37da\nadd     r9d, 0FFFFFFF0h                                                ; +0xfe, 0x1800a37de\nmov     [rsp+48h+arg_18], esi                                          ; +0x102, 0x1800a37e2\nlea     rdx, [rsp+48h+arg_18]                                          ; +0x106, 0x1800a37e6\nmov     rcx, rax                                                       ; +0x10b, 0x1800a37eb\ncall    cs:uncompress                                                  ; +0x10e, 0x1800a37ee\nmov     rcx, rdi; Block                                                ; +0x114, 0x1800a37f4\nmov     ebx, eax                                                       ; +0x117, 0x1800a37f7\ncall    j_j_free_0                                                     ; +0x119, 0x1800a37f9\ntest    ebx, ebx                                                       ; +0x11e, 0x1800a37fe\njz      short loc_1800A3817                                            ; +0x120, 0x1800a3800\nmov     rcx, [r14]; Block                                              ; +0x122, 0x1800a3802\ncall    cs:__imp_free                                                  ; +0x125, 0x1800a3805\nmov     qword ptr [r14], 0                                             ; +0x12b, 0x1800a380b\njmp     loc_1800A3776                                                  ; +0x132, 0x1800a3812\nmov     eax, esi                                                       ; +0x137, 0x1800a3817\nmov     rsi, [rsp+48h+arg_0]                                           ; +0x139, 0x1800a3819\nadd     rsp, 30h                                                       ; +0x13e, 0x1800a381e\npop     r14                                                            ; +0x142, 0x1800a3822\npop     rdi                                                            ; +0x144, 0x1800a3824\npop     rbx                                                            ; +0x145, 0x1800a3825\nretn                                                                   ; +0x146, 0x1800a3826\nmov     eax, 0FFFFFFFFh                                                ; +0x147, 0x1800a3827\nadd     rsp, 30h                                                       ; +0x14c, 0x1800a382c\npop     r14                                                            ; +0x150, 0x1800a3830\npop     rdi                                                            ; +0x152, 0x1800a3832\npop     rbx                                                            ; +0x153, 0x1800a3833\nretn                                                                   ; +0x154, 0x1800a3834", "xrefs": ["sub_1800AA090 @ 0x1800aa2ec", "<???> @ 0x18013f9ec", "<???> @ 0x18013fa00", "<???> @ 0x18013fa10", "<???> @ 0x1801438a8", "<???> @ 0x1801b7ab8"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}