{"type": "func", "start": 7909348, "end": 7909676, "name": "EditorPauseLayer::onResetUnusedColors", "pseudocode": "// \n// EditorPauseLayer::onResetUnusedColors from 0x78afe4 to 0x78b12c (328 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x93a38\n// > EditorPauseLayer::customSetup @ 0x78c8fc\n// > <???> @ 0x122d0c0\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 EditorPauseLayer::onResetUnusedColors(EditorPauseLayer *a1, cocos2d::CCObject *a2)\n{\n  int v2; // w20\n  FLAlertLayer *v3; // x20\n  void *v4; // x0\n  unsigned int *v5; // x2\n  int v6; // w1\n  __int64 v7; // [xsp+40h] [xbp+40h] BYREF\n\n  v2 = (int)a1;\n  if ( !a1->m_saved )\n  {\n    sub_D153B8(\n      (int)&v7,\n      \"Reset all unused color channels?\\n<cy>This will make those channels available as 'next free'</c>\");\n    v3 = FLAlertLayer::create(v2 + 552, (__int64)\"Reset Unused Colors\", (__int64)&v7);\n    v4 = (void *)(v7 - 24);\n    if ( (__int64 *)(v7 - 24) != &qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        v5 = (unsigned int *)(v7 - 8);\n        do\n          v6 = __ldaxr(v5);\n        while ( __stlxr(v6 - 1, v5) );\n      }\n      else\n      {\n        v6 = *(_DWORD *)(v7 - 8);\n        *(_DWORD *)(v7 - 8) = v6 - 1;\n      }\n      if ( v6 <= 0 )\n        operator delete(v4);\n    }\n    v3->setTag(v3, 2);\n    v3->show(v3);\n  }\n}", "assembly": "; \n; EditorPauseLayer::onResetUnusedColors from 0x78afe4 to 0x78b12c (328 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x93a38\n; > EditorPauseLayer::customSetup @ 0x78c8fc\n; > <???> @ 0x122d0c0\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, 0x78afe4\nMOV             X29, SP                                                ; +0x4, 0x78afe8\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x78afec\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x78aff0\nMOV             X20, X0                                                ; +0x10, 0x78aff4\nLDRB            W0, [X0,#0x230]                                        ; +0x14, 0x78aff8\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x18, 0x78affc\nLDR             X1, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x78b000\nLDR             X1, [X1]                                               ; +0x20, 0x78b004\nSTR             X1, [X29,#0x50+var_8]                                  ; +0x24, 0x78b008\nCBZ             W0, loc_78B034                                         ; +0x28, 0x78b00c\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x2c, 0x78b010\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x30, 0x78b014\nLDR             X0, [X19]                                              ; +0x34, 0x78b018\nCMP             X1, X0                                                 ; +0x38, 0x78b01c\nB.NE            loc_78B0FC                                             ; +0x3c, 0x78b020\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x40, 0x78b024\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x44, 0x78b028\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x48, 0x78b02c\nRET                                                                    ; +0x4c, 0x78b030\nADD             X21, X29, #0x50+var_10                                 ; +0x50, 0x78b034\nADRP            X1, #aResetAllUnused@PAGE; \"Reset all unused color channels?\\n<cy>T\"... ; +0x54, 0x78b038\nMOV             X0, X21; int                                           ; +0x58, 0x78b03c\nADD             X1, X1, #aResetAllUnused@PAGEOFF; \"Reset all unused color channels?\\n<cy>T\"... ; +0x5c, 0x78b040\nADD             X2, X29, #0x50+var_20                                  ; +0x60, 0x78b044\nBL              sub_D153B8                                             ; +0x64, 0x78b048\nLDR             S0, =0x43960000                                        ; +0x68, 0x78b04c\nADRP            X1, #aResetUnusedCol@PAGE; \"Reset Unused Colors\"       ; +0x6c, 0x78b050\nADRP            X3, #aNo_0@PAGE; \"NO\"                                  ; +0x70, 0x78b054\nADRP            X4, #aYes_0@PAGE; \"YES\"                                ; +0x74, 0x78b058\nADD             X0, X20, #0x228                                        ; +0x78, 0x78b05c\nADD             X1, X1, #aResetUnusedCol@PAGEOFF; \"Reset Unused Colors\" ; +0x7c, 0x78b060\nMOV             X2, X21                                                ; +0x80, 0x78b064\nADD             X3, X3, #aNo_0@PAGEOFF; \"NO\"                           ; +0x84, 0x78b068\nADD             X4, X4, #aYes_0@PAGEOFF; \"YES\"                         ; +0x88, 0x78b06c\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x8c, 0x78b070\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x90, 0x78b074\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x94, 0x78b078\nMOV             X20, X0                                                ; +0x98, 0x78b07c\nSUB             X0, X2, #0x18; p                                       ; +0x9c, 0x78b080\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xa0, 0x78b084\nCMP             X0, X1                                                 ; +0xa4, 0x78b088\nB.NE            loc_78B0B8                                             ; +0xa8, 0x78b08c\nLDR             X2, [X20]                                              ; +0xac, 0x78b090\nMOV             X0, X20                                                ; +0xb0, 0x78b094\nMOV             W1, #2                                                 ; +0xb4, 0x78b098\nLDR             X2, [X2,#0x48]                                         ; +0xb8, 0x78b09c\nBLR             X2                                                     ; +0xbc, 0x78b0a0\nLDR             X1, [X20]                                              ; +0xc0, 0x78b0a4\nMOV             X0, X20                                                ; +0xc4, 0x78b0a8\nLDR             X1, [X1,#0x508]                                        ; +0xc8, 0x78b0ac\nBLR             X1                                                     ; +0xcc, 0x78b0b0\nB               loc_78B010                                             ; +0xd0, 0x78b0b4\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xd4, 0x78b0b8\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xd8, 0x78b0bc\nCBZ             X1, loc_78B0EC                                         ; +0xdc, 0x78b0c0\nSUB             X2, X2, #8                                             ; +0xe0, 0x78b0c4\nLDAXR           W1, [X2]                                               ; +0xe4, 0x78b0c8\nSUB             W3, W1, #1                                             ; +0xe8, 0x78b0cc\nSTLXR           W4, W3, [X2]                                           ; +0xec, 0x78b0d0\nCBNZ            W4, loc_78B0C8                                         ; +0xf0, 0x78b0d4\nCMP             W1, WZR                                                ; +0xf4, 0x78b0d8\nB.GT            loc_78B090                                             ; +0xf8, 0x78b0dc\nADD             X1, X29, #0x50+var_18                                  ; +0xfc, 0x78b0e0\nBL              j__ZdlPv; operator delete(void *)                      ; +0x100, 0x78b0e4\nB               loc_78B090                                             ; +0x104, 0x78b0e8\nLDUR            W1, [X2,#-8]                                           ; +0x108, 0x78b0ec\nSUB             W3, W1, #1                                             ; +0x10c, 0x78b0f0\nSTUR            W3, [X2,#-8]                                           ; +0x110, 0x78b0f4\nB               loc_78B0D8                                             ; +0x114, 0x78b0f8\nBL              .__stack_chk_fail                                      ; +0x118, 0x78b0fc\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x11c, 0x78b100\nMOV             X19, X0                                                ; +0x120, 0x78b104\nLDR             X0, [X29,#0x50+var_10]                                 ; +0x124, 0x78b108\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x128, 0x78b10c\nSUB             X0, X0, #0x18                                          ; +0x12c, 0x78b110\nCMP             X0, X1                                                 ; +0x130, 0x78b114\nB.EQ            loc_78B124                                             ; +0x134, 0x78b118\nADD             X1, X29, #0x50+var_18                                  ; +0x138, 0x78b11c\nBL              sub_4DBC08                                             ; +0x13c, 0x78b120\nMOV             X0, X19                                                ; +0x140, 0x78b124\nBL              _Unwind_Resume                                         ; +0x144, 0x78b128", "xrefs": ["<???> @ 0x93a38", "EditorPauseLayer::customSetup @ 0x78c8fc", "<???> @ 0x122d0c0"], "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"}