{"type": "func", "start": 6442775312, "end": 6442775449, "name": "sub_18004F310", "pseudocode": "// \n// sub_18004F310 from 0x18004f310 to 0x18004f399 (137 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x1800ece90\n// > <???> @ 0x180107780\n// > <???> @ 0x1801077e0\n// > <???> @ 0x1801b1d88\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_QWORD *__fastcall sub_18004F310(_QWORD *a1, char a2)\n{\n  int v3; // edi\n\n  v3 = a2 & 1;\n  if ( (a2 & 2) != 0 )\n  {\n    `eh vector destructor iterator'(a1, 8u, *(a1 - 1), (void (*)(void *))cocos2d::CCTouchDelegate::~CCTouchDelegate);\n    if ( v3 )\n      j_j_j_free_0(a1 - 1);\n    return a1 - 1;\n  }\n  else\n  {\n    *a1 = &cocos2d::CCTouchDelegate::`vftable';\n    if ( (a2 & 1) != 0 )\n      j_j_free_0(a1);\n    return a1;\n  }\n}", "assembly": "; \n; sub_18004F310 from 0x18004f310 to 0x18004f399 (137 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x1800ece90\n; > <???> @ 0x180107780\n; > <???> @ 0x1801077e0\n; > <???> @ 0x1801b1d88\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, 0x18004f310\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x18004f315\npush    rdi                                                            ; +0xa, 0x18004f31a\nsub     rsp, 20h                                                       ; +0xb, 0x18004f31b\nmov     rbx, rcx                                                       ; +0xf, 0x18004f31f\nmov     edi, edx                                                       ; +0x12, 0x18004f322\nand     edi, 1                                                         ; +0x14, 0x18004f324\ntest    dl, 2                                                          ; +0x17, 0x18004f327\njz      short loc_18004F36E                                            ; +0x1a, 0x18004f32a\nlea     r9, ??1CCTouchDelegate@cocos2d@@UEAA@XZ; void (*)(void *)      ; +0x1c, 0x18004f32c\nmov     r8, [rcx-8]; unsigned __int64                                  ; +0x23, 0x18004f333\nmov     edx, 8; unsigned __int64                                       ; +0x27, 0x18004f337\ncall    ??_M@YAXPEAX_K1P6AX0@Z@Z; `eh vector destructor iterator'(void *,unsigned __int64,unsigned __int64,void (*)(void *)) ; +0x2c, 0x18004f33c\ntest    edi, edi                                                       ; +0x31, 0x18004f341\njz      short loc_18004F35A                                            ; +0x33, 0x18004f343\nmov     rdx, [rbx-8]                                                   ; +0x35, 0x18004f345\nlea     rdx, ds:8[rdx*8]                                               ; +0x39, 0x18004f349\nlea     rcx, [rbx-8]; Block                                            ; +0x41, 0x18004f351\ncall    j_j_j_free_0                                                   ; +0x45, 0x18004f355\nlea     rax, [rbx-8]                                                   ; +0x4a, 0x18004f35a\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x4e, 0x18004f35e\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x53, 0x18004f363\nadd     rsp, 20h                                                       ; +0x58, 0x18004f368\npop     rdi                                                            ; +0x5c, 0x18004f36c\nretn                                                                   ; +0x5d, 0x18004f36d\nlea     rax, ??_7CCTouchDelegate@cocos2d@@6B@; const cocos2d::CCTouchDelegate::`vftable' ; +0x5e, 0x18004f36e\nmov     [rcx], rax                                                     ; +0x65, 0x18004f375\ntest    edi, edi                                                       ; +0x68, 0x18004f378\njz      short loc_18004F386                                            ; +0x6a, 0x18004f37a\nmov     edx, 8                                                         ; +0x6c, 0x18004f37c\ncall    j_j_free_0                                                     ; +0x71, 0x18004f381\nmov     rax, rbx                                                       ; +0x76, 0x18004f386\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x79, 0x18004f389\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x7e, 0x18004f38e\nadd     rsp, 20h                                                       ; +0x83, 0x18004f393\npop     rdi                                                            ; +0x87, 0x18004f397\nretn                                                                   ; +0x88, 0x18004f398", "xrefs": ["<???> @ 0x1800ece90", "<???> @ 0x180107780", "<???> @ 0x1801077e0", "<???> @ 0x1801b1d88"], "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"}