{"type": "func", "start": 6443095360, "end": 6443095518, "name": "sub_18009D540", "pseudocode": "// \n// sub_18009D540 from 0x18009d540 to 0x18009d5de (158 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCArray::addObjectsFromArray @ 0x1800068a8\n// > cocos2d::CCArray::initWithArray @ 0x180006f6d\n// > <???> @ 0x1801b73c8\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 sub_18009D540(unsigned int *a1, int *a2)\n{\n  int v2; // edi\n  unsigned int i; // edx\n  void *v6; // rcx\n  __int64 j; // rsi\n  cocos2d::CCObject *v8; // rdi\n\n  v2 = *a2;\n  for ( i = a1[1]; i < v2 + *a1; i = a1[1] )\n  {\n    v6 = *((void **)a1 + 2);\n    a1[1] = 2 * i;\n    *((_QWORD *)a1 + 2) = realloc(v6, 16LL * i);\n  }\n  for ( j = 0; (unsigned int)j < *a2; ++*a1 )\n  {\n    v8 = *(cocos2d::CCObject **)(*((_QWORD *)a2 + 2) + 8 * j);\n    cocos2d::CCObject::retain(v8);\n    j = (unsigned int)(j + 1);\n    *(_QWORD *)(*((_QWORD *)a1 + 2) + 8LL * *a1) = v8;\n  }\n}", "assembly": "; \n; sub_18009D540 from 0x18009d540 to 0x18009d5de (158 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCArray::addObjectsFromArray @ 0x1800068a8\n; > cocos2d::CCArray::initWithArray @ 0x180006f6d\n; > <???> @ 0x1801b73c8\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_0], rbx                                               ; +0x0, 0x18009d540\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x18009d545\nmov     [rsp+arg_10], rdi                                              ; +0xa, 0x18009d54a\nmov     [rsp+arg_18], r14                                              ; +0xf, 0x18009d54f\npush    r15                                                            ; +0x14, 0x18009d554\nsub     rsp, 20h                                                       ; +0x16, 0x18009d556\nmov     edi, [rdx]                                                     ; +0x1a, 0x18009d55a\nmov     rbx, rcx                                                       ; +0x1c, 0x18009d55c\nmov     r15, rdx                                                       ; +0x1f, 0x18009d55f\nmov     edx, [rcx+4]                                                   ; +0x22, 0x18009d562\nmov     ecx, [rcx]                                                     ; +0x25, 0x18009d565\nadd     ecx, edi                                                       ; +0x27, 0x18009d567\ncmp     edx, ecx                                                       ; +0x29, 0x18009d569\njnb     short loc_18009D595                                            ; +0x2b, 0x18009d56b\nnop     dword ptr [rax]                                                ; +0x2d, 0x18009d56d\nmov     rcx, [rbx+10h]; Block                                          ; +0x30, 0x18009d570\nlea     eax, [rdx+rdx]                                                 ; +0x34, 0x18009d574\nmov     edx, eax                                                       ; +0x37, 0x18009d577\nshl     rdx, 3; Size                                                   ; +0x39, 0x18009d579\nmov     [rbx+4], eax                                                   ; +0x3d, 0x18009d57d\ncall    cs:realloc                                                     ; +0x40, 0x18009d580\nmov     [rbx+10h], rax                                                 ; +0x46, 0x18009d586\nmov     ecx, [rbx]                                                     ; +0x4a, 0x18009d58a\nmov     edx, [rbx+4]                                                   ; +0x4c, 0x18009d58c\nadd     ecx, edi                                                       ; +0x4f, 0x18009d58f\ncmp     edx, ecx                                                       ; +0x51, 0x18009d591\njb      short loc_18009D570                                            ; +0x53, 0x18009d593\nxor     esi, esi                                                       ; +0x55, 0x18009d595\ncmp     [r15], esi                                                     ; +0x57, 0x18009d597\njbe     short loc_18009D5C3                                            ; +0x5a, 0x18009d59a\nnop     dword ptr [rax+00h]                                            ; +0x5c, 0x18009d59c\nmov     rax, [r15+10h]                                                 ; +0x60, 0x18009d5a0\nmov     rdi, [rax+rsi*8]                                               ; +0x64, 0x18009d5a4\nmov     rcx, rdi; this                                                 ; +0x68, 0x18009d5a8\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x6b, 0x18009d5ab\nmov     ecx, [rbx]                                                     ; +0x70, 0x18009d5b0\ninc     esi                                                            ; +0x72, 0x18009d5b2\nmov     rax, [rbx+10h]                                                 ; +0x74, 0x18009d5b4\nmov     [rax+rcx*8], rdi                                               ; +0x78, 0x18009d5b8\ninc     dword ptr [rbx]                                                ; +0x7c, 0x18009d5bc\ncmp     esi, [r15]                                                     ; +0x7e, 0x18009d5be\njb      short loc_18009D5A0                                            ; +0x81, 0x18009d5c1\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x83, 0x18009d5c3\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x88, 0x18009d5c8\nmov     rdi, [rsp+28h+arg_10]                                          ; +0x8d, 0x18009d5cd\nmov     r14, [rsp+28h+arg_18]                                          ; +0x92, 0x18009d5d2\nadd     rsp, 20h                                                       ; +0x97, 0x18009d5d7\npop     r15                                                            ; +0x9b, 0x18009d5db\nretn                                                                   ; +0x9d, 0x18009d5dd", "xrefs": ["cocos2d::CCArray::addObjectsFromArray @ 0x1800068a8", "cocos2d::CCArray::initWithArray @ 0x180006f6d", "<???> @ 0x1801b73c8"], "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"}