{"type": "func", "start": 6443110720, "end": 6443111389, "name": "cocos2d::unzLocateFile", "pseudocode": "// \n// cocos2d::unzLocateFile from 0x1800a1140 to 0x1800a13dd (669 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCFileUtils::getFileDataFromZip @ 0x1800700cb\n// > <???> @ 0x18013f324\n// > <???> @ 0x18013f334\n// > <???> @ 0x18013f354\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b7878\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::unzLocateFile(cocos2d *this, _BYTE *a2, const char *a3)\n{\n  int v3; // ebp\n  unsigned __int64 v6; // rax\n  __int64 result; // rax\n  __int64 v8; // rbx\n  __int64 v9; // r14\n  __int64 v10; // r15\n  int v11; // eax\n  unsigned __int8 *v12; // rax\n  signed __int64 v13; // rdx\n  unsigned __int8 v14; // cl\n  int v15; // eax\n  char *v16; // r10\n  char v17; // dl\n  char v18; // r8\n  char v19; // r9\n  char v20; // dl\n  __int64 v21; // [rsp+50h] [rbp-1A8h]\n  __int128 v22; // [rsp+58h] [rbp-1A0h]\n  __int128 v23; // [rsp+68h] [rbp-190h]\n  __int128 v24; // [rsp+78h] [rbp-180h]\n  __int128 v25; // [rsp+88h] [rbp-170h]\n  __int128 v26; // [rsp+98h] [rbp-160h]\n  _BYTE v27[272]; // [rsp+B0h] [rbp-148h] BYREF\n\n  v3 = (int)a3;\n  if ( !this )\n    return 4294967194LL;\n  v6 = -1;\n  do\n    ++v6;\n  while ( a2[v6] );\n  if ( v6 >= 0x100 )\n    return 4294967194LL;\n  if ( !*((_QWORD *)this + 18) )\n    return 4294967196LL;\n  v8 = *((_QWORD *)this + 33);\n  v22 = *((_OWORD *)this + 11);\n  v9 = *((_QWORD *)this + 16);\n  v23 = *((_OWORD *)this + 12);\n  v10 = *((_QWORD *)this + 17);\n  v24 = *((_OWORD *)this + 13);\n  v25 = *((_OWORD *)this + 14);\n  v26 = *((_OWORD *)this + 15);\n  v21 = *((_QWORD *)this + 32);\n  for ( result = cocos2d::unzGoToFirstFile(this, a2);\n        !(_DWORD)result;\n        result = cocos2d::unzGoToNextFile64(this, nullptr, nullptr, nullptr) )\n  {\n    result = sub_18009FC50((__int64)this, 0, nullptr, (__int64)v27, 0x100u, 0, 0, 0, 0);\n    if ( (_DWORD)result )\n      break;\n    v11 = 2;\n    if ( v3 )\n      v11 = v3;\n    if ( v11 == 1 )\n    {\n      v12 = v27;\n      v13 = a2 - v27;\n      while ( 1 )\n      {\n        v14 = *v12;\n        if ( *v12 != v12[v13] )\n          break;\n        ++v12;\n        if ( !v14 )\n        {\n          v15 = 0;\n          goto LABEL_29;\n        }\n      }\n      v15 = v14 < v12[v13] ? -1 : 1;\n    }\n    else\n    {\n      v16 = a2;\n      while ( 1 )\n      {\n        v17 = v16[v27 - a2];\n        v18 = *v16++;\n        v19 = v17 - 32;\n        if ( (unsigned __int8)(v17 - 97) > 0x19u )\n          v19 = v17;\n        v20 = v18 - 32;\n        if ( (unsigned __int8)(v18 - 97) > 0x19u )\n          v20 = v18;\n        if ( !v19 )\n          break;\n        if ( !v20 )\n          goto LABEL_26;\n        if ( v19 < v20 )\n        {\n          v15 = -1;\n          goto LABEL_29;\n        }\n        if ( v19 > v20 )\n        {\nLABEL_26:\n          v15 = 1;\n          goto LABEL_29;\n        }\n      }\n      v15 = -(v20 != 0);\n    }\nLABEL_29:\n    if ( !v15 )\n      return 0;\n  }\n  *((_QWORD *)this + 16) = v9;\n  *((_QWORD *)this + 17) = v10;\n  *((_OWORD *)this + 11) = v22;\n  *((_QWORD *)this + 33) = v8;\n  *((_OWORD *)this + 12) = v23;\n  *((_OWORD *)this + 13) = v24;\n  *((_OWORD *)this + 14) = v25;\n  *((_OWORD *)this + 15) = v26;\n  *((_QWORD *)this + 32) = v21;\n  return result;\n}", "assembly": "; \n; cocos2d::unzLocateFile from 0x1800a1140 to 0x1800a13dd (669 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCFileUtils::getFileDataFromZip @ 0x1800700cb\n; > <???> @ 0x18013f324\n; > <???> @ 0x18013f334\n; > <???> @ 0x18013f354\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b7878\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    rbp                                                            ; +0x0, 0x1800a1140\npush    rsi                                                            ; +0x2, 0x1800a1142\npush    rdi                                                            ; +0x3, 0x1800a1143\nsub     rsp, 1E0h                                                      ; +0x4, 0x1800a1144\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x1800a114b\nxor     rax, rsp                                                       ; +0x12, 0x1800a1152\nmov     [rsp+1F8h+var_38], rax                                         ; +0x15, 0x1800a1155\nmov     ebp, r8d                                                       ; +0x1d, 0x1800a115d\nmov     rsi, rdx                                                       ; +0x20, 0x1800a1160\nmov     rdi, rcx                                                       ; +0x23, 0x1800a1163\ntest    rcx, rcx                                                       ; +0x26, 0x1800a1166\njz      loc_1800A13D6                                                  ; +0x29, 0x1800a1169\nmov     rax, 0FFFFFFFFFFFFFFFFh                                        ; +0x2f, 0x1800a116f\ninc     rax                                                            ; +0x36, 0x1800a1176\ncmp     byte ptr [rdx+rax], 0                                          ; +0x39, 0x1800a1179\njnz     short loc_1800A1176                                            ; +0x3d, 0x1800a117d\ncmp     rax, 100h                                                      ; +0x3f, 0x1800a117f\njnb     loc_1800A13D6                                                  ; +0x45, 0x1800a1185\ncmp     qword ptr [rcx+90h], 0                                         ; +0x4b, 0x1800a118b\njnz     short loc_1800A119F                                            ; +0x53, 0x1800a1193\nmov     eax, 0FFFFFF9Ch                                                ; +0x55, 0x1800a1195\njmp     loc_1800A13B7                                                  ; +0x5a, 0x1800a119a\nmovups  xmm0, xmmword ptr [rcx+0B0h]                                   ; +0x5f, 0x1800a119f\nmov     [rsp+1F8h+arg_8], rbx                                          ; +0x66, 0x1800a11a6\nmov     rbx, [rcx+108h]                                                ; +0x6e, 0x1800a11ae\nmovups  [rsp+1F8h+var_1A0], xmm0                                       ; +0x75, 0x1800a11b5\nmov     [rsp+1F8h+arg_10], r12                                         ; +0x7a, 0x1800a11ba\nmovups  xmm0, xmmword ptr [rcx+0C0h]                                   ; +0x82, 0x1800a11c2\nmov     [rsp+1F8h+var_20], r14                                         ; +0x89, 0x1800a11c9\nmov     r14, [rcx+80h]                                                 ; +0x91, 0x1800a11d1\nmovups  [rsp+1F8h+var_190], xmm0                                       ; +0x98, 0x1800a11d8\nmov     [rsp+1F8h+var_28], r15                                         ; +0x9d, 0x1800a11dd\nmovups  xmm0, xmmword ptr [rcx+0D0h]                                   ; +0xa5, 0x1800a11e5\nmov     r15, [rcx+88h]                                                 ; +0xac, 0x1800a11ec\nmovups  [rsp+1F8h+var_180], xmm0                                       ; +0xb3, 0x1800a11f3\nmovups  xmm0, xmmword ptr [rcx+0E0h]                                   ; +0xb8, 0x1800a11f8\nmovups  [rsp+1F8h+var_170], xmm0                                       ; +0xbf, 0x1800a11ff\nmovups  xmm0, xmmword ptr [rcx+0F0h]                                   ; +0xc7, 0x1800a1207\nmovups  [rsp+1F8h+var_160], xmm0                                       ; +0xce, 0x1800a120e\nmovsd   xmm0, qword ptr [rcx+100h]                                     ; +0xd6, 0x1800a1216\nmovsd   [rsp+1F8h+var_1A8], xmm0                                       ; +0xde, 0x1800a121e\ncall    ?unzGoToFirstFile@cocos2d@@YAHPEAX@Z; cocos2d::unzGoToFirstFile(void *) ; +0xe4, 0x1800a1224\ntest    eax, eax                                                       ; +0xe9, 0x1800a1229\njnz     loc_1800A1332                                                  ; +0xeb, 0x1800a122b\nxor     r12d, r12d                                                     ; +0xf1, 0x1800a1231\nnop     dword ptr [rax+00h]                                            ; +0xf4, 0x1800a1234\nnop     dword ptr [rax+rax+00000000h]                                  ; +0xf8, 0x1800a1238\nmov     [rsp+1F8h+var_1B8], r12d                                       ; +0x100, 0x1800a1240\nlea     r9, [rsp+1F8h+var_148]                                         ; +0x105, 0x1800a1245\nmov     [rsp+1F8h+var_1C0], r12                                        ; +0x10d, 0x1800a124d\nxor     r8d, r8d                                                       ; +0x112, 0x1800a1252\nmov     [rsp+1F8h+var_1C8], r12d                                       ; +0x115, 0x1800a1255\nxor     edx, edx                                                       ; +0x11a, 0x1800a125a\nmov     [rsp+1F8h+var_1D0], r12                                        ; +0x11c, 0x1800a125c\nmov     rcx, rdi                                                       ; +0x121, 0x1800a1261\nmov     [rsp+1F8h+var_1D8], 100h; unsigned int                         ; +0x124, 0x1800a1264\ncall    sub_18009FC50                                                  ; +0x12c, 0x1800a126c\ntest    eax, eax                                                       ; +0x131, 0x1800a1271\njnz     loc_1800A1332                                                  ; +0x133, 0x1800a1273\ntest    ebp, ebp                                                       ; +0x139, 0x1800a1279\nmov     eax, 2                                                         ; +0x13b, 0x1800a127b\ncmovnz  eax, ebp                                                       ; +0x140, 0x1800a1280\ncmp     eax, 1                                                         ; +0x143, 0x1800a1283\njnz     short loc_1800A12B1                                            ; +0x146, 0x1800a1286\nlea     rax, [rsp+1F8h+var_148]                                        ; +0x148, 0x1800a1288\nmov     rdx, rsi                                                       ; +0x150, 0x1800a1290\nsub     rdx, rax                                                       ; +0x153, 0x1800a1293\nmovzx   ecx, byte ptr [rax]                                            ; +0x156, 0x1800a1296\ncmp     cl, [rax+rdx]                                                  ; +0x159, 0x1800a1299\njnz     short loc_1800A12AA                                            ; +0x15c, 0x1800a129c\ninc     rax                                                            ; +0x15e, 0x1800a129e\ntest    cl, cl                                                         ; +0x161, 0x1800a12a1\njnz     short loc_1800A1296                                            ; +0x163, 0x1800a12a3\nmov     eax, r12d                                                      ; +0x165, 0x1800a12a5\njmp     short loc_1800A1312                                            ; +0x168, 0x1800a12a8\nsbb     eax, eax                                                       ; +0x16a, 0x1800a12aa\nor      eax, 1                                                         ; +0x16c, 0x1800a12ac\njmp     short loc_1800A1312                                            ; +0x16f, 0x1800a12af\nlea     r11, [rsp+1F8h+var_148]                                        ; +0x171, 0x1800a12b1\nmov     r10, rsi                                                       ; +0x179, 0x1800a12b9\nsub     r11, rsi                                                       ; +0x17c, 0x1800a12bc\nnop                                                                    ; +0x17f, 0x1800a12bf\nmovzx   edx, byte ptr [r11+r10]                                        ; +0x180, 0x1800a12c0\nmovzx   r8d, byte ptr [r10]                                            ; +0x185, 0x1800a12c5\nlea     r10, [r10+1]                                                   ; +0x189, 0x1800a12c9\nlea     ecx, [rdx-61h]                                                 ; +0x18d, 0x1800a12cd\nlea     eax, [rdx-20h]                                                 ; +0x190, 0x1800a12d0\ncmp     cl, 19h                                                        ; +0x193, 0x1800a12d3\nmovzx   r9d, al                                                        ; +0x196, 0x1800a12d6\nlea     ecx, [r8-61h]                                                  ; +0x19a, 0x1800a12da\ncmova   r9d, edx                                                       ; +0x19e, 0x1800a12de\nlea     eax, [r8-20h]                                                  ; +0x1a2, 0x1800a12e2\ncmp     cl, 19h                                                        ; +0x1a6, 0x1800a12e6\nmovzx   edx, al                                                        ; +0x1a9, 0x1800a12e9\ncmova   edx, r8d                                                       ; +0x1ac, 0x1800a12ec\ntest    r9b, r9b                                                       ; +0x1b0, 0x1800a12f0\njz      short loc_1800A130E                                            ; +0x1b3, 0x1800a12f3\ntest    dl, dl                                                         ; +0x1b5, 0x1800a12f5\njz      short loc_1800A1300                                            ; +0x1b7, 0x1800a12f7\ncmp     r9b, dl                                                        ; +0x1b9, 0x1800a12f9\njl      short loc_1800A1307                                            ; +0x1bc, 0x1800a12fc\njle     short loc_1800A12C0                                            ; +0x1be, 0x1800a12fe\nmov     eax, 1                                                         ; +0x1c0, 0x1800a1300\njmp     short loc_1800A1312                                            ; +0x1c5, 0x1800a1305\nmov     eax, 0FFFFFFFFh                                                ; +0x1c7, 0x1800a1307\njmp     short loc_1800A1312                                            ; +0x1cc, 0x1800a130c\nneg     dl                                                             ; +0x1ce, 0x1800a130e\nsbb     eax, eax                                                       ; +0x1d0, 0x1800a1310\ntest    eax, eax                                                       ; +0x1d2, 0x1800a1312\njz      loc_1800A13D2                                                  ; +0x1d4, 0x1800a1314\nxor     r9d, r9d; char *                                               ; +0x1da, 0x1800a131a\nxor     r8d, r8d; struct cocos2d::unz_file_info64_s *                  ; +0x1dd, 0x1800a131d\nxor     edx, edx; void *                                               ; +0x1e0, 0x1800a1320\nmov     rcx, rdi; this                                                 ; +0x1e2, 0x1800a1322\ncall    ?unzGoToNextFile64@cocos2d@@YAHPEAXPEAUunz_file_info64_s@1@PEADK@Z; cocos2d::unzGoToNextFile64(void *,cocos2d::unz_file_info64_s *,char *,ulong) ; +0x1e5, 0x1800a1325\ntest    eax, eax                                                       ; +0x1ea, 0x1800a132a\njz      loc_1800A1240                                                  ; +0x1ec, 0x1800a132c\nmovups  xmm0, [rsp+1F8h+var_1A0]                                       ; +0x1f2, 0x1800a1332\nmov     [rdi+80h], r14                                                 ; +0x1f7, 0x1800a1337\nmovups  xmm1, [rsp+1F8h+var_190]                                       ; +0x1fe, 0x1800a133e\nmov     [rdi+88h], r15                                                 ; +0x203, 0x1800a1343\nmovups  xmmword ptr [rdi+0B0h], xmm0                                   ; +0x20a, 0x1800a134a\nmov     [rdi+108h], rbx                                                ; +0x211, 0x1800a1351\nmovups  xmm0, [rsp+1F8h+var_180]                                       ; +0x218, 0x1800a1358\nmovups  xmmword ptr [rdi+0C0h], xmm1                                   ; +0x21d, 0x1800a135d\nmovups  xmm1, [rsp+1F8h+var_170]                                       ; +0x224, 0x1800a1364\nmovups  xmmword ptr [rdi+0D0h], xmm0                                   ; +0x22c, 0x1800a136c\nmovups  xmm0, [rsp+1F8h+var_160]                                       ; +0x233, 0x1800a1373\nmovups  xmmword ptr [rdi+0E0h], xmm1                                   ; +0x23b, 0x1800a137b\nmovups  xmmword ptr [rdi+0F0h], xmm0                                   ; +0x242, 0x1800a1382\nmovsd   xmm0, [rsp+1F8h+var_1A8]                                       ; +0x249, 0x1800a1389\nmovsd   qword ptr [rdi+100h], xmm0                                     ; +0x24f, 0x1800a138f\nmov     r14, [rsp+1F8h+var_20]                                         ; +0x257, 0x1800a1397\nmov     r12, [rsp+1F8h+arg_10]                                         ; +0x25f, 0x1800a139f\nmov     rbx, [rsp+1F8h+arg_8]                                          ; +0x267, 0x1800a13a7\nmov     r15, [rsp+1F8h+var_28]                                         ; +0x26f, 0x1800a13af\nmov     rcx, [rsp+1F8h+var_38]                                         ; +0x277, 0x1800a13b7\nxor     rcx, rsp; StackCookie                                          ; +0x27f, 0x1800a13bf\ncall    __security_check_cookie                                        ; +0x282, 0x1800a13c2\nadd     rsp, 1E0h                                                      ; +0x287, 0x1800a13c7\npop     rdi                                                            ; +0x28e, 0x1800a13ce\npop     rsi                                                            ; +0x28f, 0x1800a13cf\npop     rbp                                                            ; +0x290, 0x1800a13d0\nretn                                                                   ; +0x291, 0x1800a13d1\nxor     eax, eax                                                       ; +0x292, 0x1800a13d2\njmp     short loc_1800A1397                                            ; +0x294, 0x1800a13d4\nmov     eax, 0FFFFFF9Ah                                                ; +0x296, 0x1800a13d6\njmp     short loc_1800A13B7                                            ; +0x29b, 0x1800a13db", "xrefs": ["cocos2d::CCFileUtils::getFileDataFromZip @ 0x1800700cb", "<???> @ 0x18013f324", "<???> @ 0x18013f334", "<???> @ 0x18013f354", "<???> @ 0x1801438a8", "<???> @ 0x1801b7878"], "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"}