{"type": "func", "start": 4296743128, "end": 4296743492, "name": "GJRateLevelLayer::onCustomButton", "pseudocode": "// \n// GJRateLevelLayer::onCustomButton from 0x1001b18d8 to 0x1001b1a44 (364 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x1007b0ca8\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 __fastcall GJRateLevelLayer::onCustomButton(GJRateLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // w0\n  UploadActionPopup *v4; // x20\n  int v5; // w20\n  GameLevelManager *v6; // x0\n  UploadActionPopup *m_uploadPopup; // x8\n  void *v8[2]; // [xsp+0h] [xbp-40h] BYREF\n  char v9; // [xsp+17h] [xbp-29h]\n  void *__p[2]; // [xsp+18h] [xbp-28h] BYREF\n  char v11; // [xsp+2Fh] [xbp-11h]\n\n  v3 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);\n  if ( v3 != -4 )\n  {\n    if ( v3 != -2 )\n      return;\n    sub_100009900(__p, \"Do you want to unrate this level?\");\n    v4 = (UploadActionPopup *)FLAlertLayer::create_1(\n                                &a1->FLAlertLayerProtocol,\n                                \"Unrate Level\",\n                                __p,\n                                \"Cancel\",\n                                \"Unrate\",\n                                380.0);\n    if ( v11 < 0 )\n      operator delete(__p[0]);\n    ButtonSprite::updateBGImage(v4->m_button2, \"GJ_button_06.png\");\n    ((void (__fastcall *)(UploadActionPopup *, __int64))v4->setTag)(v4, 4294967293LL);\n    goto LABEL_6;\n  }\n  v5 = (int)((float (__fastcall *)(GJRateLevelLayer *, __int64))a1->getValue)(a1, 0xFFFFFFFFLL);\n  if ( v5 >= 1 && a1->m_featureState >= Featured )\n  {\n    v6 = GameLevelManager::sharedState();\n    if ( GameLevelManager::updateLevelRankAdmin(v6, a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed, v5) )\n    {\n      GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;\n      m_uploadPopup = a1->m_uploadPopup;\n      if ( m_uploadPopup )\n        m_uploadPopup->m_delegate = nullptr;\n      sub_100009900(v8, \"Updating rank...\");\n      v4 = (UploadActionPopup *)UploadActionPopup::create(&a1->UploadPopupDelegate, v8);\n      a1->m_uploadPopup = v4;\n      if ( v9 < 0 )\n      {\n        operator delete(v8[0]);\n        v4 = a1->m_uploadPopup;\n      }\nLABEL_6:\n      ((void (__fastcall *)(UploadActionPopup *))v4->show)(v4);\n    }\n  }\n}", "assembly": "; \n; GJRateLevelLayer::onCustomButton from 0x1001b18d8 to 0x1001b1a44 (364 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x1007b0ca8\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\nSUB             SP, SP, #0x50                                          ; +0x0, 0x1001b18d8\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0x4, 0x1001b18dc\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0x8, 0x1001b18e0\nADD             X29, SP, #0x40                                         ; +0xc, 0x1001b18e4\nMOV             X19, X0                                                ; +0x10, 0x1001b18e8\nLDR             X8, [X1]                                               ; +0x14, 0x1001b18ec\nLDR             X8, [X8,#0x40]                                         ; +0x18, 0x1001b18f0\nMOV             X0, X1                                                 ; +0x1c, 0x1001b18f4\nBLR             X8                                                     ; +0x20, 0x1001b18f8\nCMN             W0, #4                                                 ; +0x24, 0x1001b18fc\nB.EQ            loc_1001B1994                                          ; +0x28, 0x1001b1900\nCMN             W0, #2                                                 ; +0x2c, 0x1001b1904\nB.NE            loc_1001B1A34                                          ; +0x30, 0x1001b1908\nADRL            X1, aDoYouWantToUnr; \"Do you want to unrate this level?\" ; +0x34, 0x1001b190c\nADD             X0, SP, #0x40+__p; int                                 ; +0x3c, 0x1001b1914\nBL              sub_100009900                                          ; +0x40, 0x1001b1918\nADRL            X1, aUnrateLevel; \"Unrate Level\"                       ; +0x44, 0x1001b191c\nADRL            X3, aCancel; \"Cancel\"                                  ; +0x4c, 0x1001b1924\nADRL            X4, aUnrate; \"Unrate\"                                  ; +0x54, 0x1001b192c\nMOV             W8, #0x43BE0000                                        ; +0x5c, 0x1001b1934\nFMOV            S0, W8                                                 ; +0x60, 0x1001b1938\nADD             X0, X19, #0x3C8                                        ; +0x64, 0x1001b193c\nADD             X2, SP, #0x40+__p                                      ; +0x68, 0x1001b1940\nBL              FLAlertLayer__create_1                                 ; +0x6c, 0x1001b1944\nMOV             X20, X0                                                ; +0x70, 0x1001b1948\nLDRSB           W8, [SP,#0x40+var_11]                                  ; +0x74, 0x1001b194c\nTBZ             W8, #0x1F, loc_1001B195C                               ; +0x78, 0x1001b1950\nLDR             X0, [SP,#0x40+__p]; __p                                ; +0x7c, 0x1001b1954\nBL              __ZdlPv; operator delete(void *)                       ; +0x80, 0x1001b1958\nLDR             X0, [X20,#0x258]                                       ; +0x84, 0x1001b195c\nADRL            X1, aGjButton06Png; \"GJ_button_06.png\"                 ; +0x88, 0x1001b1960\nBL              ButtonSprite__updateBGImage                            ; +0x90, 0x1001b1968\nLDR             X8, [X20]                                              ; +0x94, 0x1001b196c\nLDR             X8, [X8,#0x48]                                         ; +0x98, 0x1001b1970\nMOV             X0, X20                                                ; +0x9c, 0x1001b1974\nMOV             W1, #0xFFFFFFFD                                        ; +0xa0, 0x1001b1978\nBLR             X8                                                     ; +0xa4, 0x1001b197c\nLDR             X8, [X20]                                              ; +0xa8, 0x1001b1980\nLDR             X8, [X8,#0x508]                                        ; +0xac, 0x1001b1984\nMOV             X0, X20                                                ; +0xb0, 0x1001b1988\nBLR             X8                                                     ; +0xb4, 0x1001b198c\nB               loc_1001B1A34                                          ; +0xb8, 0x1001b1990\nLDR             X8, [X19]                                              ; +0xbc, 0x1001b1994\nLDR             X8, [X8,#0x598]                                        ; +0xc0, 0x1001b1998\nMOV             X0, X19                                                ; +0xc4, 0x1001b199c\nMOV             W1, #0xFFFFFFFF                                        ; +0xc8, 0x1001b19a0\nBLR             X8                                                     ; +0xcc, 0x1001b19a4\nFCVTZS          W20, S0                                                ; +0xd0, 0x1001b19a8\nCMP             W20, #1                                                ; +0xd4, 0x1001b19ac\nB.LT            loc_1001B1A34                                          ; +0xd8, 0x1001b19b0\nLDR             W8, [X19,#0x410]                                       ; +0xdc, 0x1001b19b4\nCMP             W8, #1                                                 ; +0xe0, 0x1001b19b8\nB.LT            loc_1001B1A34                                          ; +0xe4, 0x1001b19bc\nBL              GameLevelManager__sharedState                          ; +0xe8, 0x1001b19c0\nLDR             X8, [X19,#0x3D0]                                       ; +0xec, 0x1001b19c4\nLDR             W9, [X8,#0x148]                                        ; +0xf0, 0x1001b19c8\nLDR             W8, [X8,#0x14C]                                        ; +0xf4, 0x1001b19cc\nSUB             W1, W9, W8                                             ; +0xf8, 0x1001b19d0\nMOV             X2, X20                                                ; +0xfc, 0x1001b19d4\nBL              GameLevelManager__updateLevelRankAdmin                 ; +0x100, 0x1001b19d8\nCBZ             W0, loc_1001B1A34                                      ; +0x104, 0x1001b19dc\nBL              GameLevelManager__sharedState                          ; +0x108, 0x1001b19e0\nADD             X8, X19, #0x3B8                                        ; +0x10c, 0x1001b19e4\nSTR             X8, [X0,#0x328]                                        ; +0x110, 0x1001b19e8\nLDR             X8, [X19,#0x400]                                       ; +0x114, 0x1001b19ec\nCBZ             X8, loc_1001B19F8                                      ; +0x118, 0x1001b19f0\nSTR             XZR, [X8,#0x278]                                       ; +0x11c, 0x1001b19f4\nADRL            X1, aUpdatingRank; \"Updating rank...\"                  ; +0x120, 0x1001b19f8\nMOV             X0, SP; int                                            ; +0x128, 0x1001b1a00\nBL              sub_100009900                                          ; +0x12c, 0x1001b1a04\nADD             X0, X19, #0x3B0                                        ; +0x130, 0x1001b1a08\nMOV             X1, SP                                                 ; +0x134, 0x1001b1a0c\nBL              UploadActionPopup__create                              ; +0x138, 0x1001b1a10\nMOV             X20, X0                                                ; +0x13c, 0x1001b1a14\nSTR             X0, [X19,#0x400]                                       ; +0x140, 0x1001b1a18\nLDRSB           W8, [SP,#0x40+var_29]                                  ; +0x144, 0x1001b1a1c\nTBZ             W8, #0x1F, loc_1001B1980                               ; +0x148, 0x1001b1a20\nLDR             X0, [SP,#0x40+var_40]; __p                             ; +0x14c, 0x1001b1a24\nBL              __ZdlPv; operator delete(void *)                       ; +0x150, 0x1001b1a28\nLDR             X20, [X19,#0x400]                                      ; +0x154, 0x1001b1a2c\nB               loc_1001B1980                                          ; +0x158, 0x1001b1a30\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x15c, 0x1001b1a34\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x160, 0x1001b1a38\nADD             SP, SP, #0x50 ; 'P'                                    ; +0x164, 0x1001b1a3c\nRET                                                                    ; +0x168, 0x1001b1a40", "xrefs": ["<???> @ 0x1007b0ca8"], "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"}