{"type": "func", "start": 5584548, "end": 5584788, "name": "AchievementManager::resetAchievement", "pseudocode": "// \n// AchievementManager::resetAchievement from 0x5536a4 to 0x553794 (240 bytes)\n// \n// 2 xrefs:\n// > GameManager::resetAchievement @ 0x5f43d8\n// > <???> @ 0x8abe8\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 AchievementManager::resetAchievement(AchievementManager *a1, const char *a2)\n{\n  cocos2d::CCDictionary *m_reportedAchievements; // x21\n  char *v3; // x0\n  unsigned int *v4; // x2\n  int v5; // w1\n  std::string v6; // [xsp+40h] [xbp+40h] BYREF\n\n  m_reportedAchievements = a1->m_reportedAchievements;\n  sub_D153B8((int)&v6, (char *)a2);\n  cocos2d::CCDictionary::removeObjectForKey(m_reportedAchievements, &v6);\n  v3 = (char *)v6.m_data.m_data - 24;\n  if ( (__int64 *)v6.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v4 = (unsigned int *)((char *)v6.m_data.m_data - 8);\n      do\n        v5 = __ldaxr(v4);\n      while ( __stlxr(v5 - 1, v4) );\n    }\n    else\n    {\n      v5 = *((_DWORD *)v6.m_data.m_data - 2);\n      *((_DWORD *)v6.m_data.m_data - 2) = v5 - 1;\n    }\n    if ( v5 <= 0 )\n      operator delete(v3);\n  }\n}", "assembly": "; \n; AchievementManager::resetAchievement from 0x5536a4 to 0x553794 (240 bytes)\n; \n; 2 xrefs:\n; > GameManager::resetAchievement @ 0x5f43d8\n; > <???> @ 0x8abe8\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, 0x5536a4\nMOV             X29, SP                                                ; +0x4, 0x5536a8\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x5536ac\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x5536b0\nADD             X20, X29, #0x50+var_10                                 ; +0x10, 0x5536b4\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x14, 0x5536b8\nADD             X2, X29, #0x50+var_20                                  ; +0x18, 0x5536bc\nLDR             X21, [X0,#0x160]                                       ; +0x1c, 0x5536c0\nMOV             X0, X20; int                                           ; +0x20, 0x5536c4\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x24, 0x5536c8\nLDR             X3, [X3]                                               ; +0x28, 0x5536cc\nSTR             X3, [X29,#0x50+var_8]                                  ; +0x2c, 0x5536d0\nBL              sub_D153B8                                             ; +0x30, 0x5536d4\nMOV             X0, X21                                                ; +0x34, 0x5536d8\nMOV             X1, X20                                                ; +0x38, 0x5536dc\nBL              _ZN7cocos2d12CCDictionary18removeObjectForKeyERKSs; cocos2d::CCDictionary::removeObjectForKey(std::string const&) ; +0x3c, 0x5536e0\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x40, 0x5536e4\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x44, 0x5536e8\nSUB             X0, X2, #0x18; p                                       ; +0x48, 0x5536ec\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x4c, 0x5536f0\nCMP             X0, X1                                                 ; +0x50, 0x5536f4\nB.NE            loc_553720                                             ; +0x54, 0x5536f8\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x58, 0x5536fc\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x5c, 0x553700\nLDR             X0, [X19]                                              ; +0x60, 0x553704\nCMP             X1, X0                                                 ; +0x64, 0x553708\nB.NE            loc_553764                                             ; +0x68, 0x55370c\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x6c, 0x553710\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x70, 0x553714\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x74, 0x553718\nRET                                                                    ; +0x78, 0x55371c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x7c, 0x553720\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x80, 0x553724\nCBZ             X1, loc_553754                                         ; +0x84, 0x553728\nSUB             X2, X2, #8                                             ; +0x88, 0x55372c\nLDAXR           W1, [X2]                                               ; +0x8c, 0x553730\nSUB             W3, W1, #1                                             ; +0x90, 0x553734\nSTLXR           W4, W3, [X2]                                           ; +0x94, 0x553738\nCBNZ            W4, loc_553730                                         ; +0x98, 0x55373c\nCMP             W1, WZR                                                ; +0x9c, 0x553740\nB.GT            loc_5536FC                                             ; +0xa0, 0x553744\nADD             X1, X29, #0x50+var_18                                  ; +0xa4, 0x553748\nBL              j__ZdlPv; operator delete(void *)                      ; +0xa8, 0x55374c\nB               loc_5536FC                                             ; +0xac, 0x553750\nLDUR            W1, [X2,#-8]                                           ; +0xb0, 0x553754\nSUB             W3, W1, #1                                             ; +0xb4, 0x553758\nSTUR            W3, [X2,#-8]                                           ; +0xb8, 0x55375c\nB               loc_553740                                             ; +0xbc, 0x553760\nBL              .__stack_chk_fail                                      ; +0xc0, 0x553764\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xc4, 0x553768\nMOV             X19, X0                                                ; +0xc8, 0x55376c\nLDR             X0, [X29,#0x50+var_10]                                 ; +0xcc, 0x553770\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xd0, 0x553774\nSUB             X0, X0, #0x18                                          ; +0xd4, 0x553778\nCMP             X0, X1                                                 ; +0xd8, 0x55377c\nB.EQ            loc_55378C                                             ; +0xdc, 0x553780\nADD             X1, X29, #0x50+var_18                                  ; +0xe0, 0x553784\nBL              sub_4EDFD8                                             ; +0xe4, 0x553788\nMOV             X0, X19                                                ; +0xe8, 0x55378c\nBL              _Unwind_Resume                                         ; +0xec, 0x553790", "xrefs": ["GameManager::resetAchievement @ 0x5f43d8", "<???> @ 0x8abe8"], "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"}