{"type": "func", "start": 5369841280, "end": 5369841631, "name": "EditorUI::onGoToLayer", "pseudocode": "// \n// EditorUI::onGoToLayer from 0x140114680 to 0x1401147df (351 bytes)\n// \n// 4 xrefs:\n// > EditorUI::init @ 0x1400e11a0\n// > <???> @ 0x14066f518\n// > <???> @ 0x14066f528\n// > <???> @ 0x1406c90fc\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 EditorUI::onGoToLayer(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  int m_currentLayer; // r12d\n  GameObject *m_selectedObject; // rax\n  int m_editorLayer; // edi\n  int m_editorLayer2; // ebx\n  cocos2d::CCArray *m_selectedObjects; // r14\n  unsigned int v8; // esi\n  unsigned int v9; // ebp\n  int m_uIndexInArray_high; // ecx\n  cocos2d::CCArray *v11; // rbp\n  int m_uUnknown_low; // ecx\n\n  if ( a1->m_selectedObject || cocos2d::CCArray::count(a1->m_selectedObjects) )\n  {\n    m_currentLayer = a1->m_editorLayer->m_currentLayer;\n    m_selectedObject = a1->m_selectedObject;\n    if ( m_selectedObject )\n    {\n      m_editorLayer = m_selectedObject->m_editorLayer;\n      m_editorLayer2 = m_selectedObject->m_editorLayer2;\n    }\n    else\n    {\n      m_selectedObjects = a1->m_selectedObjects;\n      v8 = 0;\n      m_editorLayer2 = -1;\n      if ( !m_selectedObjects )\n        goto LABEL_12;\n      m_editorLayer = -1;\n      v9 = 0;\n      if ( !cocos2d::CCArray::count(a1->m_selectedObjects) )\n        goto LABEL_12;\n      do\n      {\n        m_uIndexInArray_high = SHIWORD(cocos2d::CCArray::objectAtIndex(m_selectedObjects, v9)[21].m_uIndexInArray);\n        if ( m_editorLayer == -1 )\n        {\n          m_editorLayer = m_uIndexInArray_high;\n        }\n        else if ( m_editorLayer != m_uIndexInArray_high )\n        {\n          goto LABEL_12;\n        }\n        ++v9;\n      }\n      while ( v9 < cocos2d::CCArray::count(m_selectedObjects) );\n      if ( m_editorLayer == -1 )\nLABEL_12:\n        m_editorLayer = 0;\n      v11 = a1->m_selectedObjects;\n      if ( !v11 || !cocos2d::CCArray::count(a1->m_selectedObjects) )\n        goto LABEL_24;\n      do\n      {\n        m_uUnknown_low = SLOWORD(cocos2d::CCArray::objectAtIndex(v11, v8)[21].m_uUnknown);\n        if ( m_editorLayer2 == -1 )\n        {\n          m_editorLayer2 = m_uUnknown_low;\n        }\n        else if ( m_editorLayer2 != m_uUnknown_low )\n        {\n          goto LABEL_24;\n        }\n        ++v8;\n      }\n      while ( v8 < cocos2d::CCArray::count(v11) );\n      if ( m_editorLayer2 == -1 )\n        goto LABEL_24;\n    }\n    if ( m_editorLayer2 )\n    {\n      if ( m_editorLayer )\n      {\n        if ( m_currentLayer != m_editorLayer2 )\n        {\nLABEL_25:\n          a1->m_editorLayer->m_currentLayer = m_editorLayer2;\n          EditorUI::updateGroupIDLabel(a1);\n          return;\n        }\n      }\n      else\n      {\n        LOWORD(m_editorLayer) = m_editorLayer2;\n      }\n    }\nLABEL_24:\n    LOWORD(m_editorLayer2) = m_editorLayer;\n    goto LABEL_25;\n  }\n}", "assembly": "; \n; EditorUI::onGoToLayer from 0x140114680 to 0x1401147df (351 bytes)\n; \n; 4 xrefs:\n; > EditorUI::init @ 0x1400e11a0\n; > <???> @ 0x14066f518\n; > <???> @ 0x14066f528\n; > <???> @ 0x1406c90fc\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\npush    r14                                                            ; +0x0, 0x140114680\npush    r15                                                            ; +0x2, 0x140114682\nsub     rsp, 28h                                                       ; +0x4, 0x140114684\ncmp     qword ptr [rcx+538h], 0                                        ; +0x8, 0x140114688\nmov     r15, rcx                                                       ; +0x10, 0x140114690\njnz     short loc_1401146AA                                            ; +0x13, 0x140114693\nmov     rcx, [rcx+340h]                                                ; +0x15, 0x140114695\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1c, 0x14011469c\ntest    eax, eax                                                       ; +0x22, 0x1401146a2\njz      loc_1401147D6                                                  ; +0x24, 0x1401146a4\nmov     rax, [r15+500h]                                                ; +0x2a, 0x1401146aa\nmov     [rsp+38h+arg_0], rbx                                           ; +0x31, 0x1401146b1\nmov     [rsp+38h+arg_8], rbp                                           ; +0x36, 0x1401146b6\nmov     [rsp+38h+arg_10], rsi                                          ; +0x3b, 0x1401146bb\nmov     [rsp+38h+arg_18], rdi                                          ; +0x40, 0x1401146c0\nmov     [rsp+38h+var_18], r12                                          ; +0x45, 0x1401146c5\nmovsx   r12d, word ptr [rax+387Ah]                                     ; +0x4a, 0x1401146ca\nmov     rax, [r15+538h]                                                ; +0x52, 0x1401146d2\ntest    rax, rax                                                       ; +0x59, 0x1401146d9\njz      short loc_1401146F1                                            ; +0x5c, 0x1401146dc\nmovsx   edi, word ptr [rax+4BAh]                                       ; +0x5e, 0x1401146de\nmovsx   ebx, word ptr [rax+4BCh]                                       ; +0x65, 0x1401146e5\njmp     loc_140114794                                                  ; +0x6c, 0x1401146ec\nmov     r14, [r15+340h]                                                ; +0x71, 0x1401146f1\nxor     esi, esi                                                       ; +0x78, 0x1401146f8\nmov     ebx, 0FFFFFFFFh                                                ; +0x7a, 0x1401146fa\ntest    r14, r14                                                       ; +0x7f, 0x1401146ff\njz      short loc_140114746                                            ; +0x82, 0x140114702\nmov     rcx, r14                                                       ; +0x84, 0x140114704\nmov     edi, ebx                                                       ; +0x87, 0x140114707\nmov     ebp, esi                                                       ; +0x89, 0x140114709\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x8b, 0x14011470b\ntest    eax, eax                                                       ; +0x91, 0x140114711\njz      short loc_140114746                                            ; +0x93, 0x140114713\nmov     edx, ebp                                                       ; +0x95, 0x140114715\nmov     rcx, r14                                                       ; +0x97, 0x140114717\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x9a, 0x14011471a\nmovsx   ecx, word ptr [rax+4BAh]                                       ; +0xa0, 0x140114720\ncmp     edi, ebx                                                       ; +0xa7, 0x140114727\njnz     short loc_14011472F                                            ; +0xa9, 0x140114729\nmov     edi, ecx                                                       ; +0xab, 0x14011472b\njmp     short loc_140114733                                            ; +0xad, 0x14011472d\ncmp     edi, ecx                                                       ; +0xaf, 0x14011472f\njnz     short loc_140114746                                            ; +0xb1, 0x140114731\nmov     rcx, r14                                                       ; +0xb3, 0x140114733\ninc     ebp                                                            ; +0xb6, 0x140114736\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xb8, 0x140114738\ncmp     ebp, eax                                                       ; +0xbe, 0x14011473e\njb      short loc_140114715                                            ; +0xc0, 0x140114740\ncmp     edi, ebx                                                       ; +0xc2, 0x140114742\njnz     short loc_140114748                                            ; +0xc4, 0x140114744\nmov     edi, esi                                                       ; +0xc6, 0x140114746\nmov     rbp, [r15+340h]                                                ; +0xc8, 0x140114748\ntest    rbp, rbp                                                       ; +0xcf, 0x14011474f\njz      short loc_1401147A5                                            ; +0xd2, 0x140114752\nmov     rcx, rbp                                                       ; +0xd4, 0x140114754\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xd7, 0x140114757\ntest    eax, eax                                                       ; +0xdd, 0x14011475d\njz      short loc_1401147A5                                            ; +0xdf, 0x14011475f\nmov     edx, esi                                                       ; +0xe1, 0x140114761\nmov     rcx, rbp                                                       ; +0xe3, 0x140114763\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0xe6, 0x140114766\nmovsx   ecx, word ptr [rax+4BCh]                                       ; +0xec, 0x14011476c\ncmp     ebx, 0FFFFFFFFh                                                ; +0xf3, 0x140114773\njnz     short loc_14011477C                                            ; +0xf6, 0x140114776\nmov     ebx, ecx                                                       ; +0xf8, 0x140114778\njmp     short loc_140114780                                            ; +0xfa, 0x14011477a\ncmp     ebx, ecx                                                       ; +0xfc, 0x14011477c\njnz     short loc_1401147A5                                            ; +0xfe, 0x14011477e\nmov     rcx, rbp                                                       ; +0x100, 0x140114780\ninc     esi                                                            ; +0x103, 0x140114783\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x105, 0x140114785\ncmp     esi, eax                                                       ; +0x10b, 0x14011478b\njb      short loc_140114761                                            ; +0x10d, 0x14011478d\ncmp     ebx, 0FFFFFFFFh                                                ; +0x10f, 0x14011478f\njz      short loc_1401147A5                                            ; +0x112, 0x140114792\ntest    ebx, ebx                                                       ; +0x114, 0x140114794\njz      short loc_1401147A5                                            ; +0x116, 0x140114796\ntest    edi, edi                                                       ; +0x118, 0x140114798\njnz     short loc_1401147A0                                            ; +0x11a, 0x14011479a\nmov     edi, ebx                                                       ; +0x11c, 0x14011479c\njmp     short loc_1401147A5                                            ; +0x11e, 0x14011479e\ncmp     r12d, ebx                                                      ; +0x120, 0x1401147a0\njnz     short loc_1401147A7                                            ; +0x123, 0x1401147a3\nmov     ebx, edi                                                       ; +0x125, 0x1401147a5\nmov     rax, [r15+500h]                                                ; +0x127, 0x1401147a7\nmov     rcx, r15                                                       ; +0x12e, 0x1401147ae\nmov     [rax+387Ah], bx                                                ; +0x131, 0x1401147b1\ncall    EditorUI__updateGroupIDLabel                                   ; +0x138, 0x1401147b8\nmov     r12, [rsp+38h+var_18]                                          ; +0x13d, 0x1401147bd\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x142, 0x1401147c2\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x147, 0x1401147c7\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x14c, 0x1401147cc\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x151, 0x1401147d1\nadd     rsp, 28h                                                       ; +0x156, 0x1401147d6\npop     r15                                                            ; +0x15a, 0x1401147da\npop     r14                                                            ; +0x15c, 0x1401147dc\nretn                                                                   ; +0x15e, 0x1401147de", "xrefs": ["EditorUI::init @ 0x1400e11a0", "<???> @ 0x14066f518", "<???> @ 0x14066f528", "<???> @ 0x1406c90fc"], "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"}