{"type": "func", "start": 5068516, "end": 5068748, "name": "DailyLevelPage::claimLevelReward", "pseudocode": "// \n// DailyLevelPage::claimLevelReward from 0x4d56e4 to 0x4d57cc (232 bytes)\n// \n// 1 xrefs:\n// > DailyLevelNode::onClaimReward @ 0x4d5818\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 DailyLevelPage::claimLevelReward(DailyLevelPage *a1, DailyLevelNode *a2, GJGameLevel *a3, cocos2d::CCPoint a4)\n{\n  float x; // r10\n  GameStatsManager *v8; // r0\n  GJRewardItem *v9; // r0\n  GJRewardItem *v10; // r4\n  RewardUnlockLayer *v11; // r8\n  GameStatsManager *v12; // r0\n  int BonusDiamonds; // r11\n  CurrencyRewardLayer *v14; // r0\n  GameLevelManager *v15; // r0\n  float v16; // [sp+20h] [bp-14h]\n  cocos2d::CCPoint v17; // [sp+24h] [bp-10h] BYREF\n\n  x = a4.x;\n  v8 = GameStatsManager::sharedState();\n  v9 = GameStatsManager::completedDailyLevel(v8, a3);\n  v10 = v9;\n  if ( v9 )\n  {\n    v11 = RewardUnlockLayer::create(v9->m_rewardType, nullptr);\n    a1->addChild_0(a1, v11, 100);\n    RewardUnlockLayer::showCollectReward(v11, v10);\n  }\n  else\n  {\n    v12 = GameStatsManager::sharedState();\n    BonusDiamonds = GameStatsManager::getBonusDiamonds(v12, a3->m_stars.random - a3->m_stars.seed);\n    cocos2d::CCPoint::CCPoint(&v17, (const cocos2d::CCPoint *)LODWORD(x));\n    v14 = CurrencyRewardLayer::create(\n            0,\n            0,\n            0,\n            BonusDiamonds,\n            Icon,\n            0,\n            Icon,\n            0,\n            (cocos2d::CCPoint)(unsigned int)&v17,\n            (CurrencyRewardType)0,\n            1.0,\n            v16);\n    a1->addChild_0(a1, v14, 14);\n  }\n  DailyLevelPage::exitDailyNode(a1, a2, 0.0);\n  v15 = GameLevelManager::sharedState();\n  if ( GameLevelManager::getDailyID(v15, a1->m_type) <= a3->m_dailyID.random - a3->m_dailyID.seed )\n    DailyLevelPage::createDailyNode(a1, nullptr, 0, 0.5, 0);\n  else\n    DailyLevelPage::downloadAndCreateNode(a1);\n}", "assembly": "; \n; DailyLevelPage::claimLevelReward from 0x4d56e4 to 0x4d57cc (232 bytes)\n; \n; 1 xrefs:\n; > DailyLevelNode::onClaimReward @ 0x4d5818\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x4d56e4\nMOV             R10, R3                                                ; +0x4, 0x4d56e8\nLDR             R7, =(__stack_chk_guard_ptr - 0x4D56F6)                ; +0x6, 0x4d56ea\nSUB             SP, SP, #0x34                                          ; +0x8, 0x4d56ec\nMOV             R6, R2                                                 ; +0xa, 0x4d56ee\nMOV             R9, R1                                                 ; +0xc, 0x4d56f0\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xe, 0x4d56f2\nLDR             R7, [R7]; __stack_chk_guard                            ; +0x10, 0x4d56f4\nMOV             R5, R0                                                 ; +0x12, 0x4d56f6\nLDR             R3, [R7]                                               ; +0x14, 0x4d56f8\nSTR             R3, [SP,#0x34+var_8]                                   ; +0x16, 0x4d56fa\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x18, 0x4d56fc\nMOV             R1, R6; GJGameLevel *                                  ; +0x1c, 0x4d5700\nBL              _ZN16GameStatsManager19completedDailyLevelEP11GJGameLevel; GameStatsManager::completedDailyLevel(GJGameLevel *) ; +0x1e, 0x4d5702\nMOV             R4, R0                                                 ; +0x22, 0x4d5706\nCBZ             R0, loc_4D572C                                         ; +0x24, 0x4d5708\nMOVS            R1, #0; int                                            ; +0x26, 0x4d570a\nLDR             R0, [R0,#0x3C]; this                                   ; +0x28, 0x4d570c\nBL              _ZN17RewardUnlockLayer6createEiP11RewardsPage; RewardUnlockLayer::create(int,RewardsPage *) ; +0x2a, 0x4d570e\nLDR             R3, [R5]                                               ; +0x2e, 0x4d5712\nMOVS            R2, #0x64 ; 'd'                                        ; +0x30, 0x4d5714\nLDR.W           R3, [R3,#0xE0]                                         ; +0x32, 0x4d5716\nMOV             R8, R0                                                 ; +0x36, 0x4d571a\nMOV             R0, R5                                                 ; +0x38, 0x4d571c\nMOV             R1, R8                                                 ; +0x3a, 0x4d571e\nBLX             R3                                                     ; +0x3c, 0x4d5720\nMOV             R0, R8; this                                           ; +0x3e, 0x4d5722\nMOV             R1, R4; GJRewardItem *                                 ; +0x40, 0x4d5724\nBL              _ZN17RewardUnlockLayer17showCollectRewardEP12GJRewardItem; RewardUnlockLayer::showCollectReward(GJRewardItem *) ; +0x42, 0x4d5726\nB               loc_4D577E                                             ; +0x46, 0x4d572a\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x48, 0x4d572c\nLDR.W           R3, [R6,#0x250]                                        ; +0x4c, 0x4d5730\nLDR.W           R1, [R6,#0x24C]                                        ; +0x50, 0x4d5734\nADD.W           R8, SP, #0x34+var_10                                   ; +0x54, 0x4d5738\nSUBS            R1, R1, R3; int                                        ; +0x58, 0x4d573c\nBL              _ZN16GameStatsManager16getBonusDiamondsEi; GameStatsManager::getBonusDiamonds(int) ; +0x5a, 0x4d573e\nMOV             R1, R10; cocos2d::CCPoint *                            ; +0x5e, 0x4d5742\nMOV             R11, R0                                                ; +0x60, 0x4d5744\nMOV             R0, R8; this                                           ; +0x62, 0x4d5746\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x64, 0x4d5748\nMOVS            R3, #0                                                 ; +0x68, 0x4d574c\nMOV             R1, R4; int                                            ; +0x6a, 0x4d574e\nSTR             R3, [SP,#0x34+var_1C]; float                           ; +0x6c, 0x4d5750\nMOV             R2, R4; int                                            ; +0x6e, 0x4d5752\nMOV.W           R3, #0x3F800000                                        ; +0x70, 0x4d5754\nSTR             R4, [SP,#0x34+var_34]; int                             ; +0x74, 0x4d5758\nMOV             R0, R4; int                                            ; +0x76, 0x4d575a\nSTR             R3, [SP,#0x34+var_18]; float                           ; +0x78, 0x4d575c\nMOV             R3, R11; int                                           ; +0x7a, 0x4d575e\nSTR             R4, [SP,#0x34+var_30]; int                             ; +0x7c, 0x4d5760\nSTR             R4, [SP,#0x34+var_2C]; int                             ; +0x7e, 0x4d5762\nSTR             R4, [SP,#0x34+var_28]; int                             ; +0x80, 0x4d5764\nSTR.W           R8, [SP,#0x34+var_24]; int                             ; +0x82, 0x4d5766\nSTR             R4, [SP,#0x34+var_20]; int                             ; +0x86, 0x4d576a\nBL              _ZN19CurrencyRewardLayer6createEiiii18CurrencySpriteTypeiS0_iN7cocos2d7CCPointE18CurrencyRewardTypeff; CurrencyRewardLayer::create(int,int,int,int,CurrencySpriteType,int,CurrencySpriteType,int,cocos2d::CCPoint,CurrencyRewardType,float,float) ; +0x88, 0x4d576c\nLDR             R3, [R5]                                               ; +0x8c, 0x4d5770\nMOVS            R2, #0xE                                               ; +0x8e, 0x4d5772\nLDR.W           R3, [R3,#0xE0]                                         ; +0x90, 0x4d5774\nMOV             R1, R0                                                 ; +0x94, 0x4d5778\nMOV             R0, R5                                                 ; +0x96, 0x4d577a\nBLX             R3                                                     ; +0x98, 0x4d577c\nMOVS            R2, #0; cocos2d::CCDelayTime *                         ; +0x9a, 0x4d577e\nMOV             R1, R9; DailyLevelNode *                               ; +0x9c, 0x4d5780\nMOV             R0, R5; this                                           ; +0x9e, 0x4d5782\nBL              _ZN14DailyLevelPage13exitDailyNodeEP14DailyLevelNodef; DailyLevelPage::exitDailyNode(DailyLevelNode *,float) ; +0xa0, 0x4d5784\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0xa4, 0x4d5788\nLDR.W           R1, [R5,#0x214]                                        ; +0xa8, 0x4d578c\nBL              _ZN16GameLevelManager10getDailyIDE16GJTimedLevelType; GameLevelManager::getDailyID(GJTimedLevelType) ; +0xac, 0x4d5790\nLDR.W           R3, [R6,#0x230]                                        ; +0xb0, 0x4d5794\nLDR.W           R2, [R6,#0x234]                                        ; +0xb4, 0x4d5798\nSUBS            R3, R3, R2                                             ; +0xb8, 0x4d579c\nCMP             R0, R3                                                 ; +0xba, 0x4d579e\nBLE             loc_4D57AA                                             ; +0xbc, 0x4d57a0\nMOV             R0, R5; this                                           ; +0xbe, 0x4d57a2\nBL              _ZN14DailyLevelPage21downloadAndCreateNodeEv; DailyLevelPage::downloadAndCreateNode(void) ; +0xc0, 0x4d57a4\nB               loc_4D57BA                                             ; +0xc4, 0x4d57a8\nMOVS            R1, #0; GJGameLevel *                                  ; +0xc6, 0x4d57aa\nMOV             R0, R5; this                                           ; +0xc8, 0x4d57ac\nSTR             R1, [SP,#0x34+var_34]; DailyLevelPage *                ; +0xca, 0x4d57ae\nMOV             R2, R1; bool                                           ; +0xcc, 0x4d57b0\nMOV.W           R3, #0x3F000000; float                                 ; +0xce, 0x4d57b2\nBL              _ZN14DailyLevelPage15createDailyNodeEP11GJGameLevelbfb; DailyLevelPage::createDailyNode(GJGameLevel *,bool,float,bool) ; +0xd2, 0x4d57b6\nLDR             R2, [SP,#0x34+var_8]                                   ; +0xd6, 0x4d57ba\nLDR             R3, [R7]                                               ; +0xd8, 0x4d57bc\nCMP             R2, R3                                                 ; +0xda, 0x4d57be\nBEQ             loc_4D57C6                                             ; +0xdc, 0x4d57c0\nBLX             __stack_chk_fail                                       ; +0xde, 0x4d57c2\nADD             SP, SP, #0x34 ; '4'                                    ; +0xe2, 0x4d57c6\nPOP.W           {R4-R11,PC}                                            ; +0xe4, 0x4d57c8", "xrefs": ["DailyLevelNode::onClaimReward @ 0x4d5818"], "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"}