{"type": "func", "start": 6443233584, "end": 6443233848, "name": "cocos2d::CCDirector::replaceScene", "pseudocode": "// \n// cocos2d::CCDirector::replaceScene from 0x1800bf130 to 0x1800bf238 (264 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCTransitionScene::setNewScene @ 0x1800569af\n// > <???> @ 0x180141f34\n// > <???> @ 0x180141f44\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b9288\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\nchar __fastcall cocos2d::CCDirector::replaceScene(cocos2d::CCDirector *this, struct cocos2d::CCScene *a2)\n{\n  __int64 v4; // rax\n  __int64 v5; // rsi\n  bool v6; // bp\n  int v8; // eax\n  bool v9; // zf\n  int v10; // r14d\n  cocos2d::CCSceneDelegate *m_pAppDelegate; // rcx\n  cocos2d::CCSceneDelegate *m_pDelegate; // rcx\n\n  v4 = _RTDynamicCast(\n         a2,\n         0,\n         &cocos2d::CCScene `RTTI Type Descriptor',\n         &cocos2d::CCTransitionScene `RTTI Type Descriptor',\n         0);\n  v5 = v4;\n  v6 = v4 != 0;\n  if ( this->m_bIsTransitioning && v4 )\n    return 0;\n  v8 = cocos2d::CCArray::count(this->m_pobScenesStack);\n  v9 = this->m_pSceneReference == nullptr;\n  v10 = v8;\n  this->m_bSendCleanupToScene = 1;\n  if ( !v9 && this->m_pSceneReference == cocos2d::CCArray::lastObject(this->m_pobScenesStack) )\n    this->m_pSceneReference = nullptr;\n  cocos2d::CCArray::replaceObjectAtIndex(this->m_pobScenesStack, v10 - 1, a2);\n  this->m_pNextScene = a2;\n  if ( !v5 && !this->m_bDontCallWillSwitch )\n  {\n    m_pAppDelegate = this->m_pAppDelegate;\n    if ( m_pAppDelegate )\n      ((void (__fastcall *)(cocos2d::CCSceneDelegate *, struct cocos2d::CCScene *))m_pAppDelegate->willSwitchToScene)(\n        m_pAppDelegate,\n        a2);\n    m_pDelegate = a2->m_pDelegate;\n    if ( m_pDelegate )\n      ((void (__fastcall *)(cocos2d::CCSceneDelegate *))m_pDelegate->willSwitchToScene)(m_pDelegate);\n  }\n  this->m_bIsTransitioning = v6;\n  return 1;\n}", "assembly": "; \n; cocos2d::CCDirector::replaceScene from 0x1800bf130 to 0x1800bf238 (264 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCTransitionScene::setNewScene @ 0x1800569af\n; > <???> @ 0x180141f34\n; > <???> @ 0x180141f44\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b9288\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_8], rbx                                               ; +0x0, 0x1800bf130\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1800bf135\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1800bf13a\npush    rdi                                                            ; +0xf, 0x1800bf13f\nsub     rsp, 30h                                                       ; +0x10, 0x1800bf140\nmov     rdi, rdx                                                       ; +0x14, 0x1800bf144\nmov     [rsp+38h+var_18], 0                                            ; +0x17, 0x1800bf147\nmov     rbx, rcx                                                       ; +0x1f, 0x1800bf14f\nlea     r9, ??_R0?AVCCTransitionScene@cocos2d@@@8; cocos2d::CCTransitionScene `RTTI Type Descriptor' ; +0x22, 0x1800bf152\nmov     rcx, rdi                                                       ; +0x29, 0x1800bf159\nlea     r8, ??_R0?AVCCScene@cocos2d@@@8; cocos2d::CCScene `RTTI Type Descriptor' ; +0x2c, 0x1800bf15c\nxor     edx, edx                                                       ; +0x33, 0x1800bf163\ncall    __RTDynamicCast                                                ; +0x35, 0x1800bf165\ntest    rax, rax                                                       ; +0x3a, 0x1800bf16a\nmov     rsi, rax                                                       ; +0x3d, 0x1800bf16d\nsetnz   bpl                                                            ; +0x40, 0x1800bf170\ncmp     byte ptr [rbx+0A8h], 0                                         ; +0x44, 0x1800bf174\njz      short loc_1800BF189                                            ; +0x4b, 0x1800bf17b\ntest    rax, rax                                                       ; +0x4d, 0x1800bf17d\njz      short loc_1800BF189                                            ; +0x50, 0x1800bf180\nxor     al, al                                                         ; +0x52, 0x1800bf182\njmp     loc_1800BF223                                                  ; +0x54, 0x1800bf184\nmov     rcx, [rbx+120h]; this                                          ; +0x59, 0x1800bf189\nmov     [rsp+38h+arg_0], r14                                           ; +0x60, 0x1800bf190\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x65, 0x1800bf195\ncmp     qword ptr [rbx+60h], 0                                         ; +0x6a, 0x1800bf19a\nmov     r14d, eax                                                      ; +0x6f, 0x1800bf19f\nmov     byte ptr [rbx+118h], 1                                         ; +0x72, 0x1800bf1a2\njz      short loc_1800BF1C5                                            ; +0x79, 0x1800bf1a9\nmov     rcx, [rbx+120h]; this                                          ; +0x7b, 0x1800bf1ab\ncall    ?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x82, 0x1800bf1b2\ncmp     [rbx+60h], rax                                                 ; +0x87, 0x1800bf1b7\njnz     short loc_1800BF1C5                                            ; +0x8b, 0x1800bf1bb\nmov     qword ptr [rbx+60h], 0                                         ; +0x8d, 0x1800bf1bd\nmov     rcx, [rbx+120h]; this                                          ; +0x95, 0x1800bf1c5\nlea     edx, [r14-1]; unsigned int                                     ; +0x9c, 0x1800bf1cc\nmov     r9b, 1; bool                                                   ; +0xa0, 0x1800bf1d0\nmov     r8, rdi; struct cocos2d::CCObject *                            ; +0xa3, 0x1800bf1d3\ncall    ?replaceObjectAtIndex@CCArray@cocos2d@@QEAAXIPEAVCCObject@2@_N@Z; cocos2d::CCArray::replaceObjectAtIndex(uint,cocos2d::CCObject *,bool) ; +0xa6, 0x1800bf1d6\nmov     r14, [rsp+38h+arg_0]                                           ; +0xab, 0x1800bf1db\nmov     [rbx+110h], rdi                                                ; +0xb0, 0x1800bf1e0\ntest    rsi, rsi                                                       ; +0xb7, 0x1800bf1e7\njnz     short loc_1800BF21A                                            ; +0xba, 0x1800bf1ea\ncmp     [rbx+18Ch], sil                                                ; +0xbc, 0x1800bf1ec\njnz     short loc_1800BF21A                                            ; +0xc3, 0x1800bf1f3\nmov     rcx, [rbx+160h]                                                ; +0xc5, 0x1800bf1f5\ntest    rcx, rcx                                                       ; +0xcc, 0x1800bf1fc\njz      short loc_1800BF209                                            ; +0xcf, 0x1800bf1ff\nmov     rax, [rcx]                                                     ; +0xd1, 0x1800bf201\nmov     rdx, rdi                                                       ; +0xd4, 0x1800bf204\ncall    qword ptr [rax]                                                ; +0xd7, 0x1800bf207\nmov     rcx, [rdi+140h]                                                ; +0xd9, 0x1800bf209\ntest    rcx, rcx                                                       ; +0xe0, 0x1800bf210\njz      short loc_1800BF21A                                            ; +0xe3, 0x1800bf213\nmov     rax, [rcx]                                                     ; +0xe5, 0x1800bf215\ncall    qword ptr [rax]                                                ; +0xe8, 0x1800bf218\nmov     [rbx+0A8h], bpl                                                ; +0xea, 0x1800bf21a\nmov     al, 1                                                          ; +0xf1, 0x1800bf221\nmov     rbx, [rsp+38h+arg_8]                                           ; +0xf3, 0x1800bf223\nmov     rbp, [rsp+38h+arg_10]                                          ; +0xf8, 0x1800bf228\nmov     rsi, [rsp+38h+arg_18]                                          ; +0xfd, 0x1800bf22d\nadd     rsp, 30h                                                       ; +0x102, 0x1800bf232\npop     rdi                                                            ; +0x106, 0x1800bf236\nretn                                                                   ; +0x107, 0x1800bf237", "xrefs": ["cocos2d::CCTransitionScene::setNewScene @ 0x1800569af", "<???> @ 0x180141f34", "<???> @ 0x180141f44", "<???> @ 0x1801438a8", "<???> @ 0x1801b9288"], "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"}