{"type": "func", "start": 5369654352, "end": 5369655001, "name": "EditorUI::setIDPopupClosed", "pseudocode": "// \n// EditorUI::setIDPopupClosed from 0x1400e6c50 to 0x1400e6ed9 (649 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x140552738\n// > <???> @ 0x1406c8d84\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=3\nvoid EditorUI::setIDPopupClosed(EditorUI *a1, SetIDPopup *a2, int a3)\n{\n  GameManager *v6; // rcx\n  cocos2d::CCString *v7; // rax\n  const char *CString; // rax\n  GameManager *v9; // rcx\n  char *v10; // rax\n  size_t v11; // r8\n  void **v12; // rbx\n  void **v13; // rdx\n  void *v14; // rcx\n  void *v15; // [rsp+20h] [rbp-68h]\n  void *v16; // [rsp+20h] [rbp-68h]\n  void *Block[2]; // [rsp+28h] [rbp-60h] BYREF\n  __int128 v18; // [rsp+38h] [rbp-50h]\n  _QWORD v19[4]; // [rsp+48h] [rbp-40h] BYREF\n\n  if ( a2->getTag(a2) == 1 )\n  {\n    v6 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v15 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v15);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v6 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::setIntGameVariable(v6, \"0133\", a3);\n    v7 = cocos2d::CCString::createWithFormat(\"%i\", a3);\n    CString = cocos2d::CCString::getCString(v7);\n    ButtonSprite::setString((ButtonSprite *)a1->m_editButtonDict, CString);\n  }\n  else if ( a2->getTag(a2) == 2 )\n  {\n    v9 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v16 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v16);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v9 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::setIntGameVariable(v9, \"0139\", a3);\n    *(_OWORD *)Block = 0;\n    *(_QWORD *)&v18 = 0;\n    *((_QWORD *)&v18 + 1) = 15;\n    LOBYTE(Block[0]) = 0;\n    if ( a3 < 1000 )\n    {\n      v12 = (void **)GameToolbox::intToString(v19, a3);\n      if ( Block != v12 )\n      {\n        *(_QWORD *)&v18 = 0;\n        *((_QWORD *)&v18 + 1) = 15;\n        LOBYTE(Block[0]) = 0;\n        *(_OWORD *)Block = *(_OWORD *)v12;\n        v18 = *((_OWORD *)v12 + 1);\n        v12[2] = nullptr;\n        v12[3] = (void *)15;\n        *(_BYTE *)v12 = 0;\n      }\n      sub_14003A830((__int64)v19);\n    }\n    else\n    {\n      v10 = (char *)GJSpecialColorSelect::textForColorIdx(a3);\n      v11 = -1;\n      do\n        ++v11;\n      while ( v10[v11] );\n      sub_14003CCE0(Block, v10, v11);\n    }\n    v13 = Block;\n    if ( *((_QWORD *)&v18 + 1) > 0xFu )\n      v13 = (void **)Block[0];\n    ButtonSprite::setString((ButtonSprite *)a1->m_createButtonBar, (const char *)v13);\n    if ( *((_QWORD *)&v18 + 1) > 0xFu )\n    {\n      v14 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v18 + 1) + 1LL) >= 0x1000 )\n      {\n        v14 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v14);\n    }\n  }\n  else if ( a2->getTag(a2) == 3 )\n  {\n    EditorUI::findAndSelectObject(\n      (EditorUI *)((char *)a1 - 456),\n      a3,\n      (bool)a2[1].FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);\n  }\n}", "assembly": "; \n; EditorUI::setIDPopupClosed from 0x1400e6c50 to 0x1400e6ed9 (649 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x140552738\n; > <???> @ 0x1406c8d84\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    rbx                                                            ; +0x0, 0x1400e6c50\npush    rsi                                                            ; +0x2, 0x1400e6c52\npush    rdi                                                            ; +0x3, 0x1400e6c53\nsub     rsp, 70h                                                       ; +0x4, 0x1400e6c54\nmov     rax, cs:__security_cookie                                      ; +0x8, 0x1400e6c58\nxor     rax, rsp                                                       ; +0xf, 0x1400e6c5f\nmov     [rsp+88h+var_20], rax                                          ; +0x12, 0x1400e6c62\nmov     edi, r8d                                                       ; +0x17, 0x1400e6c67\nmov     rbx, rdx                                                       ; +0x1a, 0x1400e6c6a\nmov     rsi, rcx                                                       ; +0x1d, 0x1400e6c6d\nmov     rax, [rdx]                                                     ; +0x20, 0x1400e6c70\nmov     rcx, rdx                                                       ; +0x23, 0x1400e6c73\ncall    qword ptr [rax+38h]                                            ; +0x26, 0x1400e6c76\ncmp     eax, 1                                                         ; +0x29, 0x1400e6c79\njnz     short loc_1400E6CF5                                            ; +0x2c, 0x1400e6c7c\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x2e, 0x1400e6c7e\ntest    rcx, rcx                                                       ; +0x35, 0x1400e6c85\njnz     short loc_1400E6CBA                                            ; +0x38, 0x1400e6c88\nmov     ecx, 668h; Size                                                ; +0x3a, 0x1400e6c8a\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x3f, 0x1400e6c8f\nmov     [rsp+88h+var_68], rax                                          ; +0x44, 0x1400e6c94\nmov     rcx, rax                                                       ; +0x49, 0x1400e6c99\ncall    sub_14017AB00                                                  ; +0x4c, 0x1400e6c9c\nnop                                                                    ; +0x51, 0x1400e6ca1\nmov     cs:qword_1406C2ED8, rax                                        ; +0x52, 0x1400e6ca2\nmov     r8, [rax]                                                      ; +0x59, 0x1400e6ca9\nmov     rcx, rax                                                       ; +0x5c, 0x1400e6cac\ncall    qword ptr [r8+48h]                                             ; +0x5f, 0x1400e6caf\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x63, 0x1400e6cb3\nmov     r8d, edi                                                       ; +0x6a, 0x1400e6cba\nlea     rdx, a0133; \"0133\"                                             ; +0x6d, 0x1400e6cbd\ncall    GameManager__setIntGameVariable                                ; +0x74, 0x1400e6cc4\nmov     edx, edi                                                       ; +0x79, 0x1400e6cc9\nlea     rcx, aI_11; \"%i\"                                               ; +0x7b, 0x1400e6ccb\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x82, 0x1400e6cd2\nmov     rcx, rax                                                       ; +0x88, 0x1400e6cd8\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x8b, 0x1400e6cdb\nmov     rdx, rax                                                       ; +0x91, 0x1400e6ce1\nmov     rcx, [rsi+2F0h]                                                ; +0x94, 0x1400e6ce4\ncall    ButtonSprite__setString                                        ; +0x9b, 0x1400e6ceb\njmp     loc_1400E6EC4                                                  ; +0xa0, 0x1400e6cf0\nmov     rax, [rbx]                                                     ; +0xa5, 0x1400e6cf5\nmov     rcx, rbx                                                       ; +0xa8, 0x1400e6cf8\ncall    qword ptr [rax+38h]                                            ; +0xab, 0x1400e6cfb\ncmp     eax, 2                                                         ; +0xae, 0x1400e6cfe\njnz     loc_1400E6EA0                                                  ; +0xb1, 0x1400e6d01\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xb7, 0x1400e6d07\ntest    rcx, rcx                                                       ; +0xbe, 0x1400e6d0e\njnz     short loc_1400E6D42                                            ; +0xc1, 0x1400e6d11\nmov     ecx, 668h; Size                                                ; +0xc3, 0x1400e6d13\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xc8, 0x1400e6d18\nmov     [rsp+88h+var_68], rax                                          ; +0xcd, 0x1400e6d1d\nmov     rcx, rax                                                       ; +0xd2, 0x1400e6d22\ncall    sub_14017AB00                                                  ; +0xd5, 0x1400e6d25\nnop                                                                    ; +0xda, 0x1400e6d2a\nmov     cs:qword_1406C2ED8, rax                                        ; +0xdb, 0x1400e6d2b\nmov     rdx, [rax]                                                     ; +0xe2, 0x1400e6d32\nmov     rcx, rax                                                       ; +0xe5, 0x1400e6d35\ncall    qword ptr [rdx+48h]                                            ; +0xe8, 0x1400e6d38\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xeb, 0x1400e6d3b\nmov     r8d, edi                                                       ; +0xf2, 0x1400e6d42\nlea     rdx, a0139; \"0139\"                                             ; +0xf5, 0x1400e6d45\ncall    GameManager__setIntGameVariable                                ; +0xfc, 0x1400e6d4c\nxorps   xmm0, xmm0                                                     ; +0x101, 0x1400e6d51\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x104, 0x1400e6d54\nmov     qword ptr [rsp+88h+var_50], 0                                  ; +0x109, 0x1400e6d59\nmov     qword ptr [rsp+88h+var_50+8], 0Fh                              ; +0x112, 0x1400e6d62\nmov     byte ptr [rsp+88h+Block], 0                                    ; +0x11b, 0x1400e6d6b\ncmp     edi, 3E8h                                                      ; +0x120, 0x1400e6d70\njl      short loc_1400E6DA2                                            ; +0x126, 0x1400e6d76\nmov     ecx, edi                                                       ; +0x128, 0x1400e6d78\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0x12a, 0x1400e6d7a\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x12f, 0x1400e6d7f\ninc     r8; Size                                                       ; +0x136, 0x1400e6d86\ncmp     byte ptr [rax+r8], 0                                           ; +0x139, 0x1400e6d89\njnz     short loc_1400E6D86                                            ; +0x13e, 0x1400e6d8e\nmov     rdx, rax; Src                                                  ; +0x140, 0x1400e6d90\nlea     rcx, [rsp+88h+Block]; void *                                   ; +0x143, 0x1400e6d93\ncall    sub_14003CCE0                                                  ; +0x148, 0x1400e6d98\njmp     loc_1400E6E40                                                  ; +0x14d, 0x1400e6d9d\nmov     edx, edi                                                       ; +0x152, 0x1400e6da2\nlea     rcx, [rsp+88h+var_40]                                          ; +0x154, 0x1400e6da4\ncall    GameToolbox__intToString                                       ; +0x159, 0x1400e6da9\nmov     rbx, rax                                                       ; +0x15e, 0x1400e6dae\nlea     rax, [rsp+88h+Block]                                           ; +0x161, 0x1400e6db1\ncmp     rax, rbx                                                       ; +0x166, 0x1400e6db6\njz      short loc_1400E6E36                                            ; +0x169, 0x1400e6db9\nmov     rdx, qword ptr [rsp+88h+var_50+8]                              ; +0x16b, 0x1400e6dbb\ncmp     rdx, 0Fh                                                       ; +0x170, 0x1400e6dc0\njbe     short loc_1400E6DFB                                            ; +0x174, 0x1400e6dc4\ninc     rdx                                                            ; +0x176, 0x1400e6dc6\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x179, 0x1400e6dc9\nmov     rax, rcx                                                       ; +0x17e, 0x1400e6dce\ncmp     rdx, 1000h                                                     ; +0x181, 0x1400e6dd1\njb      short loc_1400E6DF6                                            ; +0x188, 0x1400e6dd8\nadd     rdx, 27h ; '''                                                 ; +0x18a, 0x1400e6dda\nmov     rcx, [rcx-8]                                                   ; +0x18e, 0x1400e6dde\nsub     rax, rcx                                                       ; +0x192, 0x1400e6de2\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x195, 0x1400e6de5\ncmp     rax, 1Fh                                                       ; +0x199, 0x1400e6de9\njbe     short loc_1400E6DF6                                            ; +0x19d, 0x1400e6ded\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x19f, 0x1400e6def\nalign 2                                                                ; +0x1a5, 0x1400e6df5\ncall    j_j_free                                                       ; +0x1a6, 0x1400e6df6\nmov     qword ptr [rsp+88h+var_50], 0                                  ; +0x1ab, 0x1400e6dfb\nmov     qword ptr [rsp+88h+var_50+8], 0Fh                              ; +0x1b4, 0x1400e6e04\nmov     byte ptr [rsp+88h+Block], 0                                    ; +0x1bd, 0x1400e6e0d\nmovups  xmm0, xmmword ptr [rbx]                                        ; +0x1c2, 0x1400e6e12\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x1c5, 0x1400e6e15\nmovups  xmm1, xmmword ptr [rbx+10h]                                    ; +0x1ca, 0x1400e6e1a\nmovups  [rsp+88h+var_50], xmm1                                         ; +0x1ce, 0x1400e6e1e\nmov     qword ptr [rbx+10h], 0                                         ; +0x1d3, 0x1400e6e23\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0x1db, 0x1400e6e2b\nmov     byte ptr [rbx], 0                                              ; +0x1e3, 0x1400e6e33\nlea     rcx, [rsp+88h+var_40]                                          ; +0x1e6, 0x1400e6e36\ncall    sub_14003A830                                                  ; +0x1eb, 0x1400e6e3b\nlea     rdx, [rsp+88h+Block]                                           ; +0x1f0, 0x1400e6e40\ncmp     qword ptr [rsp+88h+var_50+8], 0Fh                              ; +0x1f5, 0x1400e6e45\ncmova   rdx, [rsp+88h+Block]                                           ; +0x1fb, 0x1400e6e4b\nmov     rcx, [rsi+2F8h]                                                ; +0x201, 0x1400e6e51\ncall    ButtonSprite__setString                                        ; +0x208, 0x1400e6e58\nnop                                                                    ; +0x20d, 0x1400e6e5d\nmov     rdx, qword ptr [rsp+88h+var_50+8]                              ; +0x20e, 0x1400e6e5e\ncmp     rdx, 0Fh                                                       ; +0x213, 0x1400e6e63\njbe     short loc_1400E6EC4                                            ; +0x217, 0x1400e6e67\ninc     rdx                                                            ; +0x219, 0x1400e6e69\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x21c, 0x1400e6e6c\nmov     rax, rcx                                                       ; +0x221, 0x1400e6e71\ncmp     rdx, 1000h                                                     ; +0x224, 0x1400e6e74\njb      short loc_1400E6E99                                            ; +0x22b, 0x1400e6e7b\nadd     rdx, 27h ; '''                                                 ; +0x22d, 0x1400e6e7d\nmov     rcx, [rcx-8]                                                   ; +0x231, 0x1400e6e81\nsub     rax, rcx                                                       ; +0x235, 0x1400e6e85\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x238, 0x1400e6e88\ncmp     rax, 1Fh                                                       ; +0x23c, 0x1400e6e8c\njbe     short loc_1400E6E99                                            ; +0x240, 0x1400e6e90\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x242, 0x1400e6e92\ndb 0CCh                                                                ; +0x248, 0x1400e6e98\ncall    j_j_free                                                       ; +0x249, 0x1400e6e99\njmp     short loc_1400E6EC4                                            ; +0x24e, 0x1400e6e9e\nmov     rax, [rbx]                                                     ; +0x250, 0x1400e6ea0\nmov     rcx, rbx                                                       ; +0x253, 0x1400e6ea3\ncall    qword ptr [rax+38h]                                            ; +0x256, 0x1400e6ea6\ncmp     eax, 3                                                         ; +0x259, 0x1400e6ea9\njnz     short loc_1400E6EC4                                            ; +0x25c, 0x1400e6eac\nlea     rcx, [rsi-1C8h]                                                ; +0x25e, 0x1400e6eae\nmovzx   r8d, byte ptr [rbx+2A8h]                                       ; +0x265, 0x1400e6eb5\nmov     edx, edi                                                       ; +0x26d, 0x1400e6ebd\ncall    EditorUI__findAndSelectObject                                  ; +0x26f, 0x1400e6ebf\nmov     rcx, [rsp+88h+var_20]                                          ; +0x274, 0x1400e6ec4\nxor     rcx, rsp; StackCookie                                          ; +0x279, 0x1400e6ec9\ncall    __security_check_cookie                                        ; +0x27c, 0x1400e6ecc\nadd     rsp, 70h                                                       ; +0x281, 0x1400e6ed1\npop     rdi                                                            ; +0x285, 0x1400e6ed5\npop     rsi                                                            ; +0x286, 0x1400e6ed6\npop     rbx                                                            ; +0x287, 0x1400e6ed7\nretn                                                                   ; +0x288, 0x1400e6ed8", "xrefs": ["<???> @ 0x140552738", "<???> @ 0x1406c8d84"], "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"}