{"type": "func", "start": 5033584, "end": 5033912, "name": "ChallengesPage::updateTimers", "pseudocode": "// \n// ChallengesPage::updateTimers from 0x4cce70 to 0x4ccfb8 (328 bytes)\n// \n// 3 xrefs:\n// > ChallengesPage::challengeStatusFinished @ 0x4ccfe2\n// > ChallengesPage::challengeStatusFinished @ 0x4cd042\n// > ChallengesPage::claimItem @ 0x4cd170\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 ChallengesPage::updateTimers(ChallengesPage *a1, float a2)\n{\n  GameStatsManager *v3; // r0\n  double v4; // d8\n  double m_challengeTime; // d7\n  cocos2d::CCLabelBMFont *m_countdownLabel; // r5\n  void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r10\n  cocos2d::CCString *v8; // r0\n  const char *CString; // r0\n  cocos2d::CCDictionary *m_challengeNodes; // r3\n  cocos2d::CCDictElement *m_pElements; // r3\n  cocos2d::CCDictElement *next; // r5\n  int m_pObject; // r10\n  cocos2d::CCDictElement *v14; // r2\n  GameStatsManager *v15; // r0\n  char *v16; // [sp+0h] [bp-10h] BYREF\n  _DWORD v17[2]; // [sp+4h] [bp-Ch] BYREF\n\n  v3 = GameStatsManager::sharedState();\n  if ( GameStatsManager::areChallengesLoaded(v3) )\n  {\n    clock_gettime(0, (struct timespec *)v17);\n    v4 = (double)v17[0] + (double)v17[1] / 1000000000.0;\n    m_challengeTime = GameStatsManager::sharedState()->m_challengeTime;\n    GameToolbox::getTimeString(\n      (GameToolbox *)&v16,\n      (int)(m_challengeTime - v4) & ~((int)(m_challengeTime - v4) >> 31),\n      0);\n    m_countdownLabel = a1->m_countdownLabel;\n    setString = m_countdownLabel->setString;\n    v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"New quests in: %s\", v16);\n    CString = cocos2d::CCString::getCString(v8);\n    setString(m_countdownLabel, (const unsigned __int8 *)CString);\n    m_challengeNodes = a1->m_challengeNodes;\n    if ( m_challengeNodes )\n    {\n      m_pElements = m_challengeNodes->m_pElements;\n      if ( m_pElements )\n        next = (cocos2d::CCDictElement *)m_pElements->hh.next;\n      else\n        next = nullptr;\n      while ( m_pElements )\n      {\n        m_pObject = (int)m_pElements->m_pObject;\n        sub_775C20(v17);\n        ChallengeNode::updateTimeLabel(m_pObject, v17);\n        sub_774008(v17);\n        if ( next )\n          v14 = (cocos2d::CCDictElement *)next->hh.next;\n        else\n          v14 = nullptr;\n        m_pElements = next;\n        next = v14;\n      }\n    }\n    if ( ((int)(m_challengeTime - v4) & ~((int)(m_challengeTime - v4) >> 31)) == 0 && !a1->m_unkBool )\n    {\n      a1->m_circle->setVisible(a1->m_circle, 1);\n      a1->m_countdownLabel->setVisible(a1->m_countdownLabel, 0);\n      a1->m_unkBool = 1;\n      a1->m_triedToLoad = 0;\n      v15 = GameStatsManager::sharedState();\n      GameStatsManager::resetChallengeTimer(v15);\n      ChallengesPage::tryGetChallenges(a1);\n    }\n    sub_774008(&v16);\n  }\n}", "assembly": "; \n; ChallengesPage::updateTimers from 0x4cce70 to 0x4ccfb8 (328 bytes)\n; \n; 3 xrefs:\n; > ChallengesPage::challengeStatusFinished @ 0x4ccfe2\n; > ChallengesPage::challengeStatusFinished @ 0x4cd042\n; > ChallengesPage::claimItem @ 0x4cd170\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-R10,LR}                                            ; +0x0, 0x4cce70\nMOV             R4, R0                                                 ; +0x4, 0x4cce74\nLDR.W           R9, =(__stack_chk_guard_ptr - 0x4CCE82)                ; +0x6, 0x4cce76\nVPUSH           {D8}                                                   ; +0xa, 0x4cce7a\nADD             R9, PC; __stack_chk_guard_ptr                          ; +0xe, 0x4cce7e\nLDR.W           R9, [R9]; __stack_chk_guard                            ; +0x10, 0x4cce80\nLDR.W           R3, [R9]                                               ; +0x14, 0x4cce84\nSUB             SP, SP, #0x10                                          ; +0x18, 0x4cce88\nSTR             R3, [SP,#0x10+var_4]                                   ; +0x1a, 0x4cce8a\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x1c, 0x4cce8c\nBL              _ZN16GameStatsManager19areChallengesLoadedEv; GameStatsManager::areChallengesLoaded(void) ; +0x20, 0x4cce90\nCMP             R0, #0                                                 ; +0x24, 0x4cce94\nBEQ.W           loc_4CCFA0                                             ; +0x26, 0x4cce96\nADD             R7, SP, #0x10+var_C                                    ; +0x2a, 0x4cce9a\nMOVS            R0, #0; clock_id                                       ; +0x2c, 0x4cce9c\nVLDR            D8, =1.0e9                                             ; +0x2e, 0x4cce9e\nMOV             R8, SP                                                 ; +0x32, 0x4ccea2\nMOV             R1, R7; tp                                             ; +0x34, 0x4ccea4\nBLX             clock_gettime                                          ; +0x36, 0x4ccea6\nVLDR            S13, [SP,#0x10+var_8]                                  ; +0x3a, 0x4cceaa\nVLDR            S15, [SP,#0x10+var_C]                                  ; +0x3e, 0x4cceae\nVCVT.F64.S32    D6, S13                                                ; +0x42, 0x4cceb2\nVDIV.F64        D8, D6, D8                                             ; +0x46, 0x4cceb6\nVCVT.F64.S32    D7, S15                                                ; +0x4a, 0x4cceba\nVADD.F64        D8, D7, D8                                             ; +0x4e, 0x4ccebe\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x52, 0x4ccec2\nMOVS            R2, #0; bool                                           ; +0x56, 0x4ccec6\nVLDR            D7, [R0,#0x178]                                        ; +0x58, 0x4ccec8\nMOV             R0, SP; this                                           ; +0x5c, 0x4ccecc\nVSUB.F64        D7, D7, D8                                             ; +0x5e, 0x4ccece\nVCVT.S32.F64    S15, D7                                                ; +0x62, 0x4cced2\nVMOV            R6, S15                                                ; +0x66, 0x4cced6\nBIC.W           R6, R6, R6,ASR#31                                      ; +0x6a, 0x4cceda\nMOV             R1, R6; int                                            ; +0x6e, 0x4ccede\nBL              _ZN11GameToolbox13getTimeStringEib; GameToolbox::getTimeString(int,bool) ; +0x70, 0x4ccee0\nLDR.W           R5, [R4,#0x200]                                        ; +0x74, 0x4ccee4\nLDR             R0, =(aNewQuestsInS - 0x4CCEF2); \"New quests in: %s\"   ; +0x78, 0x4ccee8\nLDR             R1, [SP,#0x10+var_10]; char *                          ; +0x7a, 0x4cceea\nLDR             R3, [R5]                                               ; +0x7c, 0x4cceec\nADD             R0, PC; \"New quests in: %s\"                            ; +0x7e, 0x4cceee\nLDR.W           R10, [R3,#0x1C8]                                       ; +0x80, 0x4ccef0\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x84, 0x4ccef4\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x88, 0x4ccef8\nMOV             R1, R0                                                 ; +0x8c, 0x4ccefc\nMOV             R0, R5                                                 ; +0x8e, 0x4ccefe\nBLX             R10                                                    ; +0x90, 0x4ccf00\nLDR.W           R3, [R4,#0x210]                                        ; +0x92, 0x4ccf02\nCBNZ            R3, loc_4CCF0C                                         ; +0x96, 0x4ccf06\nCBZ             R6, loc_4CCF48                                         ; +0x98, 0x4ccf08\nB               loc_4CCF4E                                             ; +0x9a, 0x4ccf0a\nLDR             R3, [R3,#0x34]                                         ; +0x9c, 0x4ccf0c\nCBZ             R3, loc_4CCF16                                         ; +0x9e, 0x4ccf0e\nLDR.W           R5, [R3,#0x110]                                        ; +0xa0, 0x4ccf10\nB               loc_4CCF3E                                             ; +0xa4, 0x4ccf14\nMOV             R5, R3                                                 ; +0xa6, 0x4ccf16\nB               loc_4CCF3E                                             ; +0xa8, 0x4ccf18\nMOV             R0, R7                                                 ; +0xaa, 0x4ccf1a\nMOV             R1, R8                                                 ; +0xac, 0x4ccf1c\nLDR.W           R10, [R3,#0x104]                                       ; +0xae, 0x4ccf1e\nBL              sub_775C20                                             ; +0xb2, 0x4ccf22\nMOV             R0, R10                                                ; +0xb6, 0x4ccf26\nMOV             R1, R7                                                 ; +0xb8, 0x4ccf28\nBL              _ZN13ChallengeNode15updateTimeLabelESs; ChallengeNode::updateTimeLabel(std::string) ; +0xba, 0x4ccf2a\nMOV             R0, R7                                                 ; +0xbe, 0x4ccf2e\nBL              sub_774008                                             ; +0xc0, 0x4ccf30\nCBZ             R5, loc_4CCF44                                         ; +0xc4, 0x4ccf34\nLDR.W           R2, [R5,#0x110]                                        ; +0xc6, 0x4ccf36\nMOV             R3, R5                                                 ; +0xca, 0x4ccf3a\nMOV             R5, R2                                                 ; +0xcc, 0x4ccf3c\nCMP             R3, #0                                                 ; +0xce, 0x4ccf3e\nBNE             loc_4CCF1A                                             ; +0xd0, 0x4ccf40\nB               loc_4CCF08                                             ; +0xd2, 0x4ccf42\nMOV             R2, R5                                                 ; +0xd4, 0x4ccf44\nB               loc_4CCF3A                                             ; +0xd6, 0x4ccf46\nLDRB.W          R3, [R4,#0x209]                                        ; +0xd8, 0x4ccf48\nCBZ             R3, loc_4CCF56                                         ; +0xdc, 0x4ccf4c\nMOV             R0, R8                                                 ; +0xde, 0x4ccf4e\nBL              sub_774008                                             ; +0xe0, 0x4ccf50\nB               loc_4CCFA0                                             ; +0xe4, 0x4ccf54\nLDR.W           R0, [R4,#0x204]                                        ; +0xe6, 0x4ccf56\nMOVS            R1, #1                                                 ; +0xea, 0x4ccf5a\nLDR             R3, [R0]                                               ; +0xec, 0x4ccf5c\nLDR.W           R3, [R3,#0xA4]                                         ; +0xee, 0x4ccf5e\nBLX             R3                                                     ; +0xf2, 0x4ccf62\nLDR.W           R0, [R4,#0x200]                                        ; +0xf4, 0x4ccf64\nMOVS            R1, #0                                                 ; +0xf8, 0x4ccf68\nLDR             R3, [R0]                                               ; +0xfa, 0x4ccf6a\nLDR.W           R3, [R3,#0xA4]                                         ; +0xfc, 0x4ccf6c\nBLX             R3                                                     ; +0x100, 0x4ccf70\nMOVS            R3, #1                                                 ; +0x102, 0x4ccf72\nSTRB.W          R3, [R4,#0x209]                                        ; +0x104, 0x4ccf74\nMOVS            R3, #0                                                 ; +0x108, 0x4ccf78\nSTRB.W          R3, [R4,#0x208]                                        ; +0x10a, 0x4ccf7a\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x10e, 0x4ccf7e\nBL              _ZN16GameStatsManager19resetChallengeTimerEv; GameStatsManager::resetChallengeTimer(void) ; +0x112, 0x4ccf82\nMOV             R0, R4; this                                           ; +0x116, 0x4ccf86\nBL              _ZN14ChallengesPage16tryGetChallengesEv; ChallengesPage::tryGetChallenges(void) ; +0x118, 0x4ccf88\nB               loc_4CCF4E                                             ; +0x11c, 0x4ccf8c\nMOV             R0, R7                                                 ; +0x11e, 0x4ccf8e\nBL              sub_774008                                             ; +0x120, 0x4ccf90\nB               loc_4CCF96                                             ; +0x124, 0x4ccf94\nMOV             R0, R8                                                 ; +0x126, 0x4ccf96\nBL              sub_774008                                             ; +0x128, 0x4ccf98\nBL              __cxa_end_cleanup                                      ; +0x12c, 0x4ccf9c\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x130, 0x4ccfa0\nLDR.W           R3, [R9]                                               ; +0x132, 0x4ccfa2\nCMP             R2, R3                                                 ; +0x136, 0x4ccfa6\nBEQ             loc_4CCFAE                                             ; +0x138, 0x4ccfa8\nBLX             __stack_chk_fail                                       ; +0x13a, 0x4ccfaa\nADD             SP, SP, #0x10                                          ; +0x13e, 0x4ccfae\nVPOP            {D8}                                                   ; +0x140, 0x4ccfb0\nPOP.W           {R4-R10,PC}                                            ; +0x144, 0x4ccfb4", "xrefs": ["ChallengesPage::challengeStatusFinished @ 0x4ccfe2", "ChallengesPage::challengeStatusFinished @ 0x4cd042", "ChallengesPage::claimItem @ 0x4cd170"], "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"}