{"type": "func", "start": 6442894656, "end": 6442895042, "name": "sub_18006C540", "pseudocode": "// \n// sub_18006C540 from 0x18006c540 to 0x18006c6c2 (386 bytes)\n// \n// 7 xrefs:\n// > cocos2d::CCFileUtils::addSearchPath @ 0x18006d956\n// > cocos2d::CCFileUtils::init @ 0x180070673\n// > cocos2d::CCFileUtils::setSearchPaths @ 0x180071523\n// > cocos2d::CCFileUtils::setSearchPaths @ 0x180071601\n// > cocos2d::CCFileUtils::setSearchResolutionsOrder @ 0x180071866\n// > sub_180073010 @ 0x180073167\n// > <???> @ 0x1801b3f60\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 sub_18006C540(__int64 *a1, __int64 a2, __int64 a3)\n{\n  __int64 v5; // r14\n  __int64 v6; // rax\n  unsigned __int64 v7; // r13\n  unsigned __int64 v8; // rcx\n  unsigned __int64 v9; // rdx\n  unsigned __int64 v10; // rdi\n  size_t v11; // rcx\n  void *v12; // rax\n  _OWORD *v13; // rbx\n  __int64 v14; // r14\n  _OWORD *v15; // r15\n  __int64 v16; // rdx\n  __int64 v17; // rcx\n  __int64 v19; // [rsp+28h] [rbp-40h]\n  __int64 v21; // [rsp+78h] [rbp+10h]\n  __int64 v22; // [rsp+80h] [rbp+18h]\n  __int64 v23; // [rsp+88h] [rbp+20h]\n\n  v22 = a3;\n  v5 = a2 - *a1;\n  v6 = (a1[1] - *a1) >> 5;\n  if ( v6 == 0x7FFFFFFFFFFFFFFLL )\n    std::vector<void *>::_Xlen();\n  v7 = v6 + 1;\n  v8 = (a1[2] - *a1) >> 5;\n  v9 = v8 >> 1;\n  if ( v8 > 0x7FFFFFFFFFFFFFFLL - (v8 >> 1) )\n    goto LABEL_21;\n  v10 = v6 + 1;\n  if ( v9 + v8 >= v7 )\n    v10 = v9 + v8;\n  if ( v10 > 0x7FFFFFFFFFFFFFFLL )\n    goto LABEL_21;\n  v11 = 32 * v10;\n  v23 = v10;\n  if ( 32 * v10 < 0x1000 )\n  {\n    if ( v11 )\n    {\n      v13 = operator new(v11);\n      a3 = v22;\n    }\n    else\n    {\n      v13 = nullptr;\n    }\n    v23 = v10;\n    goto LABEL_15;\n  }\n  if ( v11 + 39 < v11 )\nLABEL_21:\n    Concurrency::cancel_current_task();\n  v12 = operator new(v11 + 39);\n  if ( !v12 )\n    invalid_parameter_noinfo_noreturn();\n  v13 = (_OWORD *)(((unsigned __int64)v12 + 39) & 0xFFFFFFFFFFFFFFE0uLL);\n  *((_QWORD *)v13 - 1) = v12;\n  a3 = v22;\nLABEL_15:\n  v14 = (__int64)v13 + (v5 & 0xFFFFFFFFFFFFFFE0uLL);\n  v15 = (_OWORD *)(v14 + 32);\n  v19 = v14 + 32;\n  try\n  {\n    sub_180016C80(v14, a3);\n    v21 = v14;\n    v16 = a1[1];\n    v17 = *a1;\n    if ( a2 == v16 )\n    {\n      v15 = v13;\n    }\n    else\n    {\n      sub_18000D200(v17, a2, v13);\n      v21 = (__int64)v13;\n      v17 = a2;\n      v16 = a1[1];\n    }\n    sub_18000D200(v17, v16, v15);\n  }\n  catch ( ... )\n  {\n    sub_18000CF70(v21, v19);\n    sub_18000E060((__int64)a1, v13, v23);\n    throw;\n  }\n  sub_18006D220(a1, v13, v7, v10, v13, v19);\n  return v14;\n}", "assembly": "; \n; sub_18006C540 from 0x18006c540 to 0x18006c6c2 (386 bytes)\n; \n; 7 xrefs:\n; > cocos2d::CCFileUtils::addSearchPath @ 0x18006d956\n; > cocos2d::CCFileUtils::init @ 0x180070673\n; > cocos2d::CCFileUtils::setSearchPaths @ 0x180071523\n; > cocos2d::CCFileUtils::setSearchPaths @ 0x180071601\n; > cocos2d::CCFileUtils::setSearchResolutionsOrder @ 0x180071866\n; > sub_180073010 @ 0x180073167\n; > <???> @ 0x1801b3f60\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\nmov     [rsp+arg_10], r8                                               ; +0x0, 0x18006c540\nmov     [rsp+arg_0], rcx                                               ; +0x5, 0x18006c545\npush    rbx                                                            ; +0xa, 0x18006c54a\npush    rsi                                                            ; +0xb, 0x18006c54b\npush    rdi                                                            ; +0xc, 0x18006c54c\npush    r12                                                            ; +0xd, 0x18006c54d\npush    r13                                                            ; +0xf, 0x18006c54f\npush    r14                                                            ; +0x11, 0x18006c551\npush    r15                                                            ; +0x13, 0x18006c553\nsub     rsp, 30h                                                       ; +0x15, 0x18006c555\nmov     r12, rdx                                                       ; +0x19, 0x18006c559\nmov     rsi, rcx                                                       ; +0x1c, 0x18006c55c\nmov     r9, [rcx]                                                      ; +0x1f, 0x18006c55f\nmov     r14, rdx                                                       ; +0x22, 0x18006c562\nsub     r14, r9                                                        ; +0x25, 0x18006c565\nmov     rax, [rcx+8]                                                   ; +0x28, 0x18006c568\nsub     rax, r9                                                        ; +0x2c, 0x18006c56c\nsar     rax, 5                                                         ; +0x2f, 0x18006c56f\nmov     r10, 7FFFFFFFFFFFFFFh                                          ; +0x33, 0x18006c573\ncmp     rax, r10                                                       ; +0x3d, 0x18006c57d\njz      loc_18006C6BC                                                  ; +0x40, 0x18006c580\nlea     r13, [rax+1]                                                   ; +0x46, 0x18006c586\nmov     rcx, [rcx+10h]                                                 ; +0x4a, 0x18006c58a\nsub     rcx, r9                                                        ; +0x4e, 0x18006c58e\nsar     rcx, 5                                                         ; +0x51, 0x18006c591\nmov     rdx, rcx                                                       ; +0x55, 0x18006c595\nshr     rdx, 1                                                         ; +0x58, 0x18006c598\nmov     rax, r10                                                       ; +0x5b, 0x18006c59b\nsub     rax, rdx                                                       ; +0x5e, 0x18006c59e\ncmp     rcx, rax                                                       ; +0x61, 0x18006c5a1\nja      loc_18006C6B6                                                  ; +0x64, 0x18006c5a4\nlea     rax, [rdx+rcx]                                                 ; +0x6a, 0x18006c5aa\nmov     rdi, r13                                                       ; +0x6e, 0x18006c5ae\ncmp     rax, r13                                                       ; +0x71, 0x18006c5b1\ncmovnb  rdi, rax                                                       ; +0x74, 0x18006c5b4\ncmp     rdi, r10                                                       ; +0x78, 0x18006c5b8\nja      loc_18006C6B6                                                  ; +0x7b, 0x18006c5bb\nmov     rcx, rdi                                                       ; +0x81, 0x18006c5c1\nshl     rcx, 5; Size                                                   ; +0x84, 0x18006c5c4\nmov     [rsp+68h+arg_18], rdi                                          ; +0x88, 0x18006c5c8\ncmp     rcx, 1000h                                                     ; +0x90, 0x18006c5d0\njb      short loc_18006C610                                            ; +0x97, 0x18006c5d7\nlea     rax, [rcx+27h]                                                 ; +0x99, 0x18006c5d9\ncmp     rax, rcx                                                       ; +0x9d, 0x18006c5dd\njbe     loc_18006C6B6                                                  ; +0xa0, 0x18006c5e0\nmov     rcx, rax; Size                                                 ; +0xa6, 0x18006c5e6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xa9, 0x18006c5e9\ntest    rax, rax                                                       ; +0xae, 0x18006c5ee\njz      short loc_18006C609                                            ; +0xb1, 0x18006c5f1\nlea     rbx, [rax+27h]                                                 ; +0xb3, 0x18006c5f3\nand     rbx, 0FFFFFFFFFFFFFFE0h                                        ; +0xb7, 0x18006c5f7\nmov     [rbx-8], rax                                                   ; +0xbb, 0x18006c5fb\nmov     r8, [rsp+68h+arg_10]                                           ; +0xbf, 0x18006c5ff\njmp     short loc_18006C631                                            ; +0xc7, 0x18006c607\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xc9, 0x18006c609\nalign 10h                                                              ; +0xcf, 0x18006c60f\ntest    rcx, rcx                                                       ; +0xd0, 0x18006c610\njz      short loc_18006C627                                            ; +0xd3, 0x18006c613\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xd5, 0x18006c615\nmov     rbx, rax                                                       ; +0xda, 0x18006c61a\nmov     r8, [rsp+68h+arg_10]                                           ; +0xdd, 0x18006c61d\njmp     short loc_18006C629                                            ; +0xe5, 0x18006c625\nxor     ebx, ebx                                                       ; +0xe7, 0x18006c627\nmov     [rsp+68h+arg_18], rdi                                          ; +0xe9, 0x18006c629\nmov     [rsp+68h+var_48], rbx                                          ; +0xf1, 0x18006c631\nand     r14, 0FFFFFFFFFFFFFFE0h                                        ; +0xf6, 0x18006c636\nadd     r14, rbx                                                       ; +0xfa, 0x18006c63a\nlea     r15, [r14+20h]                                                 ; +0xfd, 0x18006c63d\nmov     [rsp+68h+var_40], r15                                          ; +0x101, 0x18006c641\nmov     [rsp+68h+arg_8], r15                                           ; +0x106, 0x18006c646\nmov     rdx, r8                                                        ; +0x10b, 0x18006c64b\nmov     rcx, r14                                                       ; +0x10e, 0x18006c64e\ncall    sub_180016C80                                                  ; +0x111, 0x18006c651\nmov     [rsp+68h+arg_8], r14                                           ; +0x116, 0x18006c656\nmov     rdx, [rsi+8]                                                   ; +0x11b, 0x18006c65b\nmov     rcx, [rsi]                                                     ; +0x11f, 0x18006c65f\ncmp     r12, rdx                                                       ; +0x122, 0x18006c662\njnz     short loc_18006C66C                                            ; +0x125, 0x18006c665\nmov     r15, rbx                                                       ; +0x127, 0x18006c667\njmp     short loc_18006C686                                            ; +0x12a, 0x18006c66a\nmov     r9, rsi                                                        ; +0x12c, 0x18006c66c\nmov     r8, rbx                                                        ; +0x12f, 0x18006c66f\nmov     rdx, r12                                                       ; +0x132, 0x18006c672\ncall    sub_18000D200                                                  ; +0x135, 0x18006c675\nmov     [rsp+68h+arg_8], rbx                                           ; +0x13a, 0x18006c67a\nmov     rcx, r12                                                       ; +0x13f, 0x18006c67f\nmov     rdx, [rsi+8]                                                   ; +0x142, 0x18006c682\nmov     r9, rsi                                                        ; +0x146, 0x18006c686\nmov     r8, r15                                                        ; +0x149, 0x18006c689\ncall    sub_18000D200                                                  ; +0x14c, 0x18006c68c\nnop                                                                    ; +0x151, 0x18006c691\nmov     r9, rdi                                                        ; +0x152, 0x18006c692\nmov     r8, r13                                                        ; +0x155, 0x18006c695\nmov     rdx, rbx                                                       ; +0x158, 0x18006c698\nmov     rcx, rsi                                                       ; +0x15b, 0x18006c69b\ncall    sub_18006D220                                                  ; +0x15e, 0x18006c69e\nmov     rax, r14                                                       ; +0x163, 0x18006c6a3\nadd     rsp, 30h                                                       ; +0x166, 0x18006c6a6\npop     r15                                                            ; +0x16a, 0x18006c6aa\npop     r14                                                            ; +0x16c, 0x18006c6ac\npop     r13                                                            ; +0x16e, 0x18006c6ae\npop     r12                                                            ; +0x170, 0x18006c6b0\npop     rdi                                                            ; +0x172, 0x18006c6b2\npop     rsi                                                            ; +0x173, 0x18006c6b3\npop     rbx                                                            ; +0x174, 0x18006c6b4\nretn                                                                   ; +0x175, 0x18006c6b5\ncall    ?cancel_current_task@Concurrency@@YAXXZ; Concurrency::cancel_current_task(void) ; +0x176, 0x18006c6b6\nalign 4                                                                ; +0x17b, 0x18006c6bb\ncall    ?_Xlen@?$vector@PEAXV?$allocator@PEAX@std@@@std@@IEBAXXZ_0; std::vector<void *>::_Xlen(void) ; +0x17c, 0x18006c6bc\ndb 0CCh                                                                ; +0x181, 0x18006c6c1", "xrefs": ["cocos2d::CCFileUtils::addSearchPath @ 0x18006d956", "cocos2d::CCFileUtils::init @ 0x180070673", "cocos2d::CCFileUtils::setSearchPaths @ 0x180071523", "cocos2d::CCFileUtils::setSearchPaths @ 0x180071601", "cocos2d::CCFileUtils::setSearchResolutionsOrder @ 0x180071866", "sub_180073010 @ 0x180073167", "<???> @ 0x1801b3f60"], "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"}