{"type": "func", "start": 6854076, "end": 6854432, "name": "EditorUI::showMaxError", "pseudocode": "// \n// EditorUI::showMaxError from 0x6895bc to 0x689720 (356 bytes)\n// \n// 5 xrefs:\n// > LevelEditorLayer::createObjectsFromString @ 0x671b78\n// > EditorUI::onCreate @ 0x6c0518\n// > EditorUI::doPasteObjects @ 0x6c384c\n// > EditorUI::onDuplicate @ 0x6c4f18\n// > <???> @ 0x3de48\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\nvoid EditorUI::showMaxError(EditorUI *a1)\n{\n  int v1; // w20\n  cocos2d::CCString *v2; // x0\n  char *CString; // x0\n  FLAlertLayer *v4; // x20\n  void *v5; // x0\n  unsigned int *v6; // x2\n  int v7; // w1\n  __int64 v8; // [xsp+40h] [xbp+40h] BYREF\n\n  v1 = (int)a1;\n  if ( !a1->m_alertShown )\n  {\n    a1->m_alertShown = 1;\n    v2 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                                (cocos2d::CCString *)\"You have reached the upper max limit of <cg>%i</c> objects. This li\"\n                                                     \"mit can be removed completely, but it is <cr>not</c> recommended. L\"\n                                                     \"evels with object count above this limit will display a <co>warning\"\n                                                     \"</c> when played online.\\n\"\n                                                     \"<cy>Unoptimized levels that use too many objects have a lower chanc\"\n                                                     \"e of being rated and featured.</c>\",\n                                (const char *)&elf_hash_chain[3463]);\n    CString = (char *)cocos2d::CCString::getCString(v2);\n    sub_D153B8((int)&v8, CString);\n    v4 = FLAlertLayer::create(v1 + 408, (__int64)\"Max Objects\", (__int64)&v8);\n    v5 = (void *)(v8 - 24);\n    if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        v6 = (unsigned int *)(v8 - 8);\n        do\n          v7 = __ldaxr(v6);\n        while ( __stlxr(v7 - 1, v6) );\n      }\n      else\n      {\n        v7 = *(_DWORD *)(v8 - 8);\n        *(_DWORD *)(v8 - 8) = v7 - 1;\n      }\n      if ( v7 <= 0 )\n        operator delete(v5);\n    }\n    v4->setTag(v4, 126);\n    v4->show(v4);\n  }\n}", "assembly": "; \n; EditorUI::showMaxError from 0x6895bc to 0x689720 (356 bytes)\n; \n; 5 xrefs:\n; > LevelEditorLayer::createObjectsFromString @ 0x671b78\n; > EditorUI::onCreate @ 0x6c0518\n; > EditorUI::doPasteObjects @ 0x6c384c\n; > EditorUI::onDuplicate @ 0x6c4f18\n; > <???> @ 0x3de48\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\nSTP             X29, X30, [SP,#var_50]!                                ; +0x0, 0x6895bc\nMOV             X29, SP                                                ; +0x4, 0x6895c0\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x6895c4\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x6895c8\nMOV             X20, X0                                                ; +0x10, 0x6895cc\nLDRB            W0, [X0,#0x260]                                        ; +0x14, 0x6895d0\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x18, 0x6895d4\nLDR             X1, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x6895d8\nLDR             X1, [X1]                                               ; +0x20, 0x6895dc\nSTR             X1, [X29,#0x50+var_8]                                  ; +0x24, 0x6895e0\nCBZ             W0, loc_68960C                                         ; +0x28, 0x6895e4\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x2c, 0x6895e8\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x30, 0x6895ec\nLDR             X0, [X19]                                              ; +0x34, 0x6895f0\nCMP             X1, X0                                                 ; +0x38, 0x6895f4\nB.NE            loc_6896F0                                             ; +0x3c, 0x6895f8\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x40, 0x6895fc\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x44, 0x689600\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x48, 0x689604\nRET                                                                    ; +0x4c, 0x689608\nMOV             W0, #1                                                 ; +0x50, 0x68960c\nMOV             W1, #0x3880                                            ; +0x54, 0x689610\nSTRB            W0, [X20,#0x260]                                       ; +0x58, 0x689614\nADRP            X0, #aYouHaveReached@PAGE; \"You have reached the upper max limit of\"... ; +0x5c, 0x689618\nMOVK            W1, #1,LSL#16; char *                                  ; +0x60, 0x68961c\nADD             X0, X0, #aYouHaveReached@PAGEOFF; \"You have reached the upper max limit of\"... ; +0x64, 0x689620\nADD             X21, X29, #0x50+var_10                                 ; +0x68, 0x689624\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x6c, 0x689628\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x70, 0x68962c\nMOV             X1, X0; char *                                         ; +0x74, 0x689630\nADD             X2, X29, #0x50+var_20                                  ; +0x78, 0x689634\nMOV             X0, X21; int                                           ; +0x7c, 0x689638\nBL              sub_D153B8                                             ; +0x80, 0x68963c\nLDR             S0, =0x43BE0000                                        ; +0x84, 0x689640\nADRP            X1, #aMaxObjects@PAGE; \"Max Objects\"                   ; +0x88, 0x689644\nADRP            X3, #aCancel@PAGE; \"Cancel\"                            ; +0x8c, 0x689648\nADRP            X4, #aUnlimited@PAGE; \"Unlimited\"                      ; +0x90, 0x68964c\nADD             X0, X20, #0x198                                        ; +0x94, 0x689650\nADD             X1, X1, #aMaxObjects@PAGEOFF; \"Max Objects\"            ; +0x98, 0x689654\nMOV             X2, X21                                                ; +0x9c, 0x689658\nADD             X3, X3, #aCancel@PAGEOFF; \"Cancel\"                     ; +0xa0, 0x68965c\nADD             X4, X4, #aUnlimited@PAGEOFF; \"Unlimited\"               ; +0xa4, 0x689660\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0xa8, 0x689664\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xac, 0x689668\nLDR             X2, [X29,#0x50+var_10]                                 ; +0xb0, 0x68966c\nMOV             X20, X0                                                ; +0xb4, 0x689670\nSUB             X0, X2, #0x18; p                                       ; +0xb8, 0x689674\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xbc, 0x689678\nCMP             X0, X1                                                 ; +0xc0, 0x68967c\nB.NE            loc_6896AC                                             ; +0xc4, 0x689680\nLDR             X2, [X20]                                              ; +0xc8, 0x689684\nMOV             X0, X20                                                ; +0xcc, 0x689688\nMOV             W1, #0x7E ; '~'                                        ; +0xd0, 0x68968c\nLDR             X2, [X2,#0x48]                                         ; +0xd4, 0x689690\nBLR             X2                                                     ; +0xd8, 0x689694\nLDR             X1, [X20]                                              ; +0xdc, 0x689698\nMOV             X0, X20                                                ; +0xe0, 0x68969c\nLDR             X1, [X1,#0x508]                                        ; +0xe4, 0x6896a0\nBLR             X1                                                     ; +0xe8, 0x6896a4\nB               loc_6895E8                                             ; +0xec, 0x6896a8\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xf0, 0x6896ac\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xf4, 0x6896b0\nCBZ             X1, loc_6896E0                                         ; +0xf8, 0x6896b4\nSUB             X2, X2, #8                                             ; +0xfc, 0x6896b8\nLDAXR           W1, [X2]                                               ; +0x100, 0x6896bc\nSUB             W3, W1, #1                                             ; +0x104, 0x6896c0\nSTLXR           W4, W3, [X2]                                           ; +0x108, 0x6896c4\nCBNZ            W4, loc_6896BC                                         ; +0x10c, 0x6896c8\nCMP             W1, WZR                                                ; +0x110, 0x6896cc\nB.GT            loc_689684                                             ; +0x114, 0x6896d0\nADD             X1, X29, #0x50+var_18                                  ; +0x118, 0x6896d4\nBL              j__ZdlPv; operator delete(void *)                      ; +0x11c, 0x6896d8\nB               loc_689684                                             ; +0x120, 0x6896dc\nLDUR            W1, [X2,#-8]                                           ; +0x124, 0x6896e0\nSUB             W3, W1, #1                                             ; +0x128, 0x6896e4\nSTUR            W3, [X2,#-8]                                           ; +0x12c, 0x6896e8\nB               loc_6896CC                                             ; +0x130, 0x6896ec\nBL              .__stack_chk_fail                                      ; +0x134, 0x6896f0\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x138, 0x6896f4\nMOV             X19, X0                                                ; +0x13c, 0x6896f8\nLDR             X0, [X29,#0x50+var_10]                                 ; +0x140, 0x6896fc\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x144, 0x689700\nSUB             X0, X0, #0x18                                          ; +0x148, 0x689704\nCMP             X0, X1                                                 ; +0x14c, 0x689708\nB.EQ            loc_689718                                             ; +0x150, 0x68970c\nADD             X1, X29, #0x50+var_18                                  ; +0x154, 0x689710\nBL              sub_6865FC                                             ; +0x158, 0x689714\nMOV             X0, X19                                                ; +0x15c, 0x689718\nBL              _Unwind_Resume                                         ; +0x160, 0x68971c", "xrefs": ["LevelEditorLayer::createObjectsFromString @ 0x671b78", "EditorUI::onCreate @ 0x6c0518", "EditorUI::doPasteObjects @ 0x6c384c", "EditorUI::onDuplicate @ 0x6c4f18", "<???> @ 0x3de48"], "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"}