{"type": "func", "start": 5371402896, "end": 5371403427, "name": "EditorOptionsLayer::onClose", "pseudocode": "// \n// EditorOptionsLayer::onClose from 0x140291a90 to 0x140291ca3 (531 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x140575870\n// > <???> @ 0x1406d19d0\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=8\nvoid EditorOptionsLayer::onClose(EditorOptionsLayer *a1, cocos2d::CCObject *a2)\n{\n  GameManager *v4; // rcx\n  int IntGameVariable; // edi\n  GameManager *v6; // rcx\n  int v7; // eax\n  __int64 v8; // rcx\n  GameManager *v9; // rcx\n  GameManager *v10; // rcx\n  __int64 v11; // rax\n  LevelEditorLayer *v12; // rcx\n  void *v13; // [rsp+30h] [rbp+8h]\n  void *v14; // [rsp+30h] [rbp+8h]\n  void *v15; // [rsp+30h] [rbp+8h]\n  void *v16; // [rsp+30h] [rbp+8h]\n  void *v17; // [rsp+30h] [rbp+8h]\n  void *v18; // [rsp+30h] [rbp+8h]\n\n  v4 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v13 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v13);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v4 = (GameManager *)qword_1406C2ED8;\n  }\n  IntGameVariable = GameManager::getIntGameVariable(v4, \"0049\");\n  v6 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v14 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v14);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v6 = (GameManager *)qword_1406C2ED8;\n  }\n  v7 = GameManager::getIntGameVariable(v6, \"0050\");\n  if ( a1->m_buttonsPerRow == IntGameVariable && a1->m_buttonRows == v7 )\n  {\n    v8 = qword_1406C2ED8;\n  }\n  else\n  {\n    v9 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v15 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v15);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v9 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::setIntGameVariable(v9, \"0049\", a1->m_buttonsPerRow);\n    v10 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v16 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v16);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v10 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::setIntGameVariable(v10, \"0050\", a1->m_buttonRows);\n    v8 = qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v17 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v17);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v8 = qword_1406C2ED8;\n    }\n    v11 = *(_QWORD *)(v8 + 528);\n    if ( v11 )\n      *(_BYTE *)(*(_QWORD *)(v11 + 14496) + 1441LL) = 1;\n  }\n  if ( !v8 )\n  {\n    v18 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v18);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v8 = qword_1406C2ED8;\n  }\n  v12 = *(LevelEditorLayer **)(v8 + 528);\n  if ( v12 )\n    LevelEditorLayer::updatePreviewParticles(v12);\n  SetupTriggerPopup::onClose(a1, a2);\n}", "assembly": "; \n; EditorOptionsLayer::onClose from 0x140291a90 to 0x140291ca3 (531 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x140575870\n; > <???> @ 0x1406d19d0\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, 0x140291a90\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140291a95\npush    rdi                                                            ; +0xa, 0x140291a9a\nsub     rsp, 20h                                                       ; +0xb, 0x140291a9b\nmov     rsi, rdx                                                       ; +0xf, 0x140291a9f\nmov     rbx, rcx                                                       ; +0x12, 0x140291aa2\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x15, 0x140291aa5\ntest    rcx, rcx                                                       ; +0x1c, 0x140291aac\njnz     short loc_140291AE0                                            ; +0x1f, 0x140291aaf\nmov     ecx, 668h; Size                                                ; +0x21, 0x140291ab1\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x26, 0x140291ab6\nmov     [rsp+28h+arg_0], rax                                           ; +0x2b, 0x140291abb\nmov     rcx, rax                                                       ; +0x30, 0x140291ac0\ncall    sub_14017AB00                                                  ; +0x33, 0x140291ac3\nnop                                                                    ; +0x38, 0x140291ac8\nmov     cs:qword_1406C2ED8, rax                                        ; +0x39, 0x140291ac9\nmov     rdx, [rax]                                                     ; +0x40, 0x140291ad0\nmov     rcx, rax                                                       ; +0x43, 0x140291ad3\ncall    qword ptr [rdx+48h]                                            ; +0x46, 0x140291ad6\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x49, 0x140291ad9\nlea     rdx, a0049; \"0049\"                                             ; +0x50, 0x140291ae0\ncall    GameManager__getIntGameVariable                                ; +0x57, 0x140291ae7\nmov     edi, eax                                                       ; +0x5c, 0x140291aec\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x5e, 0x140291aee\ntest    rcx, rcx                                                       ; +0x65, 0x140291af5\njnz     short loc_140291B29                                            ; +0x68, 0x140291af8\nmov     ecx, 668h; Size                                                ; +0x6a, 0x140291afa\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x6f, 0x140291aff\nmov     [rsp+28h+arg_0], rax                                           ; +0x74, 0x140291b04\nmov     rcx, rax                                                       ; +0x79, 0x140291b09\ncall    sub_14017AB00                                                  ; +0x7c, 0x140291b0c\nnop                                                                    ; +0x81, 0x140291b11\nmov     cs:qword_1406C2ED8, rax                                        ; +0x82, 0x140291b12\nmov     rdx, [rax]                                                     ; +0x89, 0x140291b19\nmov     rcx, rax                                                       ; +0x8c, 0x140291b1c\ncall    qword ptr [rdx+48h]                                            ; +0x8f, 0x140291b1f\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x92, 0x140291b22\nlea     rdx, a0050; \"0050\"                                             ; +0x99, 0x140291b29\ncall    GameManager__getIntGameVariable                                ; +0xa0, 0x140291b30\ncmp     [rbx+3F0h], edi                                                ; +0xa5, 0x140291b35\njnz     short loc_140291B51                                            ; +0xab, 0x140291b3b\ncmp     [rbx+3F4h], eax                                                ; +0xad, 0x140291b3d\njnz     short loc_140291B51                                            ; +0xb3, 0x140291b43\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xb5, 0x140291b45\njmp     loc_140291C44                                                  ; +0xbc, 0x140291b4c\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xc1, 0x140291b51\ntest    rcx, rcx                                                       ; +0xc8, 0x140291b58\njnz     short loc_140291B8D                                            ; +0xcb, 0x140291b5b\nmov     ecx, 668h; Size                                                ; +0xcd, 0x140291b5d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xd2, 0x140291b62\nmov     [rsp+28h+arg_0], rax                                           ; +0xd7, 0x140291b67\nmov     rcx, rax                                                       ; +0xdc, 0x140291b6c\ncall    sub_14017AB00                                                  ; +0xdf, 0x140291b6f\nnop                                                                    ; +0xe4, 0x140291b74\nmov     cs:qword_1406C2ED8, rax                                        ; +0xe5, 0x140291b75\nmov     r8, [rax]                                                      ; +0xec, 0x140291b7c\nmov     rcx, rax                                                       ; +0xef, 0x140291b7f\ncall    qword ptr [r8+48h]                                             ; +0xf2, 0x140291b82\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xf6, 0x140291b86\nmov     r8d, [rbx+3F0h]                                                ; +0xfd, 0x140291b8d\nlea     rdx, a0049; \"0049\"                                             ; +0x104, 0x140291b94\ncall    GameManager__setIntGameVariable                                ; +0x10b, 0x140291b9b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x110, 0x140291ba0\ntest    rcx, rcx                                                       ; +0x117, 0x140291ba7\njnz     short loc_140291BDC                                            ; +0x11a, 0x140291baa\nmov     ecx, 668h; Size                                                ; +0x11c, 0x140291bac\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x121, 0x140291bb1\nmov     [rsp+28h+arg_0], rax                                           ; +0x126, 0x140291bb6\nmov     rcx, rax                                                       ; +0x12b, 0x140291bbb\ncall    sub_14017AB00                                                  ; +0x12e, 0x140291bbe\nnop                                                                    ; +0x133, 0x140291bc3\nmov     cs:qword_1406C2ED8, rax                                        ; +0x134, 0x140291bc4\nmov     r8, [rax]                                                      ; +0x13b, 0x140291bcb\nmov     rcx, rax                                                       ; +0x13e, 0x140291bce\ncall    qword ptr [r8+48h]                                             ; +0x141, 0x140291bd1\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x145, 0x140291bd5\nmov     r8d, [rbx+3F4h]                                                ; +0x14c, 0x140291bdc\nlea     rdx, a0050; \"0050\"                                             ; +0x153, 0x140291be3\ncall    GameManager__setIntGameVariable                                ; +0x15a, 0x140291bea\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x15f, 0x140291bef\ntest    rcx, rcx                                                       ; +0x166, 0x140291bf6\njnz     short loc_140291C2A                                            ; +0x169, 0x140291bf9\nmov     ecx, 668h; Size                                                ; +0x16b, 0x140291bfb\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x170, 0x140291c00\nmov     [rsp+28h+arg_0], rax                                           ; +0x175, 0x140291c05\nmov     rcx, rax                                                       ; +0x17a, 0x140291c0a\ncall    sub_14017AB00                                                  ; +0x17d, 0x140291c0d\nnop                                                                    ; +0x182, 0x140291c12\nmov     cs:qword_1406C2ED8, rax                                        ; +0x183, 0x140291c13\nmov     rdx, [rax]                                                     ; +0x18a, 0x140291c1a\nmov     rcx, rax                                                       ; +0x18d, 0x140291c1d\ncall    qword ptr [rdx+48h]                                            ; +0x190, 0x140291c20\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x193, 0x140291c23\nmov     rax, [rcx+210h]                                                ; +0x19a, 0x140291c2a\ntest    rax, rax                                                       ; +0x1a1, 0x140291c31\njz      short loc_140291C44                                            ; +0x1a4, 0x140291c34\nmov     rax, [rax+38A0h]                                               ; +0x1a6, 0x140291c36\nmov     byte ptr [rax+5A1h], 1                                         ; +0x1ad, 0x140291c3d\ntest    rcx, rcx                                                       ; +0x1b4, 0x140291c44\njnz     short loc_140291C78                                            ; +0x1b7, 0x140291c47\nmov     ecx, 668h; Size                                                ; +0x1b9, 0x140291c49\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1be, 0x140291c4e\nmov     [rsp+28h+arg_0], rax                                           ; +0x1c3, 0x140291c53\nmov     rcx, rax                                                       ; +0x1c8, 0x140291c58\ncall    sub_14017AB00                                                  ; +0x1cb, 0x140291c5b\nnop                                                                    ; +0x1d0, 0x140291c60\nmov     cs:qword_1406C2ED8, rax                                        ; +0x1d1, 0x140291c61\nmov     rdx, [rax]                                                     ; +0x1d8, 0x140291c68\nmov     rcx, rax                                                       ; +0x1db, 0x140291c6b\ncall    qword ptr [rdx+48h]                                            ; +0x1de, 0x140291c6e\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1e1, 0x140291c71\nmov     rcx, [rcx+210h]                                                ; +0x1e8, 0x140291c78\ntest    rcx, rcx                                                       ; +0x1ef, 0x140291c7f\njz      short loc_140291C89                                            ; +0x1f2, 0x140291c82\ncall    LevelEditorLayer__updatePreviewParticles                       ; +0x1f4, 0x140291c84\nmov     rdx, rsi                                                       ; +0x1f9, 0x140291c89\nmov     rcx, rbx                                                       ; +0x1fc, 0x140291c8c\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x1ff, 0x140291c8f\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x204, 0x140291c94\nadd     rsp, 20h                                                       ; +0x209, 0x140291c99\npop     rdi                                                            ; +0x20d, 0x140291c9d\njmp     SetupTriggerPopup__onClose                                     ; +0x20e, 0x140291c9e", "xrefs": ["<???> @ 0x140575870", "<???> @ 0x1406d19d0"], "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"}