{"type": "func", "start": 6442457344, "end": 6442457944, "name": "cocos2d::extension::AssetsManager::checkUpdate", "pseudocode": "// \n// cocos2d::extension::AssetsManager::checkUpdate from 0x180001900 to 0x180001b58 (600 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x180023538\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x180049090\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// Hidden C++ exception states: #wind=1\nchar __fastcall cocos2d::extension::AssetsManager::checkUpdate(cocos2d::extension::AssetsManager *this)\n{\n  __int64 v2; // rax\n  _BYTE *v3; // rax\n  _QWORD *v4; // rax\n  __int64 v6; // rax\n  char *v7; // rdx\n  void **v8; // rcx\n  char *v9; // rsi\n  unsigned __int64 v10; // rbp\n  _QWORD *v11; // rax\n  char v12; // bl\n  char *v13; // rax\n  _QWORD *v14; // [rsp+20h] [rbp-48h]\n  _QWORD *v15; // [rsp+20h] [rbp-48h]\n  void *Buf1[2]; // [rsp+28h] [rbp-40h] BYREF\n  size_t Size; // [rsp+38h] [rbp-30h]\n  unsigned __int64 v18; // [rsp+40h] [rbp-28h]\n\n  if ( !*((_QWORD *)this + 15) )\n    return 0;\n  v2 = curl_easy_init();\n  *((_QWORD *)this + 21) = v2;\n  if ( !v2 )\n    return 0;\n  *((_QWORD *)this + 7) = 0;\n  v3 = (char *)this + 40;\n  if ( *((_QWORD *)this + 8) > 0xFu )\n    v3 = *((_BYTE **)this + 5);\n  *v3 = 0;\n  curl_easy_setopt(*((_QWORD *)this + 21), 10002);\n  curl_easy_setopt(*((_QWORD *)this + 21), 64);\n  curl_easy_setopt(*((_QWORD *)this + 21), 20011);\n  curl_easy_setopt(*((_QWORD *)this + 21), 10001);\n  if ( *((_DWORD *)this + 48) )\n    curl_easy_setopt(*((_QWORD *)this + 21), 78);\n  if ( (unsigned int)curl_easy_perform(*((_QWORD *)this + 21)) )\n  {\n    v14 = operator new(0x10u);\n    v14[1] = 0;\n    *(_DWORD *)v14 = 3;\n    v4 = operator new(0x10u);\n    *v4 = 1;\n    v4[1] = this;\n    v14[1] = v4;\n    sub_180002B70(*((_QWORD *)this + 22), v14);\n    curl_easy_cleanup(*((_QWORD *)this + 21));\n    return 0;\n  }\n  v6 = cocos2d::CCUserDefault::sharedUserDefault();\n  cocos2d::CCUserDefault::getStringForKey(v6, Buf1, \"current-version-code\");\n  v7 = (char *)this + 40;\n  if ( *((_QWORD *)this + 8) > 0xFu )\n    v7 = *((char **)this + 5);\n  v8 = Buf1;\n  v9 = (char *)Buf1[0];\n  v10 = v18;\n  if ( v18 > 0xF )\n    v8 = (void **)Buf1[0];\n  if ( Size == *((_QWORD *)this + 7) && !memcmp(v8, v7, Size) )\n  {\n    v15 = operator new(0x10u);\n    v15[1] = 0;\n    *(_DWORD *)v15 = 3;\n    v11 = operator new(0x10u);\n    *v11 = 2;\n    v11[1] = this;\n    v15[1] = v11;\n    sub_180002B70(*((_QWORD *)this + 22), v15);\n    cocos2d::extension::AssetsManager::setSearchPath(this);\n    v12 = 0;\n    v10 = v18;\n    v9 = (char *)Buf1[0];\n  }\n  else\n  {\n    v12 = 1;\n  }\n  if ( v10 > 0xF )\n  {\n    v13 = v9;\n    if ( v10 + 1 >= 0x1000 )\n    {\n      v9 = *((char **)v9 - 1);\n      if ( (unsigned __int64)(v13 - v9 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v9);\n  }\n  return v12;\n}", "assembly": "; \n; cocos2d::extension::AssetsManager::checkUpdate from 0x180001900 to 0x180001b58 (600 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x180023538\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x180049090\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_8], rbx                                               ; +0x0, 0x180001900\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x180001905\npush    rsi                                                            ; +0xa, 0x18000190a\npush    rdi                                                            ; +0xb, 0x18000190b\npush    r14                                                            ; +0xc, 0x18000190c\nsub     rsp, 50h                                                       ; +0xe, 0x18000190e\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x180001912\nxor     rax, rsp                                                       ; +0x19, 0x180001919\nmov     [rsp+68h+var_20], rax                                          ; +0x1c, 0x18000191c\nmov     rdi, rcx                                                       ; +0x21, 0x180001921\ncmp     qword ptr [rcx+78h], 0                                         ; +0x24, 0x180001924\njz      loc_180001A41                                                  ; +0x29, 0x180001929\ncall    cs:curl_easy_init                                              ; +0x2f, 0x18000192f\nmov     [rdi+0A8h], rax                                                ; +0x35, 0x180001935\ntest    rax, rax                                                       ; +0x3c, 0x18000193c\njz      loc_180001A41                                                  ; +0x3f, 0x18000193f\nxor     r14d, r14d                                                     ; +0x45, 0x180001945\nmov     [rdi+38h], r14                                                 ; +0x48, 0x180001948\nlea     rax, [rdi+28h]                                                 ; +0x4c, 0x18000194c\ncmp     qword ptr [rdi+40h], 0Fh                                       ; +0x50, 0x180001950\njbe     short loc_18000195B                                            ; +0x55, 0x180001955\nmov     rax, [rdi+28h]                                                 ; +0x57, 0x180001957\nmov     [rax], r14b                                                    ; +0x5b, 0x18000195b\nlea     r8, [rdi+68h]                                                  ; +0x5e, 0x18000195e\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x62, 0x180001962\njbe     short loc_18000196C                                            ; +0x67, 0x180001967\nmov     r8, [r8]                                                       ; +0x69, 0x180001969\nmov     edx, 2712h                                                     ; +0x6c, 0x18000196c\nmov     rcx, [rdi+0A8h]                                                ; +0x71, 0x180001971\ncall    cs:curl_easy_setopt                                            ; +0x78, 0x180001978\nxor     r8d, r8d                                                       ; +0x7e, 0x18000197e\nlea     edx, [r8+40h]                                                  ; +0x81, 0x180001981\nmov     rcx, [rdi+0A8h]                                                ; +0x85, 0x180001985\ncall    cs:curl_easy_setopt                                            ; +0x8c, 0x18000198c\nlea     r8, sub_180001880                                              ; +0x92, 0x180001992\nmov     edx, 4E2Bh                                                     ; +0x99, 0x180001999\nmov     rcx, [rdi+0A8h]                                                ; +0x9e, 0x18000199e\ncall    cs:curl_easy_setopt                                            ; +0xa5, 0x1800019a5\nlea     r8, [rdi+28h]                                                  ; +0xab, 0x1800019ab\nmov     edx, 2711h                                                     ; +0xaf, 0x1800019af\nmov     rcx, [rdi+0A8h]                                                ; +0xb4, 0x1800019b4\ncall    cs:curl_easy_setopt                                            ; +0xbb, 0x1800019bb\nmov     r8d, [rdi+0C0h]                                                ; +0xc1, 0x1800019c1\ntest    r8d, r8d                                                       ; +0xc8, 0x1800019c8\njz      short loc_1800019DF                                            ; +0xcb, 0x1800019cb\nmov     edx, 4Eh ; 'N'                                                 ; +0xcd, 0x1800019cd\nmov     rcx, [rdi+0A8h]                                                ; +0xd2, 0x1800019d2\ncall    cs:curl_easy_setopt                                            ; +0xd9, 0x1800019d9\nmov     rcx, [rdi+0A8h]                                                ; +0xdf, 0x1800019df\ncall    cs:curl_easy_perform                                           ; +0xe6, 0x1800019e6\ntest    eax, eax                                                       ; +0xec, 0x1800019ec\njz      short loc_180001A66                                            ; +0xee, 0x1800019ee\nmov     ecx, 10h; Size                                                 ; +0xf0, 0x1800019f0\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xf5, 0x1800019f5\nmov     rbx, rax                                                       ; +0xfa, 0x1800019fa\nmov     [rsp+68h+var_48], rax                                          ; +0xfd, 0x1800019fd\nmov     [rax+8], r14                                                   ; +0x102, 0x180001a02\nmov     dword ptr [rax], 3                                             ; +0x106, 0x180001a06\nmov     ecx, 10h; Size                                                 ; +0x10c, 0x180001a0c\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x111, 0x180001a11\nmov     qword ptr [rax], 1                                             ; +0x116, 0x180001a16\nmov     [rax+8], rdi                                                   ; +0x11d, 0x180001a1d\nmov     [rbx+8], rax                                                   ; +0x121, 0x180001a21\nmov     rdx, rbx                                                       ; +0x125, 0x180001a25\nmov     rcx, [rdi+0B0h]                                                ; +0x128, 0x180001a28\ncall    sub_180002B70                                                  ; +0x12f, 0x180001a2f\nmov     rcx, [rdi+0A8h]                                                ; +0x134, 0x180001a34\ncall    cs:curl_easy_cleanup                                           ; +0x13b, 0x180001a3b\nxor     al, al                                                         ; +0x141, 0x180001a41\nmov     rcx, [rsp+68h+var_20]                                          ; +0x143, 0x180001a43\nxor     rcx, rsp; StackCookie                                          ; +0x148, 0x180001a48\ncall    __security_check_cookie                                        ; +0x14b, 0x180001a4b\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x150, 0x180001a50\nmov     rbp, [rsp+68h+arg_10]                                          ; +0x155, 0x180001a55\nadd     rsp, 50h                                                       ; +0x15d, 0x180001a5d\npop     r14                                                            ; +0x161, 0x180001a61\npop     rdi                                                            ; +0x163, 0x180001a63\npop     rsi                                                            ; +0x164, 0x180001a64\nretn                                                                   ; +0x165, 0x180001a65\ncall    cs:?sharedUserDefault@CCUserDefault@cocos2d@@SAPEAV12@XZ; cocos2d::CCUserDefault::sharedUserDefault(void) ; +0x166, 0x180001a66\nmov     rcx, rax                                                       ; +0x16c, 0x180001a6c\nlea     r8, aCurrentVersion; \"current-version-code\"                    ; +0x16f, 0x180001a6f\nlea     rdx, [rsp+68h+Buf1]                                            ; +0x176, 0x180001a76\ncall    cs:?getStringForKey@CCUserDefault@cocos2d@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@Z; cocos2d::CCUserDefault::getStringForKey(char const *) ; +0x17b, 0x180001a7b\nnop                                                                    ; +0x181, 0x180001a81\nlea     rdx, [rdi+28h]                                                 ; +0x182, 0x180001a82\ncmp     qword ptr [rdi+40h], 0Fh                                       ; +0x186, 0x180001a86\njbe     short loc_180001A91                                            ; +0x18b, 0x180001a8b\nmov     rdx, [rdi+28h]; Buf2                                           ; +0x18d, 0x180001a8d\nlea     rcx, [rsp+68h+Buf1]                                            ; +0x191, 0x180001a91\nmov     rsi, [rsp+68h+Buf1]                                            ; +0x196, 0x180001a96\nmov     rbp, [rsp+68h+var_28]                                          ; +0x19b, 0x180001a9b\ncmp     rbp, 0Fh                                                       ; +0x1a0, 0x180001aa0\ncmova   rcx, rsi; Buf1                                                 ; +0x1a4, 0x180001aa4\nmov     r8, [rsp+68h+Size]; Size                                       ; +0x1a8, 0x180001aa8\ncmp     r8, [rdi+38h]                                                  ; +0x1ad, 0x180001aad\njnz     short loc_180001B14                                            ; +0x1b1, 0x180001ab1\ncall    memcmp                                                         ; +0x1b3, 0x180001ab3\ntest    eax, eax                                                       ; +0x1b8, 0x180001ab8\njnz     short loc_180001B14                                            ; +0x1ba, 0x180001aba\nlea     ecx, [rax+10h]; Size                                           ; +0x1bc, 0x180001abc\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1bf, 0x180001abf\nmov     rbx, rax                                                       ; +0x1c4, 0x180001ac4\nmov     [rsp+68h+var_48], rax                                          ; +0x1c7, 0x180001ac7\nmov     [rax+8], r14                                                   ; +0x1cc, 0x180001acc\nmov     dword ptr [rax], 3                                             ; +0x1d0, 0x180001ad0\nmov     ecx, 10h; Size                                                 ; +0x1d6, 0x180001ad6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1db, 0x180001adb\nmov     qword ptr [rax], 2                                             ; +0x1e0, 0x180001ae0\nmov     [rax+8], rdi                                                   ; +0x1e7, 0x180001ae7\nmov     [rbx+8], rax                                                   ; +0x1eb, 0x180001aeb\nmov     rdx, rbx                                                       ; +0x1ef, 0x180001aef\nmov     rcx, [rdi+0B0h]                                                ; +0x1f2, 0x180001af2\ncall    sub_180002B70                                                  ; +0x1f9, 0x180001af9\nmov     rcx, rdi; this                                                 ; +0x1fe, 0x180001afe\ncall    ?setSearchPath@AssetsManager@extension@cocos2d@@IEAAXXZ; cocos2d::extension::AssetsManager::setSearchPath(void) ; +0x201, 0x180001b01\nxor     bl, bl                                                         ; +0x206, 0x180001b06\nmov     rbp, [rsp+68h+var_28]                                          ; +0x208, 0x180001b08\nmov     rsi, [rsp+68h+Buf1]                                            ; +0x20d, 0x180001b0d\njmp     short loc_180001B16                                            ; +0x212, 0x180001b12\nmov     bl, 1                                                          ; +0x214, 0x180001b14\ncmp     rbp, 0Fh                                                       ; +0x216, 0x180001b16\njbe     short loc_180001B50                                            ; +0x21a, 0x180001b1a\nlea     rdx, [rbp+1]                                                   ; +0x21c, 0x180001b1c\nmov     rax, rsi                                                       ; +0x220, 0x180001b20\ncmp     rdx, 1000h                                                     ; +0x223, 0x180001b23\njb      short loc_180001B48                                            ; +0x22a, 0x180001b2a\nadd     rdx, 27h ; '''                                                 ; +0x22c, 0x180001b2c\nmov     rsi, [rsi-8]                                                   ; +0x230, 0x180001b30\nsub     rax, rsi                                                       ; +0x234, 0x180001b34\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x237, 0x180001b37\ncmp     rax, 1Fh                                                       ; +0x23b, 0x180001b3b\njbe     short loc_180001B48                                            ; +0x23f, 0x180001b3f\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x241, 0x180001b41\nalign 8                                                                ; +0x247, 0x180001b47\nmov     rcx, rsi; Block                                                ; +0x248, 0x180001b48\ncall    j_j_free                                                       ; +0x24b, 0x180001b4b\nmovzx   eax, bl                                                        ; +0x250, 0x180001b50\njmp     loc_180001A43                                                  ; +0x253, 0x180001b53", "xrefs": ["<???> @ 0x180023538", "<???> @ 0x18002fdf8", "<???> @ 0x180049090"], "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"}