{"type": "func", "start": 7878024, "end": 7878442, "name": "EditorSoundBrowserLayer::setTextPopupClosed", "pseudocode": "// \n// EditorSoundBrowserLayer::setTextPopupClosed from 0x783588 to 0x78372a (418 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'EditorSoundBrowserLayer::setTextPopupClosed @ 0x78374c\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:59:30 +0000\n// \n\nEditorSFXManager *__fastcall EditorSoundBrowserLayer::setTextPopupClosed(int a1, int a2, unsigned __int8 *a3)\n{\n  int v4; // r2\n  int v6; // r8\n  int v7; // r3\n  EditorSFXManager *result; // r0\n  int v9; // r2\n  unsigned __int8 *v10; // r4\n  int v11; // r4\n  _BYTE *v12; // r2\n  int v13; // r4\n  EditorSFXManager *v14; // r3\n  int v15; // r1\n  size_t v16; // r4\n  int v17; // r2\n  int v18; // r3\n  int v19; // r3\n  int v20; // r4\n  int *v21; // r0\n  EditorSFXManager *v22; // r0\n  int *v23; // r0\n  int v24; // r0\n  EditorSoundBrowserLayer *v25; // r0\n  int v26; // r1\n  int v27; // r4\n  int v28; // [sp+8h] [bp-14h] BYREF\n  int v29; // [sp+Ch] [bp-10h]\n  int v30; // [sp+10h] [bp-Ch]\n  int v31; // [sp+14h] [bp-8h]\n\n  v4 = _stack_chk_guard;\n  v6 = *(_DWORD *)(a1 + 800);\n  *(_DWORD *)(a1 + 800) = 0;\n  v31 = v4;\n  while ( 1 )\n  {\n    v7 = *a3;\n    result = (EditorSFXManager *)(v7 & 1);\n    if ( (v7 & 1) != 0 )\n    {\n      v9 = *((_DWORD *)a3 + 1);\n      if ( !v9 )\n        break;\n      v10 = *((unsigned __int8 **)a3 + 2);\n    }\n    else\n    {\n      v9 = v7 >> 1;\n      if ( !(v7 >> 1) )\n        break;\n      v10 = a3 + 1;\n    }\n    if ( v10[v9 - 1] != 32 )\n      break;\n    if ( (v7 & 1) != 0 )\n    {\n      v17 = *((_DWORD *)a3 + 2);\n      v18 = *((_DWORD *)a3 + 1) - 1;\n      *((_DWORD *)a3 + 1) = v18;\n      *(_BYTE *)(v17 + v18) = 0;\n    }\n    else\n    {\n      v19 = (v7 >> 1) - 1;\n      *a3 = 2 * v19;\n      a3[v19 + 1] = 0;\n    }\n  }\n  while ( 1 )\n  {\n    v11 = *a3;\n    if ( (v11 & 1) == 0 )\n      break;\n    if ( !*((_DWORD *)a3 + 1) )\n    {\n      if ( v6 == 1 )\n      {\nLABEL_30:\n        v20 = *((_DWORD *)a3 + 1);\n        goto LABEL_33;\n      }\n      if ( v6 == 2 )\n        goto LABEL_42;\n      return result;\n    }\n    v12 = *((_BYTE **)a3 + 2);\nLABEL_13:\n    if ( *v12 != 32 )\n    {\n      if ( v6 == 1 )\n      {\n        if ( (v11 & 1) != 0 )\n          goto LABEL_30;\nLABEL_32:\n        v20 = v11 >> 1;\nLABEL_33:\n        if ( !v20 )\n        {\n          v28 = 0;\n          v29 = 0;\n          v30 = 0;\n          std::string::__init(&v28, \"Please enter a name.\", 0x14u);\n          v21 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)\"Error\", (int)&v28, (ButtonSprite *)\"OK\", nullptr);\n          (*(void (__fastcall **)(int *))(*v21 + 656))(v21);\n          return (EditorSFXManager *)std::string::~string((int)&v28);\n        }\n        v22 = (EditorSFXManager *)EditorSFXManager::sharedState(result);\n        if ( !v22 || (v24 = EditorSFXManager::sharedState(v22), !EditorSFXManager::createMyConfigFromLive(v24, (int)a3)) )\n        {\n          v28 = 0;\n          v29 = 0;\n          v30 = 0;\n          std::string::__init(&v28, \"You already have 50 sound packs. Delete some first.\", 0x33u);\n          v23 = FLAlertLayer::create(\n                  0,\n                  (cocos2d::CCLabelBMFont *)\"Limit Reached\",\n                  (int)&v28,\n                  (ButtonSprite *)\"OK\",\n                  nullptr);\n          (*(void (__fastcall **)(int *))(*v23 + 656))(v23);\n          return (EditorSFXManager *)std::string::~string((int)&v28);\n        }\n        v25 = (EditorSoundBrowserLayer *)a1;\n        v26 = 1;\n        return (EditorSFXManager *)EditorSoundBrowserLayer::setMode(v25, v26);\n      }\n      if ( v6 != 2 )\n        return result;\n      if ( (v11 & 1) != 0 )\n      {\nLABEL_42:\n        v27 = *((_DWORD *)a3 + 1);\nLABEL_45:\n        if ( !v27 )\n          return result;\n        std::string::operator=((unsigned __int8 *)(a1 + 768), a3);\n        v25 = (EditorSoundBrowserLayer *)a1;\n        v26 = 9;\n        return (EditorSFXManager *)EditorSoundBrowserLayer::setMode(v25, v26);\n      }\nLABEL_44:\n      v27 = v11 >> 1;\n      goto LABEL_45;\n    }\n    if ( (v11 & 1) != 0 )\n    {\n      v13 = *((_DWORD *)a3 + 1);\n      v14 = *((EditorSFXManager **)a3 + 2);\n    }\n    else\n    {\n      v13 = v11 >> 1;\n      v14 = (EditorSFXManager *)(a3 + 1);\n    }\n    v15 = v13;\n    if ( v13 )\n      v15 = 1;\n    v16 = v13 - v15;\n    if ( v16 )\n    {\n      result = (EditorSFXManager *)memmove(v14, (char *)v14 + v15, v16);\n      v14 = result;\n    }\n    if ( (*a3 & 1) != 0 )\n      *((_DWORD *)a3 + 1) = v16;\n    else\n      *a3 = 2 * v16;\n    *((_BYTE *)v14 + v16) = 0;\n  }\n  if ( (unsigned int)v11 >> 1 )\n  {\n    v12 = a3 + 1;\n    goto LABEL_13;\n  }\n  if ( v6 == 1 )\n    goto LABEL_32;\n  if ( v6 == 2 )\n    goto LABEL_44;\n  return result;\n}", "assembly": "; \n; EditorSoundBrowserLayer::setTextPopupClosed from 0x783588 to 0x78372a (418 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'EditorSoundBrowserLayer::setTextPopupClosed @ 0x78374c\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:59:30 +0000\n; \nLDR             R3, =(__stack_chk_guard_ptr - 0x783594)                ; +0x0, 0x783588\nMOVS            R1, #0                                                 ; +0x2, 0x78358a\nPUSH.W          {R4-R9,LR}                                             ; +0x4, 0x78358c\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x8, 0x783590\nLDR             R3, [R3]; __stack_chk_guard                            ; +0xa, 0x783592\nMOV             R5, R2                                                 ; +0xc, 0x783594\nSUB             SP, SP, #0x1C                                          ; +0xe, 0x783596\nLDR             R2, [R3]                                               ; +0x10, 0x783598\nMOV             R7, R0                                                 ; +0x12, 0x78359a\nMOV             R6, R3                                                 ; +0x14, 0x78359c\nLDR.W           R8, [R0,#0x320]                                        ; +0x16, 0x78359e\nSTR.W           R1, [R0,#0x320]                                        ; +0x1a, 0x7835a2\nSTR             R2, [SP,#0x1C+var_8]                                   ; +0x1e, 0x7835a6\nLDRB            R3, [R5]                                               ; +0x20, 0x7835a8\nANDS.W          R0, R3, #1; this                                       ; +0x22, 0x7835aa\nBEQ             loc_7835B8                                             ; +0x26, 0x7835ae\nLDR             R2, [R5,#4]                                            ; +0x28, 0x7835b0\nCBZ             R2, loc_7835C8                                         ; +0x2a, 0x7835b2\nLDR             R4, [R5,#8]                                            ; +0x2c, 0x7835b4\nB               loc_7835BE                                             ; +0x2e, 0x7835b6\nASRS            R2, R3, #1                                             ; +0x30, 0x7835b8\nBEQ             loc_7835C8                                             ; +0x32, 0x7835ba\nADDS            R4, R5, #1                                             ; +0x34, 0x7835bc\nADD             R2, R4                                                 ; +0x36, 0x7835be\nLDRB.W          R2, [R2,#-1]                                           ; +0x38, 0x7835c0\nCMP             R2, #0x20 ; ' '                                        ; +0x3c, 0x7835c4\nBEQ             loc_783620                                             ; +0x3e, 0x7835c6\nMOV.W           R9, #0                                                 ; +0x40, 0x7835c8\nLDRB            R4, [R5]                                               ; +0x44, 0x7835cc\nANDS.W          R3, R4, #1                                             ; +0x46, 0x7835ce\nBEQ             loc_7835E0                                             ; +0x4a, 0x7835d2\nLDR             R2, [R5,#4]                                            ; +0x4c, 0x7835d4\nCMP             R2, #0                                                 ; +0x4e, 0x7835d6\nBEQ.W           loc_78370C                                             ; +0x50, 0x7835d8\nLDR             R2, [R5,#8]                                            ; +0x54, 0x7835dc\nB               loc_7835E6                                             ; +0x56, 0x7835de\nLSRS            R2, R4, #1                                             ; +0x58, 0x7835e0\nBEQ             loc_783648                                             ; +0x5a, 0x7835e2\nADDS            R2, R5, #1                                             ; +0x5c, 0x7835e4\nLDRB            R2, [R2]                                               ; +0x5e, 0x7835e6\nCMP             R2, #0x20 ; ' '                                        ; +0x60, 0x7835e8\nBNE             loc_78363C                                             ; +0x62, 0x7835ea\nCBZ             R3, loc_7835F4                                         ; +0x64, 0x7835ec\nLDR             R4, [R5,#4]                                            ; +0x66, 0x7835ee\nLDR             R3, [R5,#8]                                            ; +0x68, 0x7835f0\nB               loc_7835F8                                             ; +0x6a, 0x7835f2\nASRS            R4, R4, #1                                             ; +0x6c, 0x7835f4\nADDS            R3, R5, #1                                             ; +0x6e, 0x7835f6\nMOVS            R1, R4                                                 ; +0x70, 0x7835f8\nIT NE                                                                  ; +0x72, 0x7835fa\nMOVNE           R1, #1                                                 ; +0x74, 0x7835fc\nSUBS            R4, R4, R1                                             ; +0x76, 0x7835fe\nBEQ             loc_78360E                                             ; +0x78, 0x783600\nMOV             R0, R3; void *                                         ; +0x7a, 0x783602\nADD             R1, R3; void *                                         ; +0x7c, 0x783604\nMOV             R2, R4; size_t                                         ; +0x7e, 0x783606\nBLX             memmove                                                ; +0x80, 0x783608\nMOV             R3, R0                                                 ; +0x84, 0x78360c\nLDRB            R2, [R5]                                               ; +0x86, 0x78360e\nLSLS            R2, R2, #0x1F                                          ; +0x88, 0x783610\nITEE MI                                                                ; +0x8a, 0x783612\nSTRMI           R4, [R5,#4]                                            ; +0x8c, 0x783614\nLSLPL           R2, R4, #1                                             ; +0x8e, 0x783616\nSTRBPL          R2, [R5]                                               ; +0x90, 0x783618\nSTRB.W          R9, [R3,R4]                                            ; +0x92, 0x78361a\nB               loc_7835CC                                             ; +0x96, 0x78361e\nCBZ             R0, loc_78362E                                         ; +0x98, 0x783620\nLDR             R3, [R5,#4]                                            ; +0x9a, 0x783622\nLDR             R2, [R5,#8]                                            ; +0x9c, 0x783624\nSUBS            R3, #1                                                 ; +0x9e, 0x783626\nSTR             R3, [R5,#4]                                            ; +0xa0, 0x783628\nSTRB            R1, [R2,R3]                                            ; +0xa2, 0x78362a\nB               loc_7835A8                                             ; +0xa4, 0x78362c\nASRS            R3, R3, #1                                             ; +0xa6, 0x78362e\nSUBS            R3, #1                                                 ; +0xa8, 0x783630\nLSLS            R2, R3, #1                                             ; +0xaa, 0x783632\nADD             R3, R5                                                 ; +0xac, 0x783634\nSTRB            R2, [R5]                                               ; +0xae, 0x783636\nSTRB            R0, [R3,#1]                                            ; +0xb0, 0x783638\nB               loc_7835A8                                             ; +0xb2, 0x78363a\nCMP.W           R8, #1                                                 ; +0xb4, 0x78363c\nBNE             loc_7836D6                                             ; +0xb8, 0x783640\nCBZ             R3, loc_78364E                                         ; +0xba, 0x783642\nLDR             R4, [R5,#4]                                            ; +0xbc, 0x783644\nB               loc_783650                                             ; +0xbe, 0x783646\nCMP.W           R8, #1                                                 ; +0xc0, 0x783648\nBNE             loc_7836E2                                             ; +0xc4, 0x78364c\nASRS            R4, R4, #1                                             ; +0xc6, 0x78364e\nCBNZ            R4, loc_783682                                         ; +0xc8, 0x783650\nADD             R5, SP, #0x1C+var_14                                   ; +0xca, 0x783652\nLDR             R1, =(aPleaseEnterANa - 0x783660); \"Please enter a name.\" ; +0xcc, 0x783654\nMOVS            R2, #0x14                                              ; +0xce, 0x783656\nSTR             R4, [SP,#0x1C+var_14]                                  ; +0xd0, 0x783658\nMOV             R0, R5                                                 ; +0xd2, 0x78365a\nADD             R1, PC; \"Please enter a name.\"                         ; +0xd4, 0x78365c\nSTR             R4, [SP,#0x1C+var_10]                                  ; +0xd6, 0x78365e\nSTR             R4, [SP,#0x1C+var_C]                                   ; +0xd8, 0x783660\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xda, 0x783662\nLDR             R1, =(aError - 0x783674); \"Error\"                      ; +0xde, 0x783666\nMOV             R0, R4                                                 ; +0xe0, 0x783668\nLDR             R3, =(aOk - 0x783676); \"OK\"                            ; +0xe2, 0x78366a\nMOV             R2, R5                                                 ; +0xe4, 0x78366c\nSTR             R4, [SP,#0x1C+var_1C]                                  ; +0xe6, 0x78366e\nADD             R1, PC; \"Error\"                                        ; +0xe8, 0x783670\nADD             R3, PC; \"OK\"                                           ; +0xea, 0x783672\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0xec, 0x783674\nLDR             R3, [R0]                                               ; +0xf0, 0x783678\nLDR.W           R3, [R3,#0x290]                                        ; +0xf2, 0x78367a\nBLX             R3                                                     ; +0xf6, 0x78367e\nB               loc_7836CE                                             ; +0xf8, 0x783680\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0xfa, 0x783682\nCBNZ            R0, loc_7836BA                                         ; +0xfe, 0x783686\nADD             R5, SP, #0x1C+var_14                                   ; +0x100, 0x783688\nLDR             R1, =(aYouAlreadyHave - 0x783696); \"You already have 50 sound packs. Delete\"... ; +0x102, 0x78368a\nMOVS            R2, #0x33 ; '3'                                        ; +0x104, 0x78368c\nMOVS            R4, #0                                                 ; +0x106, 0x78368e\nMOV             R0, R5                                                 ; +0x108, 0x783690\nADD             R1, PC; \"You already have 50 sound packs. Delete\"...   ; +0x10a, 0x783692\nSTR             R4, [SP,#0x1C+var_14]                                  ; +0x10c, 0x783694\nSTR             R4, [SP,#0x1C+var_10]                                  ; +0x10e, 0x783696\nSTR             R4, [SP,#0x1C+var_C]                                   ; +0x110, 0x783698\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x112, 0x78369a\nLDR             R1, =(aLimitReached - 0x7836AC); \"Limit Reached\"       ; +0x116, 0x78369e\nMOV             R0, R4                                                 ; +0x118, 0x7836a0\nLDR             R3, =(aOk - 0x7836AE); \"OK\"                            ; +0x11a, 0x7836a2\nMOV             R2, R5                                                 ; +0x11c, 0x7836a4\nSTR             R4, [SP,#0x1C+var_1C]                                  ; +0x11e, 0x7836a6\nADD             R1, PC; \"Limit Reached\"                                ; +0x120, 0x7836a8\nADD             R3, PC; \"OK\"                                           ; +0x122, 0x7836aa\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0x124, 0x7836ac\nLDR             R3, [R0]                                               ; +0x128, 0x7836b0\nLDR.W           R3, [R3,#0x290]                                        ; +0x12a, 0x7836b2\nBLX             R3                                                     ; +0x12e, 0x7836b6\nB               loc_7836CE                                             ; +0x130, 0x7836b8\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x132, 0x7836ba\nMOV             R1, R5                                                 ; +0x136, 0x7836be\nBL              _ZN16EditorSFXManager22createMyConfigFromLiveERKNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE; EditorSFXManager::createMyConfigFromLive(std::string const&) ; +0x138, 0x7836c0\nCMP             R0, #0                                                 ; +0x13c, 0x7836c4\nBEQ             loc_783688                                             ; +0x13e, 0x7836c6\nMOV             R0, R7                                                 ; +0x140, 0x7836c8\nMOVS            R1, #1                                                 ; +0x142, 0x7836ca\nB               loc_7836FA                                             ; +0x144, 0x7836cc\nMOV             R0, R5                                                 ; +0x146, 0x7836ce\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x148, 0x7836d0\nB               loc_783718                                             ; +0x14c, 0x7836d4\nCMP.W           R8, #2                                                 ; +0x14e, 0x7836d6\nBNE             loc_783718                                             ; +0x152, 0x7836da\nCBZ             R3, loc_7836E8                                         ; +0x154, 0x7836dc\nLDR             R4, [R5,#4]                                            ; +0x156, 0x7836de\nB               loc_7836EA                                             ; +0x158, 0x7836e0\nCMP.W           R8, #2                                                 ; +0x15a, 0x7836e2\nBNE             loc_783718                                             ; +0x15e, 0x7836e6\nASRS            R4, R4, #1                                             ; +0x160, 0x7836e8\nCBZ             R4, loc_783718                                         ; +0x162, 0x7836ea\nMOV             R1, R5                                                 ; +0x164, 0x7836ec\nADD.W           R0, R7, #0x300                                         ; +0x166, 0x7836ee\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_; std::string::operator=(std::string const&) ; +0x16a, 0x7836f2\nMOV             R0, R7; this                                           ; +0x16e, 0x7836f6\nMOVS            R1, #9                                                 ; +0x170, 0x7836f8\nBL              _ZN23EditorSoundBrowserLayer7setModeE21EditorSoundBrowseMode; EditorSoundBrowserLayer::setMode(EditorSoundBrowseMode) ; +0x172, 0x7836fa\nB               loc_783718                                             ; +0x176, 0x7836fe\nB               loc_783702                                             ; +0x178, 0x783700\nMOV             R0, R5                                                 ; +0x17a, 0x783702\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x17c, 0x783704\nBL              __cxa_end_cleanup                                      ; +0x180, 0x783708\nCMP.W           R8, #1                                                 ; +0x184, 0x78370c\nBEQ             loc_783644                                             ; +0x188, 0x783710\nCMP.W           R8, #2                                                 ; +0x18a, 0x783712\nBEQ             loc_7836DE                                             ; +0x18e, 0x783716\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x190, 0x783718\nLDR             R3, [R6]                                               ; +0x192, 0x78371a\nCMP             R2, R3                                                 ; +0x194, 0x78371c\nBEQ             loc_783724                                             ; +0x196, 0x78371e\nBLX             __stack_chk_fail                                       ; +0x198, 0x783720\nADD             SP, SP, #0x1C                                          ; +0x19c, 0x783724\nPOP.W           {R4-R9,PC}                                             ; +0x19e, 0x783726", "xrefs": ["`non-virtual thunk to'EditorSoundBrowserLayer::setTextPopupClosed @ 0x78374c"], "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"}