{"type": "func", "start": 5368955472, "end": 5368955677, "name": "AchievementManager::percentForAchievement", "pseudocode": "// \n// AchievementManager::percentForAchievement from 0x14003c250 to 0x14003c31d (205 bytes)\n// \n// 16 xrefs:\n// > AchievementManager::isAchievementEarned @ 0x14003c234\n// > AchievementManager::reportAchievementWithID @ 0x14003d010\n// > AchievementManager::reportAchievementWithID @ 0x14003d024\n// > GameManager::syncPlatformAchievements @ 0x14008b3c7\n// > AchievementCell::loadFromDict @ 0x140147221\n// > AchievementCell::loadFromDict @ 0x14014859d\n// > GameLevelManager::onGetNotificationsCompleted @ 0x140250b43\n// > GameManager::resetAchievement @ 0x140278341\n// > GameManager::reportAchievementWithID @ 0x140279103\n// > GameManager::dataLoaded @ 0x140283ecb\n// > GameStatsManager::verifyUserCoins @ 0x1402e35e5\n// > GameStatsManager::recountSpecialStats @ 0x1402e8c5d\n// > GJGarageLayer::dialogClosed @ 0x140381046\n// > GJPathPage::init @ 0x1403943d3\n// > GJPathPage::unlockAnimationStep3 @ 0x140396b04\n// > <???> @ 0x14090eff0\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:25:27 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall AchievementManager::percentForAchievement(__int64 a1, __int64 a2)\n{\n  __int64 v3; // r8\n  cocos2d::CCString *v4; // rax\n  unsigned int v5; // ebx\n  void *v6; // r8\n  void *Block[2]; // [rsp+30h] [rbp-38h] BYREF\n  __int128 v9; // [rsp+40h] [rbp-28h]\n\n  *(_OWORD *)Block = 0;\n  v9 = 0;\n  v3 = -1;\n  do\n    ++v3;\n  while ( *(_BYTE *)(a2 + v3) );\n  sub_14003D230(Block);\n  v4 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(a1 + 352), Block);\n  v5 = cocos2d::CCString::intValue(v4);\n  if ( *((_QWORD *)&v9 + 1) > 0xFu )\n  {\n    v6 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v9 + 1) + 1LL) >= 0x1000 )\n    {\n      v6 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v6);\n  }\n  return v5;\n}", "assembly": "; \n; AchievementManager::percentForAchievement from 0x14003c250 to 0x14003c31d (205 bytes)\n; \n; 16 xrefs:\n; > AchievementManager::isAchievementEarned @ 0x14003c234\n; > AchievementManager::reportAchievementWithID @ 0x14003d010\n; > AchievementManager::reportAchievementWithID @ 0x14003d024\n; > GameManager::syncPlatformAchievements @ 0x14008b3c7\n; > AchievementCell::loadFromDict @ 0x140147221\n; > AchievementCell::loadFromDict @ 0x14014859d\n; > GameLevelManager::onGetNotificationsCompleted @ 0x140250b43\n; > GameManager::resetAchievement @ 0x140278341\n; > GameManager::reportAchievementWithID @ 0x140279103\n; > GameManager::dataLoaded @ 0x140283ecb\n; > GameStatsManager::verifyUserCoins @ 0x1402e35e5\n; > GameStatsManager::recountSpecialStats @ 0x1402e8c5d\n; > GJGarageLayer::dialogClosed @ 0x140381046\n; > GJPathPage::init @ 0x1403943d3\n; > GJPathPage::unlockAnimationStep3 @ 0x140396b04\n; > <???> @ 0x14090eff0\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:25:27 +0000\n; \npush    rbx                                                            ; +0x0, 0x14003c250\nsub     rsp, 60h                                                       ; +0x2, 0x14003c252\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x14003c256\nxor     rax, rsp                                                       ; +0xd, 0x14003c25d\nmov     [rsp+68h+var_18], rax                                          ; +0x10, 0x14003c260\nmov     rbx, rcx                                                       ; +0x15, 0x14003c265\nxorps   xmm0, xmm0                                                     ; +0x18, 0x14003c268\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x1b, 0x14003c26b\nxorps   xmm1, xmm1                                                     ; +0x20, 0x14003c270\nmovdqu  [rsp+68h+var_28], xmm1                                         ; +0x23, 0x14003c273\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x29, 0x14003c279\ninc     r8                                                             ; +0x30, 0x14003c280\ncmp     byte ptr [rdx+r8], 0                                           ; +0x33, 0x14003c283\njnz     short loc_14003C280                                            ; +0x38, 0x14003c288\nlea     rcx, [rsp+68h+Block]                                           ; +0x3a, 0x14003c28a\ncall    sub_14003D230                                                  ; +0x3f, 0x14003c28f\nnop                                                                    ; +0x44, 0x14003c294\nlea     rdx, [rsp+68h+Block]                                           ; +0x45, 0x14003c295\nmov     rcx, [rbx+160h]                                                ; +0x4a, 0x14003c29a\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0x51, 0x14003c2a1\nmov     rcx, rax                                                       ; +0x57, 0x14003c2a7\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x5a, 0x14003c2aa\nmov     ebx, eax                                                       ; +0x60, 0x14003c2b0\nmov     rdx, qword ptr [rsp+68h+var_28+8]                              ; +0x62, 0x14003c2b2\ncmp     rdx, 0Fh                                                       ; +0x67, 0x14003c2b7\njbe     short loc_14003C308                                            ; +0x6b, 0x14003c2bb\ninc     rdx                                                            ; +0x6d, 0x14003c2bd\nmov     r8, [rsp+68h+Block]                                            ; +0x70, 0x14003c2c0\nmov     rcx, r8                                                        ; +0x75, 0x14003c2c5\ncmp     rdx, 1000h                                                     ; +0x78, 0x14003c2c8\njb      short loc_14003C300                                            ; +0x7f, 0x14003c2cf\nadd     rdx, 27h ; '''                                                 ; +0x81, 0x14003c2d1\nmov     r8, [r8-8]                                                     ; +0x85, 0x14003c2d5\nsub     rcx, r8                                                        ; +0x89, 0x14003c2d9\nsub     rcx, 8                                                         ; +0x8c, 0x14003c2dc\ncmp     rcx, 1Fh                                                       ; +0x90, 0x14003c2e0\njbe     short loc_14003C300                                            ; +0x94, 0x14003c2e4\nmov     [rsp+68h+Reserved], 0; Reserved                                ; +0x96, 0x14003c2e6\nxor     r9d, r9d; LineNo                                               ; +0x9f, 0x14003c2ef\nxor     r8d, r8d; FileName                                             ; +0xa2, 0x14003c2f2\nxor     edx, edx; FunctionName                                         ; +0xa5, 0x14003c2f5\nxor     ecx, ecx; Expression                                           ; +0xa7, 0x14003c2f7\ncall    cs:_invoke_watson                                              ; +0xa9, 0x14003c2f9\nalign 20h                                                              ; +0xaf, 0x14003c2ff\nmov     rcx, r8; Block                                                 ; +0xb0, 0x14003c300\ncall    j_j_free                                                       ; +0xb3, 0x14003c303\nmov     eax, ebx                                                       ; +0xb8, 0x14003c308\nmov     rcx, [rsp+68h+var_18]                                          ; +0xba, 0x14003c30a\nxor     rcx, rsp; StackCookie                                          ; +0xbf, 0x14003c30f\ncall    __security_check_cookie                                        ; +0xc2, 0x14003c312\nadd     rsp, 60h                                                       ; +0xc7, 0x14003c317\npop     rbx                                                            ; +0xcb, 0x14003c31b\nretn                                                                   ; +0xcc, 0x14003c31c", "xrefs": ["AchievementManager::isAchievementEarned @ 0x14003c234", "AchievementManager::reportAchievementWithID @ 0x14003d010", "AchievementManager::reportAchievementWithID @ 0x14003d024", "GameManager::syncPlatformAchievements @ 0x14008b3c7", "AchievementCell::loadFromDict @ 0x140147221", "AchievementCell::loadFromDict @ 0x14014859d", "GameLevelManager::onGetNotificationsCompleted @ 0x140250b43", "GameManager::resetAchievement @ 0x140278341", "GameManager::reportAchievementWithID @ 0x140279103", "GameManager::dataLoaded @ 0x140283ecb", "GameStatsManager::verifyUserCoins @ 0x1402e35e5", "GameStatsManager::recountSpecialStats @ 0x1402e8c5d", "GJGarageLayer::dialogClosed @ 0x140381046", "GJPathPage::init @ 0x1403943d3", "GJPathPage::unlockAnimationStep3 @ 0x140396b04", "<???> @ 0x14090eff0"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}