{"type": "func", "start": 6442554768, "end": 6442554912, "name": "sub_180019590", "pseudocode": "// \n// sub_180019590 from 0x180019590 to 0x180019620 (144 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x180028fe0\n// > <???> @ 0x18004ac14\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// Hidden C++ exception states: #wind=1\nstruct cocos2d::CCObject *__fastcall sub_180019590(struct cocos2d::CCObject *Block, __int64 a2)\n{\n  char v2; // di\n  __int64 v4; // rax\n  cocos2d::CCScheduler *v5; // rax\n  void *v6; // rcx\n  void *v7; // rcx\n\n  v2 = a2;\n  *(_QWORD *)Block = &cocos2d::extension::WsThreadHelper::`vftable';\n  v4 = cocos2d::CCDirector::sharedDirector(Block, a2);\n  v5 = (cocos2d::CCScheduler *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 112LL))(v4);\n  cocos2d::CCScheduler::unscheduleAllForTarget(v5, Block);\n  pthread_mutex_destroy((char *)Block + 72);\n  pthread_mutex_destroy((char *)Block + 80);\n  v6 = *((void **)Block + 7);\n  if ( v6 )\n    sub_180019620(v6);\n  v7 = *((void **)Block + 8);\n  if ( v7 )\n    sub_180019620(v7);\n  cocos2d::CCObject::~CCObject(Block);\n  if ( (v2 & 1) != 0 )\n    j_j_free(Block);\n  return Block;\n}", "assembly": "; \n; sub_180019590 from 0x180019590 to 0x180019620 (144 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x180028fe0\n; > <???> @ 0x18004ac14\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, 0x180019590\npush    rdi                                                            ; +0x5, 0x180019595\nsub     rsp, 20h                                                       ; +0x6, 0x180019596\nmov     edi, edx                                                       ; +0xa, 0x18001959a\nmov     rbx, rcx                                                       ; +0xc, 0x18001959c\nlea     rax, ??_7WsThreadHelper@extension@cocos2d@@6B@; const cocos2d::extension::WsThreadHelper::`vftable' ; +0xf, 0x18001959f\nmov     [rcx], rax                                                     ; +0x16, 0x1800195a6\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x19, 0x1800195a9\nmov     r8, [rax]                                                      ; +0x1f, 0x1800195af\nmov     rcx, rax                                                       ; +0x22, 0x1800195b2\ncall    qword ptr [r8+70h]                                             ; +0x25, 0x1800195b5\nmov     rcx, rax                                                       ; +0x29, 0x1800195b9\nmov     rdx, rbx                                                       ; +0x2c, 0x1800195bc\ncall    cs:?unscheduleAllForTarget@CCScheduler@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCScheduler::unscheduleAllForTarget(cocos2d::CCObject *) ; +0x2f, 0x1800195bf\nlea     rcx, [rbx+48h]                                                 ; +0x35, 0x1800195c5\ncall    cs:pthread_mutex_destroy                                       ; +0x39, 0x1800195c9\nlea     rcx, [rbx+50h]                                                 ; +0x3f, 0x1800195cf\ncall    cs:pthread_mutex_destroy                                       ; +0x43, 0x1800195d3\nmov     rcx, [rbx+38h]; Block                                          ; +0x49, 0x1800195d9\ntest    rcx, rcx                                                       ; +0x4d, 0x1800195dd\njz      short loc_1800195E7                                            ; +0x50, 0x1800195e0\ncall    sub_180019620                                                  ; +0x52, 0x1800195e2\nmov     rcx, [rbx+40h]; Block                                          ; +0x57, 0x1800195e7\ntest    rcx, rcx                                                       ; +0x5b, 0x1800195eb\njz      short loc_1800195F5                                            ; +0x5e, 0x1800195ee\ncall    sub_180019620                                                  ; +0x60, 0x1800195f0\nmov     rcx, rbx                                                       ; +0x65, 0x1800195f5\ncall    cs:__imp_??1CCObject@cocos2d@@UEAA@XZ; cocos2d::CCObject::~CCObject(void) ; +0x68, 0x1800195f8\nnop                                                                    ; +0x6e, 0x1800195fe\ntest    dil, 1                                                         ; +0x6f, 0x1800195ff\njz      short loc_180019612                                            ; +0x73, 0x180019603\nmov     edx, 78h ; 'x'                                                 ; +0x75, 0x180019605\nmov     rcx, rbx; Block                                                ; +0x7a, 0x18001960a\ncall    j_j_free                                                       ; +0x7d, 0x18001960d\nmov     rax, rbx                                                       ; +0x82, 0x180019612\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x85, 0x180019615\nadd     rsp, 20h                                                       ; +0x8a, 0x18001961a\npop     rdi                                                            ; +0x8e, 0x18001961e\nretn                                                                   ; +0x8f, 0x18001961f", "xrefs": ["<???> @ 0x180028fe0", "<???> @ 0x18004ac14"], "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"}