{"type": "func", "start": 6443232592, "end": 6443232834, "name": "cocos2d::CCDirector::popToSceneStackLevel", "pseudocode": "// \n// cocos2d::CCDirector::popToSceneStackLevel from 0x1800bed50 to 0x1800bee42 (242 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCDirector::popToRootScene @ 0x1800becd5\n// > cocos2d::CCDirector::popToSceneInStack @ 0x1800bed42\n// > <???> @ 0x180141efc\n// > <???> @ 0x180141f0c\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b9240\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 cocos2d::CCDirector::popToSceneStackLevel(cocos2d::CCDirector *this, int a2)\n{\n  int v4; // eax\n  __int64 v5; // rsi\n  struct cocos2d::CCObject *Object; // rdi\n\n  v4 = cocos2d::CCArray::count(this->m_pobScenesStack);\n  if ( a2 )\n  {\n    if ( a2 < v4 )\n    {\n      v5 = (unsigned int)(v4 - a2);\n      do\n      {\n        Object = cocos2d::CCArray::lastObject(this->m_pobScenesStack);\n        if ( ((unsigned __int8 (__fastcall *)(struct cocos2d::CCObject *))Object->__vftable[9].~CCObject)(Object) )\n        {\n          ((void (__fastcall *)(struct cocos2d::CCObject *))Object->__vftable[9].getTag)(Object);\n          ((void (__fastcall *)(struct cocos2d::CCObject *))Object->__vftable[9].canEncode)(Object);\n        }\n        ((void (__fastcall *)(struct cocos2d::CCObject *))Object->__vftable[9].setTag)(Object);\n        if ( this->m_pSceneReference )\n        {\n          if ( this->m_pSceneReference == cocos2d::CCArray::lastObject(this->m_pobScenesStack) )\n            this->m_pSceneReference = nullptr;\n        }\n        cocos2d::CCArray::removeLastObject(this->m_pobScenesStack, 1u);\n        --v5;\n      }\n      while ( v5 );\n      this->m_pNextScene = (cocos2d::CCScene *)cocos2d::CCArray::lastObject(this->m_pobScenesStack);\n      this->m_bSendCleanupToScene = 0;\n    }\n  }\n  else\n  {\n    this->m_bPurgeDirecotorInNextLoop = 1;\n  }\n}", "assembly": "; \n; cocos2d::CCDirector::popToSceneStackLevel from 0x1800bed50 to 0x1800bee42 (242 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCDirector::popToRootScene @ 0x1800becd5\n; > cocos2d::CCDirector::popToSceneInStack @ 0x1800bed42\n; > <???> @ 0x180141efc\n; > <???> @ 0x180141f0c\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b9240\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_10], rbx                                              ; +0x0, 0x1800bed50\npush    rdi                                                            ; +0x5, 0x1800bed55\nsub     rsp, 20h                                                       ; +0x6, 0x1800bed56\nmov     rbx, rcx                                                       ; +0xa, 0x1800bed5a\nmov     edi, edx                                                       ; +0xd, 0x1800bed5d\nmov     rcx, [rcx+120h]; this                                          ; +0xf, 0x1800bed5f\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x16, 0x1800bed66\ntest    edi, edi                                                       ; +0x1b, 0x1800bed6b\njnz     short loc_1800BED81                                            ; +0x1d, 0x1800bed6d\nmov     byte ptr [rbx+0B0h], 1                                         ; +0x1f, 0x1800bed6f\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x26, 0x1800bed76\nadd     rsp, 20h                                                       ; +0x2b, 0x1800bed7b\npop     rdi                                                            ; +0x2f, 0x1800bed7f\nretn                                                                   ; +0x30, 0x1800bed80\ncmp     edi, eax                                                       ; +0x31, 0x1800bed81\njge     loc_1800BEE37                                                  ; +0x33, 0x1800bed83\nmov     [rsp+28h+arg_0], rbp                                           ; +0x39, 0x1800bed89\nsub     eax, edi                                                       ; +0x3e, 0x1800bed8e\nmov     [rsp+28h+arg_8], rsi                                           ; +0x40, 0x1800bed90\nxor     ebp, ebp                                                       ; +0x45, 0x1800bed95\nmov     esi, eax                                                       ; +0x47, 0x1800bed97\nnop     dword ptr [rax+00000000h]                                      ; +0x49, 0x1800bed99\nmov     rcx, [rbx+120h]; this                                          ; +0x50, 0x1800beda0\ncall    ?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x57, 0x1800beda7\nmov     rcx, rax                                                       ; +0x5c, 0x1800bedac\nmov     rdi, rax                                                       ; +0x5f, 0x1800bedaf\nmov     rdx, [rax]                                                     ; +0x62, 0x1800bedb2\ncall    qword ptr [rdx+290h]                                           ; +0x65, 0x1800bedb5\ntest    al, al                                                         ; +0x6b, 0x1800bedbb\njz      short loc_1800BEDD7                                            ; +0x6d, 0x1800bedbd\nmov     rdx, [rdi]                                                     ; +0x6f, 0x1800bedbf\nmov     rcx, rdi                                                       ; +0x72, 0x1800bedc2\ncall    qword ptr [rdx+2C0h]                                           ; +0x75, 0x1800bedc5\nmov     rdx, [rdi]                                                     ; +0x7b, 0x1800bedcb\nmov     rcx, rdi                                                       ; +0x7e, 0x1800bedce\ncall    qword ptr [rdx+2B8h]                                           ; +0x81, 0x1800bedd1\nmov     rax, [rdi]                                                     ; +0x87, 0x1800bedd7\nmov     rcx, rdi                                                       ; +0x8a, 0x1800bedda\ncall    qword ptr [rax+2C8h]                                           ; +0x8d, 0x1800beddd\ncmp     [rbx+60h], rbp                                                 ; +0x93, 0x1800bede3\njz      short loc_1800BEDFF                                            ; +0x97, 0x1800bede7\nmov     rcx, [rbx+120h]; this                                          ; +0x99, 0x1800bede9\ncall    ?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0xa0, 0x1800bedf0\ncmp     [rbx+60h], rax                                                 ; +0xa5, 0x1800bedf5\njnz     short loc_1800BEDFF                                            ; +0xa9, 0x1800bedf9\nmov     [rbx+60h], rbp                                                 ; +0xab, 0x1800bedfb\nmov     rcx, [rbx+120h]; this                                          ; +0xaf, 0x1800bedff\nmov     dl, 1; bool                                                    ; +0xb6, 0x1800bee06\ncall    ?removeLastObject@CCArray@cocos2d@@QEAAX_N@Z; cocos2d::CCArray::removeLastObject(bool) ; +0xb8, 0x1800bee08\nsub     rsi, 1                                                         ; +0xbd, 0x1800bee0d\njnz     short loc_1800BEDA0                                            ; +0xc1, 0x1800bee11\nmov     rcx, [rbx+120h]; this                                          ; +0xc3, 0x1800bee13\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xca, 0x1800bee1a\nmov     rbp, [rsp+28h+arg_0]                                           ; +0xcf, 0x1800bee1f\ncall    ?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0xd4, 0x1800bee24\nmov     [rbx+110h], rax                                                ; +0xd9, 0x1800bee29\nmov     byte ptr [rbx+118h], 0                                         ; +0xe0, 0x1800bee30\nmov     rbx, [rsp+28h+arg_10]                                          ; +0xe7, 0x1800bee37\nadd     rsp, 20h                                                       ; +0xec, 0x1800bee3c\npop     rdi                                                            ; +0xf0, 0x1800bee40\nretn                                                                   ; +0xf1, 0x1800bee41", "xrefs": ["cocos2d::CCDirector::popToRootScene @ 0x1800becd5", "cocos2d::CCDirector::popToSceneInStack @ 0x1800bed42", "<???> @ 0x180141efc", "<???> @ 0x180141f0c", "<???> @ 0x1801438a8", "<???> @ 0x1801b9240"], "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"}