{"type": "func", "start": 6442968352, "end": 6442968527, "name": "sub_18007E520", "pseudocode": "// \n// sub_18007E520 from 0x18007e520 to 0x18007e5cf (175 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x180107858\n// > <???> @ 0x1801bf004\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:22:01 +0000\n// \n\ncocos2d::CCObject *__fastcall sub_18007E520(cocos2d::CCObject *this, char a2)\n{\n  void *v5; // rcx\n\n  if ( (a2 & 2) != 0 )\n  {\n    sub_1800E49F8(this, 80, *((_QWORD *)this - 1), cocos2d::CCImage::~CCImage);\n    if ( (a2 & 1) != 0 )\n      j_j_j_free_0((char *)this - 8);\n    return (cocos2d::CCObject *)((char *)this - 8);\n  }\n  else\n  {\n    *(_QWORD *)this = &cocos2d::CCImage::`vftable';\n    v5 = *((void **)this + 8);\n    if ( v5 )\n    {\n      j_j_free_0(v5);\n      *((_QWORD *)this + 8) = 0;\n    }\n    cocos2d::CCObject::~CCObject(this);\n    if ( (a2 & 1) != 0 )\n      j_j_free_0(this);\n    return this;\n  }\n}", "assembly": "; \n; sub_18007E520 from 0x18007e520 to 0x18007e5cf (175 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x180107858\n; > <???> @ 0x1801bf004\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:22:01 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x18007e520\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x18007e525\npush    rdi                                                            ; +0xa, 0x18007e52a\nsub     rsp, 20h                                                       ; +0xb, 0x18007e52b\nmov     esi, edx                                                       ; +0xf, 0x18007e52f\nmov     rbx, rcx                                                       ; +0x11, 0x18007e531\ntest    dl, 2                                                          ; +0x14, 0x18007e534\njz      short loc_18007E581                                            ; +0x17, 0x18007e537\nlea     r9, ??1CCImage@cocos2d@@UEAA@XZ; cocos2d::CCImage::~CCImage(void) ; +0x19, 0x18007e539\nmov     r8, [rcx-8]                                                    ; +0x20, 0x18007e540\nmov     edx, 50h ; 'P'                                                 ; +0x24, 0x18007e544\ncall    sub_1800E49F8                                                  ; +0x29, 0x18007e549\ntest    sil, 1                                                         ; +0x2e, 0x18007e54e\njz      short loc_18007E56D                                            ; +0x32, 0x18007e552\nmov     rcx, [rbx-8]                                                   ; +0x34, 0x18007e554\nlea     rdx, [rcx+rcx*4]                                               ; +0x38, 0x18007e558\nshl     rdx, 4                                                         ; +0x3c, 0x18007e55c\nadd     rdx, 8                                                         ; +0x40, 0x18007e560\nlea     rcx, [rbx-8]; Block                                            ; +0x44, 0x18007e564\ncall    j_j_j_free_0                                                   ; +0x48, 0x18007e568\nlea     rax, [rbx-8]                                                   ; +0x4d, 0x18007e56d\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x51, 0x18007e571\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x56, 0x18007e576\nadd     rsp, 20h                                                       ; +0x5b, 0x18007e57b\npop     rdi                                                            ; +0x5f, 0x18007e57f\nretn                                                                   ; +0x60, 0x18007e580\nlea     rax, ??_7CCImage@cocos2d@@6B@; const cocos2d::CCImage::`vftable' ; +0x61, 0x18007e581\nmov     [rcx], rax                                                     ; +0x68, 0x18007e588\nmov     rcx, [rcx+40h]; Block                                          ; +0x6b, 0x18007e58b\ntest    rcx, rcx                                                       ; +0x6f, 0x18007e58f\njz      short loc_18007E5A1                                            ; +0x72, 0x18007e592\ncall    j_j_free_0                                                     ; +0x74, 0x18007e594\nmov     qword ptr [rbx+40h], 0                                         ; +0x79, 0x18007e599\nmov     rcx, rbx; this                                                 ; +0x81, 0x18007e5a1\ncall    ??1CCObject@cocos2d@@UEAA@XZ; cocos2d::CCObject::~CCObject(void) ; +0x84, 0x18007e5a4\ntest    sil, 1                                                         ; +0x89, 0x18007e5a9\njz      short loc_18007E5BC                                            ; +0x8d, 0x18007e5ad\nmov     edx, 50h ; 'P'                                                 ; +0x8f, 0x18007e5af\nmov     rcx, rbx; Block                                                ; +0x94, 0x18007e5b4\ncall    j_j_free_0                                                     ; +0x97, 0x18007e5b7\nmov     rax, rbx                                                       ; +0x9c, 0x18007e5bc\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x9f, 0x18007e5bf\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xa4, 0x18007e5c4\nadd     rsp, 20h                                                       ; +0xa9, 0x18007e5c9\npop     rdi                                                            ; +0xad, 0x18007e5cd\nretn                                                                   ; +0xae, 0x18007e5ce", "xrefs": ["<???> @ 0x180107858", "<???> @ 0x1801bf004"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}