{"type": "func", "start": 6442458256, "end": 6442458807, "name": "cocos2d::extension::AssetsManager::update", "pseudocode": "// \n// cocos2d::extension::AssetsManager::update from 0x180001c90 to 0x180001eb7 (551 bytes)\n// \n// 5 xrefs:\n// > <???> @ 0x180023540\n// > <???> @ 0x18002cf18\n// > <???> @ 0x18002cf70\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x1800490c0\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\nvoid __fastcall cocos2d::extension::AssetsManager::update(cocos2d::extension::AssetsManager *this)\n{\n  char *v2; // rbx\n  unsigned __int64 v3; // rcx\n  char *v4; // rdi\n  char *v5; // r9\n  __int64 v6; // rcx\n  unsigned __int8 v7; // al\n  int v8; // eax\n  __int64 v9; // rax\n  void **v10; // rbx\n  __int64 StringForKey; // rdi\n  unsigned __int64 v12; // rdx\n  _QWORD *v13; // rcx\n  _BYTE *v14; // rcx\n  _OWORD *v15; // rax\n  void *Block; // [rsp+20h] [rbp-38h] BYREF\n  unsigned __int64 v17; // [rsp+38h] [rbp-20h]\n\n  if ( !*((_QWORD *)this + 23) && *((_QWORD *)this + 15) && *((_QWORD *)this + 11) )\n  {\n    v2 = (char *)this + 72;\n    if ( *((_QWORD *)this + 12) > 0xFu )\n      v2 = *((char **)this + 9);\n    v3 = *((_QWORD *)this + 11);\n    if ( v3 >= 4 )\n    {\n      v4 = &v2[v3];\n      v5 = (char *)memchr(v2, 46, v3 - 3);\n      if ( v5 )\n      {\n        while ( 1 )\n        {\n          v6 = 0;\n          while ( 1 )\n          {\n            v7 = v5[v6++];\n            if ( v7 != aZip[v6 - 1] )\n              break;\n            if ( v6 == 4 )\n            {\n              v8 = 0;\n              goto LABEL_13;\n            }\n          }\n          v8 = v7 < (unsigned __int8)aZip[v6 - 1] ? -1 : 1;\nLABEL_13:\n          if ( !v8 )\n            break;\n          v5 = (char *)memchr(v5 + 1, 46, v4 - 3 - (v5 + 1));\n          if ( !v5 )\n            return;\n        }\n        if ( v5 - v2 != -1\n          && (*(unsigned __int8 (__fastcall **)(cocos2d::extension::AssetsManager *))(*(_QWORD *)this + 8LL))(this) )\n        {\n          v9 = cocos2d::CCUserDefault::sharedUserDefault();\n          v10 = (void **)((char *)this + 136);\n          StringForKey = cocos2d::CCUserDefault::getStringForKey(v9, &Block, \"downloaded-version-code\");\n          if ( (cocos2d::extension::AssetsManager *)((char *)this + 136) != (cocos2d::extension::AssetsManager *)StringForKey )\n          {\n            v12 = *((_QWORD *)this + 20);\n            if ( v12 > 0xF )\n            {\n              v13 = *v10;\n              if ( v12 + 1 >= 0x1000 )\n              {\n                if ( (unsigned __int64)v13 - *(v13 - 1) - 8 > 0x1F )\n                  goto LABEL_28;\n                v13 = (_QWORD *)*(v13 - 1);\n              }\n              j_j_free(v13);\n            }\n            *((_QWORD *)this + 19) = 0;\n            *((_QWORD *)this + 20) = 15;\n            *(_BYTE *)v10 = 0;\n            *(_OWORD *)v10 = *(_OWORD *)StringForKey;\n            *(_OWORD *)((char *)this + 152) = *(_OWORD *)(StringForKey + 16);\n            *(_QWORD *)(StringForKey + 16) = 0;\n            *(_QWORD *)(StringForKey + 24) = 15;\n            *(_BYTE *)StringForKey = 0;\n          }\n          if ( v17 > 0xF )\n          {\n            v14 = Block;\n            if ( v17 + 1 >= 0x1000 )\n            {\n              v14 = *((_BYTE **)Block - 1);\n              if ( (unsigned __int64)((_BYTE *)Block - v14 - 8) > 0x1F )\nLABEL_28:\n                invalid_parameter_noinfo_noreturn();\n            }\n            j_j_free(v14);\n          }\n          v15 = operator new(0x10u);\n          *v15 = 0;\n          *((_QWORD *)this + 23) = v15;\n          pthread_create(v15, 0, sub_180001B60, this);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::extension::AssetsManager::update from 0x180001c90 to 0x180001eb7 (551 bytes)\n; \n; 5 xrefs:\n; > <???> @ 0x180023540\n; > <???> @ 0x18002cf18\n; > <???> @ 0x18002cf70\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x1800490c0\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    rsi                                                            ; +0x0, 0x180001c90\nsub     rsp, 50h                                                       ; +0x2, 0x180001c92\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x180001c96\nxor     rax, rsp                                                       ; +0xd, 0x180001c9d\nmov     [rsp+58h+var_18], rax                                          ; +0x10, 0x180001ca0\ncmp     qword ptr [rcx+0B8h], 0                                        ; +0x15, 0x180001ca5\nmov     rsi, rcx                                                       ; +0x1d, 0x180001cad\njnz     loc_180001EA4                                                  ; +0x20, 0x180001cb0\ncmp     qword ptr [rcx+78h], 0                                         ; +0x26, 0x180001cb6\njz      loc_180001EA4                                                  ; +0x2b, 0x180001cbb\ncmp     qword ptr [rcx+58h], 0                                         ; +0x31, 0x180001cc1\njz      loc_180001EA4                                                  ; +0x36, 0x180001cc6\ncmp     qword ptr [rcx+60h], 0Fh                                       ; +0x3c, 0x180001ccc\nmov     [rsp+58h+arg_8], rbx                                           ; +0x41, 0x180001cd1\nlea     rbx, [rcx+48h]                                                 ; +0x46, 0x180001cd6\njbe     short loc_180001CE0                                            ; +0x4a, 0x180001cda\nmov     rbx, [rcx+48h]                                                 ; +0x4c, 0x180001cdc\nmov     rcx, [rcx+58h]                                                 ; +0x50, 0x180001ce0\ncmp     rcx, 4                                                         ; +0x54, 0x180001ce4\njb      loc_180001E9F                                                  ; +0x58, 0x180001ce8\nmov     [rsp+58h+arg_18], rdi                                          ; +0x5e, 0x180001cee\nmov     edx, 2Eh ; '.'; Val                                            ; +0x63, 0x180001cf3\nlea     rdi, [rcx+rbx]                                                 ; +0x68, 0x180001cf8\nmov     rcx, rbx; Buf                                                  ; +0x6c, 0x180001cfc\nlea     r8, [rdi-3]                                                    ; +0x6f, 0x180001cff\nsub     r8, rbx; MaxCount                                              ; +0x73, 0x180001d03\ncall    memchr                                                         ; +0x76, 0x180001d06\nmov     r9, rax                                                        ; +0x7b, 0x180001d0b\ntest    rax, rax                                                       ; +0x7e, 0x180001d0e\njz      loc_180001E9A                                                  ; +0x81, 0x180001d11\nmov     [rsp+58h+arg_10], rbp                                          ; +0x87, 0x180001d17\nlea     rbp, aZip; \".zip\"                                              ; +0x8c, 0x180001d1c\nnop     dword ptr [rax+00h]                                            ; +0x93, 0x180001d23\nnop     word ptr [rax+rax+00000000h]                                   ; +0x97, 0x180001d27\nxor     ecx, ecx                                                       ; +0xa0, 0x180001d30\nmovzx   eax, byte ptr [r9+rcx]                                         ; +0xa2, 0x180001d32\ninc     rcx                                                            ; +0xa7, 0x180001d37\ncmp     al, [rcx+rbp-1]                                                ; +0xaa, 0x180001d3a\njnz     short loc_180001D4A                                            ; +0xae, 0x180001d3e\ncmp     rcx, 4                                                         ; +0xb0, 0x180001d40\njnz     short loc_180001D32                                            ; +0xb4, 0x180001d44\nxor     eax, eax                                                       ; +0xb6, 0x180001d46\njmp     short loc_180001D4F                                            ; +0xb8, 0x180001d48\nsbb     eax, eax                                                       ; +0xba, 0x180001d4a\nor      eax, 1                                                         ; +0xbc, 0x180001d4c\ntest    eax, eax                                                       ; +0xbf, 0x180001d4f\njz      short loc_180001D77                                            ; +0xc1, 0x180001d51\ninc     r9                                                             ; +0xc3, 0x180001d53\nlea     r8, [rdi-3]                                                    ; +0xc6, 0x180001d56\nsub     r8, r9; MaxCount                                               ; +0xca, 0x180001d5a\nmov     rcx, r9; Buf                                                   ; +0xcd, 0x180001d5d\nmov     edx, 2Eh ; '.'; Val                                            ; +0xd0, 0x180001d60\ncall    memchr                                                         ; +0xd5, 0x180001d65\nmov     r9, rax                                                        ; +0xda, 0x180001d6a\ntest    rax, rax                                                       ; +0xdd, 0x180001d6d\njnz     short loc_180001D30                                            ; +0xe0, 0x180001d70\njmp     loc_180001E95                                                  ; +0xe2, 0x180001d72\nsub     r9, rbx                                                        ; +0xe7, 0x180001d77\ncmp     r9, 0FFFFFFFFFFFFFFFFh                                         ; +0xea, 0x180001d7a\njz      loc_180001E95                                                  ; +0xee, 0x180001d7e\nmov     rax, [rsi]                                                     ; +0xf4, 0x180001d84\nmov     rcx, rsi                                                       ; +0xf7, 0x180001d87\ncall    qword ptr [rax+8]                                              ; +0xfa, 0x180001d8a\ntest    al, al                                                         ; +0xfd, 0x180001d8d\njz      loc_180001E95                                                  ; +0xff, 0x180001d8f\ncall    cs:?sharedUserDefault@CCUserDefault@cocos2d@@SAPEAV12@XZ; cocos2d::CCUserDefault::sharedUserDefault(void) ; +0x105, 0x180001d95\nmov     rcx, rax                                                       ; +0x10b, 0x180001d9b\nlea     r8, aDownloadedVers; \"downloaded-version-code\"                 ; +0x10e, 0x180001d9e\nlea     rdx, [rsp+58h+Block]                                           ; +0x115, 0x180001da5\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 *) ; +0x11a, 0x180001daa\nlea     rbx, [rsi+88h]                                                 ; +0x120, 0x180001db0\nmov     rdi, rax                                                       ; +0x127, 0x180001db7\ncmp     rbx, rax                                                       ; +0x12a, 0x180001dba\njz      short loc_180001E29                                            ; +0x12d, 0x180001dbd\nmov     rdx, [rbx+18h]                                                 ; +0x12f, 0x180001dbf\ncmp     rdx, 0Fh                                                       ; +0x133, 0x180001dc3\njbe     short loc_180001DF5                                            ; +0x137, 0x180001dc7\nmov     rcx, [rbx]                                                     ; +0x139, 0x180001dc9\ninc     rdx                                                            ; +0x13c, 0x180001dcc\ncmp     rdx, 1000h                                                     ; +0x13f, 0x180001dcf\njb      short loc_180001DF0                                            ; +0x146, 0x180001dd6\nmov     r8, [rcx-8]                                                    ; +0x148, 0x180001dd8\nadd     rdx, 27h ; '''                                                 ; +0x14c, 0x180001ddc\nsub     rcx, r8                                                        ; +0x150, 0x180001de0\nlea     rax, [rcx-8]                                                   ; +0x153, 0x180001de3\ncmp     rax, 1Fh                                                       ; +0x157, 0x180001de7\nja      short loc_180001E5D                                            ; +0x15b, 0x180001deb\nmov     rcx, r8; Block                                                 ; +0x15d, 0x180001ded\ncall    j_j_free                                                       ; +0x160, 0x180001df0\nmov     qword ptr [rbx+10h], 0                                         ; +0x165, 0x180001df5\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0x16d, 0x180001dfd\nmov     byte ptr [rbx], 0                                              ; +0x175, 0x180001e05\nmovups  xmm0, xmmword ptr [rdi]                                        ; +0x178, 0x180001e08\nmovups  xmmword ptr [rbx], xmm0                                        ; +0x17b, 0x180001e0b\nmovups  xmm1, xmmword ptr [rdi+10h]                                    ; +0x17e, 0x180001e0e\nmovups  xmmword ptr [rbx+10h], xmm1                                    ; +0x182, 0x180001e12\nmov     qword ptr [rdi+10h], 0                                         ; +0x186, 0x180001e16\nmov     qword ptr [rdi+18h], 0Fh                                       ; +0x18e, 0x180001e1e\nmov     byte ptr [rdi], 0                                              ; +0x196, 0x180001e26\nmov     rdx, [rsp+58h+var_20]                                          ; +0x199, 0x180001e29\ncmp     rdx, 0Fh                                                       ; +0x19e, 0x180001e2e\njbe     short loc_180001E69                                            ; +0x1a2, 0x180001e32\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0x1a4, 0x180001e34\ninc     rdx                                                            ; +0x1a9, 0x180001e39\nmov     rax, rcx                                                       ; +0x1ac, 0x180001e3c\ncmp     rdx, 1000h                                                     ; +0x1af, 0x180001e3f\njb      short loc_180001E64                                            ; +0x1b6, 0x180001e46\nmov     rcx, [rcx-8]                                                   ; +0x1b8, 0x180001e48\nadd     rdx, 27h ; '''                                                 ; +0x1bc, 0x180001e4c\nsub     rax, rcx                                                       ; +0x1c0, 0x180001e50\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x1c3, 0x180001e53\ncmp     rax, 1Fh                                                       ; +0x1c7, 0x180001e57\njbe     short loc_180001E64                                            ; +0x1cb, 0x180001e5b\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x1cd, 0x180001e5d\nalign 4                                                                ; +0x1d3, 0x180001e63\ncall    j_j_free                                                       ; +0x1d4, 0x180001e64\nmov     ecx, 10h; Size                                                 ; +0x1d9, 0x180001e69\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1de, 0x180001e6e\nxorps   xmm0, xmm0                                                     ; +0x1e3, 0x180001e73\nlea     r8, sub_180001B60                                              ; +0x1e6, 0x180001e76\nmov     r9, rsi                                                        ; +0x1ed, 0x180001e7d\nxor     edx, edx                                                       ; +0x1f0, 0x180001e80\nmov     rcx, rax                                                       ; +0x1f2, 0x180001e82\nmovups  xmmword ptr [rax], xmm0                                        ; +0x1f5, 0x180001e85\nmov     [rsi+0B8h], rax                                                ; +0x1f8, 0x180001e88\ncall    cs:pthread_create                                              ; +0x1ff, 0x180001e8f\nmov     rbp, [rsp+58h+arg_10]                                          ; +0x205, 0x180001e95\nmov     rdi, [rsp+58h+arg_18]                                          ; +0x20a, 0x180001e9a\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x20f, 0x180001e9f\nmov     rcx, [rsp+58h+var_18]                                          ; +0x214, 0x180001ea4\nxor     rcx, rsp; StackCookie                                          ; +0x219, 0x180001ea9\ncall    __security_check_cookie                                        ; +0x21c, 0x180001eac\nadd     rsp, 50h                                                       ; +0x221, 0x180001eb1\npop     rsi                                                            ; +0x225, 0x180001eb5\nretn                                                                   ; +0x226, 0x180001eb6", "xrefs": ["<???> @ 0x180023540", "<???> @ 0x18002cf18", "<???> @ 0x18002cf70", "<???> @ 0x18002fdf8", "<???> @ 0x1800490c0"], "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"}