{"type": "func", "start": 7888248, "end": 7888644, "name": "EditorSoundConfigInfoLayer::applyConfig", "pseudocode": "// \n// EditorSoundConfigInfoLayer::applyConfig from 0x785d78 to 0x785f04 (396 bytes)\n// \n// 1 xrefs:\n// > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x788a66\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:32 +0000\n// \n\nint *__fastcall EditorSoundConfigInfoLayer::applyConfig(int *this, int a2, int a3)\n{\n  int v4; // r2\n  int *v5; // r6\n  cocos2d::CCArray **v7; // r0\n  int v8; // r0\n  int v9; // r3\n  const char *v10; // r9\n  size_t v11; // r0\n  int *v12; // r0\n  const char *v13; // r10\n  size_t v14; // r0\n  int *v15; // r0\n  EditorSFXManager *v16; // r0\n  int v17; // [sp+8h] [bp-28h] BYREF\n  int v18; // [sp+Ch] [bp-24h]\n  int v19; // [sp+10h] [bp-20h]\n  int v20[3]; // [sp+14h] [bp-1Ch] BYREF\n  char v21[4]; // [sp+20h] [bp-10h] BYREF\n  int v22; // [sp+24h] [bp-Ch]\n  const char *v23; // [sp+28h] [bp-8h]\n\n  v4 = *(this + 187);\n  v5 = this;\n  if ( v4 )\n  {\n    v17 = 0;\n    v18 = 0;\n    v19 = 0;\n    if ( *(this + 188) == 2 && *(int *)(v4 + 268) > 0 )\n    {\n      v7 = (cocos2d::CCArray **)EditorSFXManager::sharedState((EditorSFXManager *)this);\n      v8 = EditorSFXManager::applyMyConfig(v7, *(_DWORD *)(v5[187] + 268), a2, &v17);\n    }\n    else\n    {\n      v16 = (EditorSFXManager *)EditorSFXManager::sharedState((EditorSFXManager *)this);\n      v8 = EditorSFXManager::applyConfigDirect(v16, v5[187], a2, &v17);\n    }\n    if ( v8 )\n    {\n      if ( a2 )\n        v13 = \"Sound pack merged into your current sounds.\";\n      else\n        v13 = \"Current sounds replaced with this pack.\";\n      *(_DWORD *)v21 = 0;\n      v22 = 0;\n      v23 = nullptr;\n      v14 = strlen(v13);\n      std::string::__init((int *)v21, v13, v14);\n      v15 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)\"Applied\", (int)v21, (ButtonSprite *)\"OK\", nullptr);\n      (*(void (__fastcall **)(int *))(*v15 + 656))(v15);\n      std::string::~string((int)v21);\n      if ( a3 )\n        (*(void (__fastcall **)(int *, _DWORD))(*v5 + 684))(v5, 0);\n    }\n    else\n    {\n      if ( (v17 & 1) != 0 )\n        v9 = v18;\n      else\n        v9 = (int)(unsigned __int8)v17 >> 1;\n      if ( v9 )\n      {\n        std::string::basic_string((int *)v21, (int)&v17);\n      }\n      else\n      {\n        *(_DWORD *)v21 = 0;\n        v22 = 0;\n        v23 = nullptr;\n        std::string::__init((int *)v21, \"Failed to apply sound pack.\", 0x1Bu);\n      }\n      if ( (v21[0] & 1) != 0 )\n        v10 = v23;\n      else\n        v10 = &v21[1];\n      memset(v20, 0, sizeof(v20));\n      v11 = strlen(v10);\n      std::string::__init(v20, v10, v11);\n      v12 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)\"Error\", (int)v20, (ButtonSprite *)\"OK\", nullptr);\n      (*(void (__fastcall **)(int *))(*v12 + 656))(v12);\n      std::string::~string((int)v20);\n      std::string::~string((int)v21);\n    }\n    return (int *)std::string::~string((int)&v17);\n  }\n  return this;\n}", "assembly": "; \n; EditorSoundConfigInfoLayer::applyConfig from 0x785d78 to 0x785f04 (396 bytes)\n; \n; 1 xrefs:\n; > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x788a66\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:32 +0000\n; \nPUSH.W          {R4-R10,LR}                                            ; +0x0, 0x785d78\nMOV             R9, R2                                                 ; +0x4, 0x785d7c\nLDR             R5, =(__stack_chk_guard_ptr - 0x785D8C)                ; +0x6, 0x785d7e\nSUB             SP, SP, #0x30                                          ; +0x8, 0x785d80\nLDR.W           R2, [R0,#0x2EC]                                        ; +0xa, 0x785d82\nMOV             R6, R0                                                 ; +0xe, 0x785d86\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x10, 0x785d88\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x12, 0x785d8a\nMOV             R8, R1                                                 ; +0x14, 0x785d8c\nLDR             R3, [R5]                                               ; +0x16, 0x785d8e\nSTR             R3, [SP,#0x30+var_4]                                   ; +0x18, 0x785d90\nCMP             R2, #0                                                 ; +0x1a, 0x785d92\nBEQ.W           loc_785EF2                                             ; +0x1c, 0x785d94\nMOVS            R3, #0                                                 ; +0x20, 0x785d98\nSTR             R3, [SP,#0x30+var_28]                                  ; +0x22, 0x785d9a\nSTR             R3, [SP,#0x30+var_24]                                  ; +0x24, 0x785d9c\nADD             R7, SP, #0x30+var_28                                   ; +0x26, 0x785d9e\nSTR             R3, [SP,#0x30+var_20]                                  ; +0x28, 0x785da0\nLDR.W           R3, [R0,#0x2F0]                                        ; +0x2a, 0x785da2\nCMP             R3, #2                                                 ; +0x2e, 0x785da6\nBNE.W           loc_785EE0                                             ; +0x30, 0x785da8\nLDR.W           R3, [R2,#0x10C]                                        ; +0x34, 0x785dac\nCMP             R3, #0                                                 ; +0x38, 0x785db0\nBLE.W           loc_785EE0                                             ; +0x3a, 0x785db2\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x3e, 0x785db6\nB               loc_785DC6                                             ; +0x42, 0x785dba\nMOV             R0, R7                                                 ; +0x44, 0x785dbc\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x46, 0x785dbe\nBL              __cxa_end_cleanup                                      ; +0x4a, 0x785dc2\nLDR.W           R3, [R6,#0x2EC]                                        ; +0x4e, 0x785dc6\nMOV             R2, R8                                                 ; +0x52, 0x785dca\nLDR.W           R1, [R3,#0x10C]                                        ; +0x54, 0x785dcc\nMOV             R3, R7                                                 ; +0x58, 0x785dd0\nBL              _ZN16EditorSFXManager13applyMyConfigEibPNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE; EditorSFXManager::applyMyConfig(int,bool,std::string *) ; +0x5a, 0x785dd2\nADD             R4, SP, #0x30+var_10                                   ; +0x5e, 0x785dd6\nCMP             R0, #0                                                 ; +0x60, 0x785dd8\nBNE             loc_785E5C                                             ; +0x62, 0x785dda\nLDRB.W          R3, [SP,#0x30+var_28]                                  ; +0x64, 0x785ddc\nLSLS            R2, R3, #0x1F                                          ; +0x68, 0x785de0\nITE PL                                                                 ; +0x6a, 0x785de2\nASRPL           R3, R3, #1                                             ; +0x6c, 0x785de4\nLDRMI           R3, [SP,#0x30+var_24]                                  ; +0x6e, 0x785de6\nCBNZ            R3, loc_785E0A                                         ; +0x70, 0x785de8\nLDR             R1, =(aFailedToApplyS - 0x785DF6); \"Failed to apply sound pack.\" ; +0x72, 0x785dea\nMOV             R0, R4                                                 ; +0x74, 0x785dec\nMOVS            R2, #0x1B                                              ; +0x76, 0x785dee\nSTR             R3, [SP,#0x30+var_10]                                  ; +0x78, 0x785df0\nADD             R1, PC; \"Failed to apply sound pack.\"                  ; +0x7a, 0x785df2\nSTR             R3, [SP,#0x30+var_C]                                   ; +0x7c, 0x785df4\nSTR             R3, [SP,#0x30+var_8]                                   ; +0x7e, 0x785df6\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x80, 0x785df8\nLDRB.W          R3, [SP,#0x30+var_10]                                  ; +0x84, 0x785dfc\nLSLS            R3, R3, #0x1F                                          ; +0x88, 0x785e00\nBMI             loc_785E14                                             ; +0x8a, 0x785e02\nADD.W           R9, SP, #0x30+var_10+1                                 ; +0x8c, 0x785e04\nB               loc_785E18                                             ; +0x90, 0x785e08\nMOV             R0, R4                                                 ; +0x92, 0x785e0a\nMOV             R1, R7                                                 ; +0x94, 0x785e0c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_; std::string::basic_string(std::string const&) ; +0x96, 0x785e0e\nB               loc_785DFC                                             ; +0x9a, 0x785e12\nLDR.W           R9, [SP,#0x30+var_8]                                   ; +0x9c, 0x785e14\nMOV             R0, R9; char *                                         ; +0xa0, 0x785e18\nMOVS            R6, #0                                                 ; +0xa2, 0x785e1a\nSTR             R6, [SP,#0x30+var_1C]                                  ; +0xa4, 0x785e1c\nADD.W           R8, SP, #0x30+var_1C                                   ; +0xa6, 0x785e1e\nSTR             R6, [SP,#0x30+var_18]                                  ; +0xaa, 0x785e22\nSTR             R6, [SP,#0x30+var_14]                                  ; +0xac, 0x785e24\nBLX             strlen                                                 ; +0xae, 0x785e26\nMOV             R1, R9                                                 ; +0xb2, 0x785e2a\nMOV             R2, R0                                                 ; +0xb4, 0x785e2c\nMOV             R0, R8                                                 ; +0xb6, 0x785e2e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xb8, 0x785e30\nLDR             R1, =(aError - 0x785E42); \"Error\"                      ; +0xbc, 0x785e34\nMOV             R0, R6                                                 ; +0xbe, 0x785e36\nLDR             R3, =(aOk - 0x785E44); \"OK\"                            ; +0xc0, 0x785e38\nMOV             R2, R8                                                 ; +0xc2, 0x785e3a\nSTR             R6, [SP,#0x30+var_30]                                  ; +0xc4, 0x785e3c\nADD             R1, PC; \"Error\"                                        ; +0xc6, 0x785e3e\nADD             R3, PC; \"OK\"                                           ; +0xc8, 0x785e40\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0xca, 0x785e42\nLDR             R3, [R0]                                               ; +0xce, 0x785e46\nLDR.W           R3, [R3,#0x290]                                        ; +0xd0, 0x785e48\nBLX             R3                                                     ; +0xd4, 0x785e4c\nMOV             R0, R8                                                 ; +0xd6, 0x785e4e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xd8, 0x785e50\nMOV             R0, R4                                                 ; +0xdc, 0x785e54\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xde, 0x785e56\nB               loc_785EB8                                             ; +0xe2, 0x785e5a\nCMP.W           R8, #0                                                 ; +0xe4, 0x785e5c\nBNE             loc_785E6A                                             ; +0xe8, 0x785e60\nLDR.W           R10, =(aCurrentSoundsR - 0x785E6A); \"Current sounds replaced with this pack.\" ; +0xea, 0x785e62\nADD             R10, PC; \"Current sounds replaced with this pack.\"     ; +0xee, 0x785e66\nB               loc_785E70                                             ; +0xf0, 0x785e68\nLDR.W           R10, =(aSoundPackMerge - 0x785E72); \"Sound pack merged into your current sou\"... ; +0xf2, 0x785e6a\nADD             R10, PC; \"Sound pack merged into your current sou\"...  ; +0xf6, 0x785e6e\nMOV             R0, R10; char *                                        ; +0xf8, 0x785e70\nMOV.W           R8, #0                                                 ; +0xfa, 0x785e72\nSTR.W           R8, [SP,#0x30+var_10]                                  ; +0xfe, 0x785e76\nSTR.W           R8, [SP,#0x30+var_C]                                   ; +0x102, 0x785e7a\nSTR.W           R8, [SP,#0x30+var_8]                                   ; +0x106, 0x785e7e\nBLX             strlen                                                 ; +0x10a, 0x785e82\nMOV             R1, R10                                                ; +0x10e, 0x785e86\nMOV             R2, R0                                                 ; +0x110, 0x785e88\nMOV             R0, R4                                                 ; +0x112, 0x785e8a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x114, 0x785e8c\nLDR             R1, =(aApplied - 0x785EA0); \"Applied\"                  ; +0x118, 0x785e90\nMOV             R0, R8                                                 ; +0x11a, 0x785e92\nLDR             R3, =(aOk - 0x785EA2); \"OK\"                            ; +0x11c, 0x785e94\nMOV             R2, R4                                                 ; +0x11e, 0x785e96\nSTR.W           R8, [SP,#0x30+var_30]                                  ; +0x120, 0x785e98\nADD             R1, PC; \"Applied\"                                      ; +0x124, 0x785e9c\nADD             R3, PC; \"OK\"                                           ; +0x126, 0x785e9e\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0x128, 0x785ea0\nLDR             R3, [R0]                                               ; +0x12c, 0x785ea4\nLDR.W           R3, [R3,#0x290]                                        ; +0x12e, 0x785ea6\nBLX             R3                                                     ; +0x132, 0x785eaa\nMOV             R0, R4                                                 ; +0x134, 0x785eac\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x136, 0x785eae\nCMP.W           R9, #0                                                 ; +0x13a, 0x785eb2\nBNE             loc_785EC0                                             ; +0x13e, 0x785eb6\nMOV             R0, R7                                                 ; +0x140, 0x785eb8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x142, 0x785eba\nB               loc_785EF2                                             ; +0x146, 0x785ebe\nLDR             R3, [R6]                                               ; +0x148, 0x785ec0\nMOV             R0, R6                                                 ; +0x14a, 0x785ec2\nMOVS            R1, #0                                                 ; +0x14c, 0x785ec4\nLDR.W           R3, [R3,#0x2AC]                                        ; +0x14e, 0x785ec6\nBLX             R3                                                     ; +0x152, 0x785eca\nB               loc_785EB8                                             ; +0x154, 0x785ecc\nMOV             R0, R8                                                 ; +0x156, 0x785ece\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x158, 0x785ed0\nB               loc_785ED8                                             ; +0x15c, 0x785ed4\nB               loc_785ED8                                             ; +0x15e, 0x785ed6\nMOV             R0, R4                                                 ; +0x160, 0x785ed8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x162, 0x785eda\nB               loc_785DBC                                             ; +0x166, 0x785ede\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x168, 0x785ee0\nLDR.W           R1, [R6,#0x2EC]; int                                   ; +0x16c, 0x785ee4\nMOV             R2, R8; int                                            ; +0x170, 0x785ee8\nMOV             R3, R7; int                                            ; +0x172, 0x785eea\nBL              _ZN16EditorSFXManager17applyConfigDirectEP19GJEditorSoundConfigbPNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE; EditorSFXManager::applyConfigDirect(GJEditorSoundConfig *,bool,std::string *) ; +0x174, 0x785eec\nB               loc_785DD6                                             ; +0x178, 0x785ef0\nLDR             R2, [SP,#0x30+var_4]                                   ; +0x17a, 0x785ef2\nLDR             R3, [R5]                                               ; +0x17c, 0x785ef4\nCMP             R2, R3                                                 ; +0x17e, 0x785ef6\nBEQ             loc_785EFE                                             ; +0x180, 0x785ef8\nBLX             __stack_chk_fail                                       ; +0x182, 0x785efa\nADD             SP, SP, #0x30 ; '0'                                    ; +0x186, 0x785efe\nPOP.W           {R4-R10,PC}                                            ; +0x188, 0x785f00", "xrefs": ["EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x788a66"], "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"}