{"type": "func", "start": 4751872, "end": 4752150, "name": "EditorUI::setIDPopupClosed", "pseudocode": "// \n// EditorUI::setIDPopupClosed from 0x488200 to 0x488316 (278 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'EditorUI::setIDPopupClosed @ 0x488330\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:49:27 +0000\n// \n\nint __fastcall EditorUI::setIDPopupClosed(EditorUI *this, SetIDPopup *a2, char *a3)\n{\n  GameManager *v6; // r0\n  int v7; // r3\n  int v8; // r4\n  cocos2d::CCString *v9; // r0\n  char *CString; // r0\n  int result; // r0\n  GameManager *v12; // r0\n  int v13; // r3\n  int v14; // r1\n  const char *v15; // r6\n  size_t v16; // r0\n  int v17; // r0\n  int v18; // r1\n  char *v19; // r2\n  char *v20; // r1\n  int v21; // [sp+4h] [bp-1Ch] BYREF\n  int v22; // [sp+8h] [bp-18h]\n  char *v23; // [sp+Ch] [bp-14h]\n  int v24; // [sp+10h] [bp-10h] BYREF\n  int v25; // [sp+14h] [bp-Ch]\n  char *v26; // [sp+18h] [bp-8h]\n\n  if ( (*(int (__fastcall **)(SetIDPopup *))(*(_DWORD *)a2 + 32))(a2) == 1 )\n  {\n    v6 = (GameManager *)GameManager::sharedState((GameManager *)((char *)&dword_0 + 1));\n    GameManager::setIntGameVariable(v6, \"0133\", a3, v7);\n    v8 = *((_DWORD *)this + 219);\n    v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", a3);\n    CString = (char *)cocos2d::CCString::getCString(v9);\n    return ButtonSprite::setString(v8, CString);\n  }\n  else\n  {\n    result = (*(int (__fastcall **)(SetIDPopup *))(*(_DWORD *)a2 + 32))(a2);\n    if ( result == 2 )\n    {\n      v12 = (GameManager *)GameManager::sharedState((GameManager *)((char *)&dword_0 + 2));\n      GameManager::setIntGameVariable(v12, \"0139\", a3, v13);\n      v21 = 0;\n      v22 = 0;\n      v23 = nullptr;\n      std::string::__init(&v21, &unk_B6B226, 0);\n      if ( (int)a3 < 1000 )\n      {\n        GameToolbox::intToString((GameToolbox *)&v24, (int)a3);\n        if ( (v21 & 1) != 0 )\n        {\n          *v23 = 0;\n          v22 = 0;\n        }\n        else\n        {\n          LOWORD(v21) = 0;\n        }\n        std::string::reserve(&v21, 0);\n        v17 = v24;\n        v18 = v25;\n        v19 = v26;\n        v24 = 0;\n        v25 = 0;\n        v26 = nullptr;\n        v21 = v17;\n        v22 = v18;\n        v23 = v19;\n        std::string::~string((int)&v24);\n      }\n      else\n      {\n        v15 = (const char *)GJSpecialColorSelect::textForColorIdx((GJSpecialColorSelect *)a3, v14);\n        v16 = strlen(v15);\n        std::string::assign(&v21, v15, v16);\n      }\n      if ( (v21 & 1) != 0 )\n        v20 = v23;\n      else\n        v20 = (char *)&v21 + 1;\n      ButtonSprite::setString(*((_DWORD *)this + 220), v20);\n      return std::string::~string((int)&v21);\n    }\n  }\n  return result;\n}", "assembly": "; \n; EditorUI::setIDPopupClosed from 0x488200 to 0x488316 (278 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'EditorUI::setIDPopupClosed @ 0x488330\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:49:27 +0000\n; \nPUSH.W          {R4-R8,LR}                                             ; +0x0, 0x488200\nSUB             SP, SP, #0x20                                          ; +0x4, 0x488204\nLDR             R5, =(__stack_chk_guard_ptr - 0x488212)                ; +0x6, 0x488206\nMOV             R8, R0                                                 ; +0x8, 0x488208\nMOV             R0, R1                                                 ; +0xa, 0x48820a\nMOV             R4, R1                                                 ; +0xc, 0x48820c\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x48820e\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x488210\nMOV             R6, R2                                                 ; +0x12, 0x488212\nLDR             R3, [R5]                                               ; +0x14, 0x488214\nSTR             R3, [SP,#0x20+var_4]                                   ; +0x16, 0x488216\nLDR             R3, [R1]                                               ; +0x18, 0x488218\nLDR             R3, [R3,#0x20]                                         ; +0x1a, 0x48821a\nBLX             R3                                                     ; +0x1c, 0x48821c\nCMP             R0, #1                                                 ; +0x1e, 0x48821e\nBNE             loc_48824C                                             ; +0x20, 0x488220\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x22, 0x488222\nLDR             R1, =(a0133 - 0x48822E); \"0133\"                        ; +0x26, 0x488226\nMOV             R2, R6; int                                            ; +0x28, 0x488228\nADD             R1, PC; \"0133\"                                         ; +0x2a, 0x48822a\nBL              _ZN11GameManager18setIntGameVariableEPKci; GameManager::setIntGameVariable(char const*,int) ; +0x2c, 0x48822c\nLDR             R0, =(aI - 0x48823C); \"%i\"                             ; +0x30, 0x488230\nMOV             R1, R6; char *                                         ; +0x32, 0x488232\nLDR.W           R4, [R8,#0x36C]                                        ; +0x34, 0x488234\nADD             R0, PC; \"%i\"                                           ; +0x38, 0x488238\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x3a, 0x48823a\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x3e, 0x48823e\nMOV             R1, R0; char *                                         ; +0x42, 0x488242\nMOV             R0, R4; this                                           ; +0x44, 0x488244\nBL              _ZN12ButtonSprite9setStringEPKc; ButtonSprite::setString(char const*) ; +0x46, 0x488246\nB               loc_488304                                             ; +0x4a, 0x48824a\nLDR             R3, [R4]                                               ; +0x4c, 0x48824c\nMOV             R0, R4                                                 ; +0x4e, 0x48824e\nLDR             R3, [R3,#0x20]                                         ; +0x50, 0x488250\nBLX             R3                                                     ; +0x52, 0x488252\nCMP             R0, #2                                                 ; +0x54, 0x488254\nBNE             loc_488304                                             ; +0x56, 0x488256\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x58, 0x488258\nLDR             R1, =(a0139 - 0x488266); \"0139\"                        ; +0x5c, 0x48825c\nMOV             R2, R6; int                                            ; +0x5e, 0x48825e\nADD             R4, SP, #0x20+var_1C                                   ; +0x60, 0x488260\nADD             R1, PC; \"0139\"                                         ; +0x62, 0x488262\nBL              _ZN11GameManager18setIntGameVariableEPKci; GameManager::setIntGameVariable(char const*,int) ; +0x64, 0x488264\nLDR             R1, =(unk_B6B226 - 0x488272)                           ; +0x68, 0x488268\nMOVS            R2, #0                                                 ; +0x6a, 0x48826a\nMOV             R0, R4                                                 ; +0x6c, 0x48826c\nADD             R1, PC; unk_B6B226                                     ; +0x6e, 0x48826e\nSTR             R2, [SP,#0x20+var_1C]                                  ; +0x70, 0x488270\nSTR             R2, [SP,#0x20+var_18]                                  ; +0x72, 0x488272\nSTR             R2, [SP,#0x20+var_14]                                  ; +0x74, 0x488274\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x76, 0x488276\nCMP.W           R6, #0x3E8                                             ; +0x7a, 0x48827a\nBLT             loc_488298                                             ; +0x7e, 0x48827e\nMOV             R0, R6; this                                           ; +0x80, 0x488280\nBL              _ZN20GJSpecialColorSelect15textForColorIdxEi; GJSpecialColorSelect::textForColorIdx(int) ; +0x82, 0x488282\nMOV             R6, R0                                                 ; +0x86, 0x488286\nBLX             strlen                                                 ; +0x88, 0x488288\nMOV             R1, R6; int                                            ; +0x8c, 0x48828c\nMOV             R2, R0; size_t                                         ; +0x8e, 0x48828e\nMOV             R0, R4; int                                            ; +0x90, 0x488290\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcj; std::string::assign(char const*,uint) ; +0x92, 0x488292\nB               loc_4882DC                                             ; +0x96, 0x488296\nADD             R7, SP, #0x20+var_10                                   ; +0x98, 0x488298\nMOV             R1, R6; int                                            ; +0x9a, 0x48829a\nMOV             R0, R7; this                                           ; +0x9c, 0x48829c\nBL              _ZN11GameToolbox11intToStringEi; GameToolbox::intToString(int) ; +0x9e, 0x48829e\nLDRB.W          R3, [SP,#0x20+var_1C]                                  ; +0xa2, 0x4882a2\nMOV             R0, R4                                                 ; +0xa6, 0x4882a6\nMOVS            R1, #0                                                 ; +0xa8, 0x4882a8\nANDS.W          R3, R3, #1                                             ; +0xaa, 0x4882aa\nITTEE EQ                                                               ; +0xae, 0x4882ae\nSTRBEQ.W        R3, [SP,#0x20+var_1C+1]                                ; +0xb0, 0x4882b0\nSTRBEQ.W        R3, [SP,#0x20+var_1C]                                  ; +0xb4, 0x4882b4\nLDRNE           R2, [SP,#0x20+var_14]                                  ; +0xb8, 0x4882b8\nMOVNE           R3, #0                                                 ; +0xba, 0x4882ba\nITT NE                                                                 ; +0xbc, 0x4882bc\nSTRBNE          R3, [R2]                                               ; +0xbe, 0x4882be\nSTRNE           R3, [SP,#0x20+var_18]                                  ; +0xc0, 0x4882c0\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj; std::string::reserve(uint) ; +0xc2, 0x4882c2\nLDM.W           R7, {R0-R2}                                            ; +0xc6, 0x4882c6\nMOVS            R3, #0                                                 ; +0xca, 0x4882ca\nSTR             R3, [SP,#0x20+var_10]                                  ; +0xcc, 0x4882cc\nSTR             R3, [SP,#0x20+var_C]                                   ; +0xce, 0x4882ce\nSTR             R3, [SP,#0x20+var_8]                                   ; +0xd0, 0x4882d0\nSTM.W           R4, {R0-R2}                                            ; +0xd2, 0x4882d2\nMOV             R0, R7                                                 ; +0xd6, 0x4882d6\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xd8, 0x4882d8\nLDRB.W          R3, [SP,#0x20+var_1C]                                  ; +0xdc, 0x4882dc\nLDR.W           R0, [R8,#0x370]; this                                  ; +0xe0, 0x4882e0\nLSLS            R3, R3, #0x1F                                          ; +0xe4, 0x4882e4\nITE PL                                                                 ; +0xe6, 0x4882e6\nADDPL.W         R1, SP, #0x20+var_1C+1                                 ; +0xe8, 0x4882e8\nLDRMI           R1, [SP,#0x20+var_14]; char *                          ; +0xec, 0x4882ec\nBL              _ZN12ButtonSprite9setStringEPKc; ButtonSprite::setString(char const*) ; +0xee, 0x4882ee\nMOV             R0, R4                                                 ; +0xf2, 0x4882f2\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xf4, 0x4882f4\nB               loc_488304                                             ; +0xf8, 0x4882f8\nMOV             R0, R4                                                 ; +0xfa, 0x4882fa\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xfc, 0x4882fc\nBL              __cxa_end_cleanup                                      ; +0x100, 0x488300\nLDR             R2, [SP,#0x20+var_4]                                   ; +0x104, 0x488304\nLDR             R3, [R5]                                               ; +0x106, 0x488306\nCMP             R2, R3                                                 ; +0x108, 0x488308\nBEQ             loc_488310                                             ; +0x10a, 0x48830a\nBLX             __stack_chk_fail                                       ; +0x10c, 0x48830c\nADD             SP, SP, #0x20 ; ' '                                    ; +0x110, 0x488310\nPOP.W           {R4-R8,PC}                                             ; +0x112, 0x488312", "xrefs": ["`non-virtual thunk to'EditorUI::setIDPopupClosed @ 0x488330"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}