{"type": "func", "start": 10952280, "end": 10952632, "name": "GJPathPage::onUnlock", "pseudocode": "// \n// GJPathPage::onUnlock from 0xa71e58 to 0xa71fb8 (352 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x453d8\n// > GJPathPage::init @ 0xa7031c\n// > <???> @ 0x122a368\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 GJPathPage::onUnlock(GJPathPage *a1, cocos2d::CCObject *a2)\n{\n  GameStatsManager *v3; // x0\n  GJStoreItem *StoreItem; // x20\n  int v5; // w22\n  GameStatsManager *v6; // x23\n  int Stat; // w23\n  char *v8; // x0\n  PurchaseItemPopup *v9; // x0\n  PurchaseItemPopup_vtbl *v10; // x2\n  unsigned int *v11; // x2\n  int v12; // w1\n  int v13; // [xsp+48h] [xbp+48h]\n  char *v14; // [xsp+60h] [xbp+60h] BYREF\n\n  v13 = a1->m_pathNumber + 5;\n  v3 = GameStatsManager::sharedState();\n  StoreItem = GameStatsManager::getStoreItem(v3, v13);\n  v5 = StoreItem->m_price.random - StoreItem->m_price.seed;\n  v6 = GameStatsManager::sharedState();\n  GJStoreItem::getCurrencyKey(StoreItem, (__int64)&v14);\n  Stat = GameStatsManager::getStat(v6, v14);\n  v8 = v14 - 24;\n  if ( v14 - 24 != (char *)&qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v11 = (unsigned int *)(v14 - 8);\n      do\n        v12 = __ldaxr(v11);\n      while ( __stlxr(v12 - 1, v11) );\n    }\n    else\n    {\n      v12 = *((_DWORD *)v14 - 2);\n      *((_DWORD *)v14 - 2) = v12 - 1;\n    }\n    if ( v12 <= 0 )\n      operator delete(v8);\n  }\n  if ( Stat < v5 )\n  {\n    GJPathPage::showCantAffordMessage(a1, StoreItem);\n  }\n  else\n  {\n    v9 = PurchaseItemPopup::create(StoreItem);\n    v10 = v9->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v9->m_delegate = &a1->GJPurchaseDelegate;\n    ((void (*)(void))v10->show)();\n  }\n}", "assembly": "; \n; GJPathPage::onUnlock from 0xa71e58 to 0xa71fb8 (352 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x453d8\n; > GJPathPage::init @ 0xa7031c\n; > <???> @ 0x122a368\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_70]!                                ; +0x0, 0xa71e58\nMOV             X29, SP                                                ; +0x4, 0xa71e5c\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0xa71e60\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0xa71e64\nLDR             W1, [X0,#0x290]                                        ; +0x10, 0xa71e68\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0xa71e6c\nMOV             X21, X0                                                ; +0x18, 0xa71e70\nADD             W1, W1, #5                                             ; +0x1c, 0xa71e74\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0xa71e78\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x24, 0xa71e7c\nSTR             X1, [X29,#0x70+var_28]                                 ; +0x28, 0xa71e80\nLDR             X0, [X0]; this                                         ; +0x2c, 0xa71e84\nSTR             X0, [X29,#0x70+var_8]                                  ; +0x30, 0xa71e88\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x34, 0xa71e8c\nLDR             X1, [X29,#0x70+var_28]; int                            ; +0x38, 0xa71e90\nMOV             W2, #0xC; int                                          ; +0x3c, 0xa71e94\nBL              _ZN16GameStatsManager12getStoreItemEii; GameStatsManager::getStoreItem(int,int) ; +0x40, 0xa71e98\nLDR             W22, [X0,#0x160]                                       ; +0x44, 0xa71e9c\nMOV             X20, X0                                                ; +0x48, 0xa71ea0\nLDR             W0, [X0,#0x164]; this                                  ; +0x4c, 0xa71ea4\nSUB             W22, W22, W0                                           ; +0x50, 0xa71ea8\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x54, 0xa71eac\nMOV             X23, X0                                                ; +0x58, 0xa71eb0\nADD             X8, X29, #0x70+var_10                                  ; +0x5c, 0xa71eb4\nMOV             X0, X20; this                                          ; +0x60, 0xa71eb8\nBL              _ZN11GJStoreItem14getCurrencyKeyEv; GJStoreItem::getCurrencyKey(void) ; +0x64, 0xa71ebc\nLDR             X1, [X29,#0x70+var_10]; char *                         ; +0x68, 0xa71ec0\nMOV             X0, X23; this                                          ; +0x6c, 0xa71ec4\nBL              _ZN16GameStatsManager7getStatEPKc; GameStatsManager::getStat(char const*) ; +0x70, 0xa71ec8\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x74, 0xa71ecc\nLDR             X2, [X29,#0x70+var_10]                                 ; +0x78, 0xa71ed0\nMOV             W23, W0                                                ; +0x7c, 0xa71ed4\nSUB             X0, X2, #0x18; p                                       ; +0x80, 0xa71ed8\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0 ; GJStoreItem * ; +0x84, 0xa71edc\nCMP             X0, X1                                                 ; +0x88, 0xa71ee0\nB.NE            loc_A71F44                                             ; +0x8c, 0xa71ee4\nCMP             W23, W22                                               ; +0x90, 0xa71ee8\nB.LT            loc_A71F34                                             ; +0x94, 0xa71eec\nMOV             X0, X20; this                                          ; +0x98, 0xa71ef0\nADD             X21, X21, #0x280                                       ; +0x9c, 0xa71ef4\nBL              _ZN17PurchaseItemPopup6createEP11GJStoreItem; PurchaseItemPopup::create(GJStoreItem *) ; +0xa0, 0xa71ef8\nLDR             X2, [X0]                                               ; +0xa4, 0xa71efc\nSTR             X21, [X0,#0x280]                                       ; +0xa8, 0xa71f00\nLDR             X1, [X2,#0x508]                                        ; +0xac, 0xa71f04\nBLR             X1                                                     ; +0xb0, 0xa71f08\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xb4, 0xa71f0c\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xb8, 0xa71f10\nLDR             X0, [X19]                                              ; +0xbc, 0xa71f14\nCMP             X1, X0                                                 ; +0xc0, 0xa71f18\nB.NE            loc_A71F88                                             ; +0xc4, 0xa71f1c\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xc8, 0xa71f20\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xcc, 0xa71f24\nLDR             X23, [SP,#0x70+var_40]                                 ; +0xd0, 0xa71f28\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xd4, 0xa71f2c\nRET                                                                    ; +0xd8, 0xa71f30\nMOV             X0, X21; this                                          ; +0xdc, 0xa71f34\nMOV             X1, X20; GJStoreItem *                                 ; +0xe0, 0xa71f38\nBL              _ZN10GJPathPage21showCantAffordMessageEP11GJStoreItem; GJPathPage::showCantAffordMessage(GJStoreItem *) ; +0xe4, 0xa71f3c\nB               loc_A71F0C                                             ; +0xe8, 0xa71f40\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xec, 0xa71f44\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xf0, 0xa71f48\nCBZ             X1, loc_A71F78                                         ; +0xf4, 0xa71f4c\nSUB             X2, X2, #8                                             ; +0xf8, 0xa71f50\nLDAXR           W1, [X2]                                               ; +0xfc, 0xa71f54\nSUB             W3, W1, #1                                             ; +0x100, 0xa71f58\nSTLXR           W4, W3, [X2]                                           ; +0x104, 0xa71f5c\nCBNZ            W4, loc_A71F54                                         ; +0x108, 0xa71f60\nCMP             W1, WZR                                                ; +0x10c, 0xa71f64\nB.GT            loc_A71EE8                                             ; +0x110, 0xa71f68\nADD             X1, X29, #0x70+var_18                                  ; +0x114, 0xa71f6c\nBL              j__ZdlPv; operator delete(void *)                      ; +0x118, 0xa71f70\nB               loc_A71EE8                                             ; +0x11c, 0xa71f74\nLDUR            W1, [X2,#-8]                                           ; +0x120, 0xa71f78\nSUB             W3, W1, #1                                             ; +0x124, 0xa71f7c\nSTUR            W3, [X2,#-8]                                           ; +0x128, 0xa71f80\nB               loc_A71F64                                             ; +0x12c, 0xa71f84\nBL              .__stack_chk_fail                                      ; +0x130, 0xa71f88\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x134, 0xa71f8c\nMOV             X19, X0                                                ; +0x138, 0xa71f90\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x13c, 0xa71f94\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x140, 0xa71f98\nSUB             X0, X0, #0x18                                          ; +0x144, 0xa71f9c\nCMP             X0, X1                                                 ; +0x148, 0xa71fa0\nB.EQ            loc_A71FB0                                             ; +0x14c, 0xa71fa4\nADD             X1, X29, #0x70+var_18                                  ; +0x150, 0xa71fa8\nBL              sub_4DDBA0                                             ; +0x154, 0xa71fac\nMOV             X0, X19                                                ; +0x158, 0xa71fb0\nBL              _Unwind_Resume                                         ; +0x15c, 0xa71fb4", "xrefs": ["<???> @ 0x453d8", "GJPathPage::init @ 0xa7031c", "<???> @ 0x122a368"], "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"}