{"type": "func", "start": 6443096816, "end": 6443097005, "name": "sub_18009DAF0", "pseudocode": "// \n// sub_18009DAF0 from 0x18009daf0 to 0x18009dbad (189 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCArray::insertObject @ 0x180007094\n// > cocos2d::CCArray::replaceObjectAtIndex @ 0x18000726c\n// > <???> @ 0x1801b747c\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_18009DAF0(int *a1, cocos2d::CCObject *a2, unsigned int a3)\n{\n  int v3; // r9d\n  unsigned int v5; // r11d\n  __int64 v7; // rbp\n  void *v8; // rcx\n  char *v9; // rax\n  char *v10; // r10\n  unsigned int v11; // r9d\n  __int64 result; // rax\n\n  v3 = *a1;\n  v5 = a1[1];\n  v7 = a3;\n  if ( v5 >= *a1 + 1 )\n  {\n    v10 = *((char **)a1 + 2);\n  }\n  else\n  {\n    do\n    {\n      v8 = *((void **)a1 + 2);\n      a1[1] = 2 * v5;\n      v9 = (char *)realloc(v8, 16LL * v5);\n      *((_QWORD *)a1 + 2) = v9;\n      v10 = v9;\n      v3 = *a1;\n      v5 = a1[1];\n    }\n    while ( v5 < *a1 + 1 );\n  }\n  v11 = v3 - v7;\n  if ( v11 )\n    memmove(&v10[8 * (unsigned int)(v7 + 1)], &v10[8 * v7], 8LL * v11);\n  cocos2d::CCObject::retain(a2);\n  result = *((_QWORD *)a1 + 2);\n  *(_QWORD *)(result + 8 * v7) = a2;\n  ++*a1;\n  return result;\n}", "assembly": "; \n; sub_18009DAF0 from 0x18009daf0 to 0x18009dbad (189 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCArray::insertObject @ 0x180007094\n; > cocos2d::CCArray::replaceObjectAtIndex @ 0x18000726c\n; > <???> @ 0x1801b747c\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, 0x18009daf0\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x18009daf5\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x18009dafa\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x18009daff\npush    r14                                                            ; +0x14, 0x18009db04\nsub     rsp, 20h                                                       ; +0x16, 0x18009db06\nmov     r9d, [rcx]                                                     ; +0x1a, 0x18009db0a\nmov     r14, rdx                                                       ; +0x1d, 0x18009db0d\nmov     r11d, [rcx+4]                                                  ; +0x20, 0x18009db10\nmov     rbx, rcx                                                       ; +0x24, 0x18009db14\nmov     ebp, r8d                                                       ; +0x27, 0x18009db17\nlea     eax, [r9+1]                                                    ; +0x2a, 0x18009db1a\ncmp     r11d, eax                                                      ; +0x2e, 0x18009db1e\njnb     short loc_18009DB60                                            ; +0x31, 0x18009db21\nnop     dword ptr [rax+00h]                                            ; +0x33, 0x18009db23\nnop     word ptr [rax+rax+00000000h]                                   ; +0x37, 0x18009db27\nmov     rcx, [rbx+10h]; Block                                          ; +0x40, 0x18009db30\nlea     eax, [r11+r11]                                                 ; +0x44, 0x18009db34\nmov     edx, eax                                                       ; +0x48, 0x18009db38\nshl     rdx, 3; Size                                                   ; +0x4a, 0x18009db3a\nmov     [rbx+4], eax                                                   ; +0x4e, 0x18009db3e\ncall    cs:realloc                                                     ; +0x51, 0x18009db41\nmov     [rbx+10h], rax                                                 ; +0x57, 0x18009db47\nmov     r10, rax                                                       ; +0x5b, 0x18009db4b\nmov     r9d, [rbx]                                                     ; +0x5e, 0x18009db4e\nmov     r11d, [rbx+4]                                                  ; +0x61, 0x18009db51\nlea     ecx, [r9+1]                                                    ; +0x65, 0x18009db55\ncmp     r11d, ecx                                                      ; +0x69, 0x18009db59\njb      short loc_18009DB30                                            ; +0x6c, 0x18009db5c\njmp     short loc_18009DB64                                            ; +0x6e, 0x18009db5e\nmov     r10, [rcx+10h]                                                 ; +0x70, 0x18009db60\nsub     r9d, ebp                                                       ; +0x74, 0x18009db64\njz      short loc_18009DB80                                            ; +0x77, 0x18009db67\nmov     r8d, r9d                                                       ; +0x79, 0x18009db69\nlea     eax, [rbp+1]                                                   ; +0x7c, 0x18009db6c\nshl     r8, 3; Size                                                    ; +0x7f, 0x18009db6f\nlea     rcx, [r10+rax*8]; void *                                       ; +0x83, 0x18009db73\nlea     rdx, [r10+rbp*8]; Src                                          ; +0x87, 0x18009db77\ncall    memmove                                                        ; +0x8b, 0x18009db7b\nmov     rcx, r14; this                                                 ; +0x90, 0x18009db80\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x93, 0x18009db83\nmov     rax, [rbx+10h]                                                 ; +0x98, 0x18009db88\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x9c, 0x18009db8c\nmov     rdi, [rsp+28h+arg_18]                                          ; +0xa1, 0x18009db91\nmov     [rax+rbp*8], r14                                               ; +0xa6, 0x18009db96\ninc     dword ptr [rbx]                                                ; +0xaa, 0x18009db9a\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xac, 0x18009db9c\nmov     rbp, [rsp+28h+arg_8]                                           ; +0xb1, 0x18009dba1\nadd     rsp, 20h                                                       ; +0xb6, 0x18009dba6\npop     r14                                                            ; +0xba, 0x18009dbaa\nretn                                                                   ; +0xbc, 0x18009dbac", "xrefs": ["cocos2d::CCArray::insertObject @ 0x180007094", "cocos2d::CCArray::replaceObjectAtIndex @ 0x18000726c", "<???> @ 0x1801b747c"], "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"}