{"type": "func", "start": 5370270192, "end": 5370270640, "name": "GameManager::completedAchievement", "pseudocode": "// \n// GameManager::completedAchievement from 0x14017d1f0 to 0x14017d3b0 (448 bytes)\n// \n// 4 xrefs:\n// > GameManager::reportAchievementWithID @ 0x14017e075\n// > GameManager::dataLoaded @ 0x140187bf0\n// > <???> @ 0x1406cb3b8\n// > <???> @ 0x1406cb3c4\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\n// Hidden C++ exception states: #wind=2\nvoid __fastcall GameManager::completedAchievement(__int64 a1, __int64 a2)\n{\n  int v4; // ebx\n  __int64 *v5; // rax\n  __int64 v6; // rcx\n  __int64 v7; // rcx\n  _QWORD *v8; // rbx\n  struct cocos2d::CCString *v9; // rax\n  _QWORD *v10; // rbx\n  struct cocos2d::CCString *v11; // rax\n  unsigned int v12; // [rsp+20h] [rbp-48h] BYREF\n  int v13[3]; // [rsp+24h] [rbp-44h] BYREF\n  __int64 v14; // [rsp+30h] [rbp-38h]\n  _QWORD v15[4]; // [rsp+38h] [rbp-30h] BYREF\n\n  v14 = a2;\n  v4 = 0;\n  v12 = 0;\n  v13[0] = 0;\n  v5 = (__int64 *)sub_14003BDB0((__int64)v15, a2);\n  GameManager::getUnlockForAchievement(v6, v5, &v12, v13);\n  if ( v13[0] )\n  {\n    if ( (unsigned int)(v13[0] - 2) <= 1 )\n    {\n      v10 = GameManager::colorKey(v7, v15, v12, v13[0]);\n      v11 = cocos2d::CCString::createWithFormat(\"%i\", 1);\n      cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 408), v11, v10);\n    }\n    else\n    {\n      switch ( v13[0] )\n      {\n        case 4:\n          v4 = 1;\n          break;\n        case 5:\n          v4 = 2;\n          break;\n        case 6:\n          v4 = 3;\n          break;\n        case 7:\n          v4 = 4;\n          break;\n        case 8:\n          v4 = 5;\n          break;\n        case 9:\n          v4 = 6;\n          break;\n        case 0xA:\n          v4 = 99;\n          break;\n        case 0xB:\n          v4 = 98;\n          break;\n        case 0xC:\n          v4 = 100;\n          break;\n        case 0xD:\n          v4 = 7;\n          break;\n        case 0xE:\n          v4 = 8;\n          break;\n        case 0xF:\n          v4 = 101;\n          break;\n        default:\n          break;\n      }\n      v8 = GameManager::iconKey(v7, v15, v12, v4);\n      v9 = cocos2d::CCString::createWithFormat(\"%i\", 1);\n      cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 408), v9, v8);\n    }\n    sub_14003A830((__int64)v15);\n  }\n  sub_14003A830(a2);\n}", "assembly": "; \n; GameManager::completedAchievement from 0x14017d1f0 to 0x14017d3b0 (448 bytes)\n; \n; 4 xrefs:\n; > GameManager::reportAchievementWithID @ 0x14017e075\n; > GameManager::dataLoaded @ 0x140187bf0\n; > <???> @ 0x1406cb3b8\n; > <???> @ 0x1406cb3c4\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\nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x14017d1f0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x14017d1f5\npush    rdi                                                            ; +0xa, 0x14017d1fa\nsub     rsp, 60h                                                       ; +0xb, 0x14017d1fb\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x14017d1ff\nxor     rax, rsp                                                       ; +0x16, 0x14017d206\nmov     [rsp+68h+var_10], rax                                          ; +0x19, 0x14017d209\nmov     rdi, rdx                                                       ; +0x1e, 0x14017d20e\nmov     rsi, rcx                                                       ; +0x21, 0x14017d211\nmov     [rsp+68h+var_38], rdx                                          ; +0x24, 0x14017d214\nxor     ebx, ebx                                                       ; +0x29, 0x14017d219\nmov     [rsp+68h+var_48], ebx                                          ; +0x2b, 0x14017d21b\nmov     [rsp+68h+var_44], ebx                                          ; +0x2f, 0x14017d21f\nlea     rcx, [rsp+68h+var_30]                                          ; +0x33, 0x14017d223\ncall    sub_14003BDB0                                                  ; +0x38, 0x14017d228\nlea     r9, [rsp+68h+var_44]                                           ; +0x3d, 0x14017d22d\nlea     r8, [rsp+68h+var_48]                                           ; +0x42, 0x14017d232\nmov     rdx, rax                                                       ; +0x47, 0x14017d237\ncall    GameManager__getUnlockForAchievement                           ; +0x4a, 0x14017d23a\nmov     r9d, [rsp+68h+var_44]                                          ; +0x4f, 0x14017d23f\ntest    r9d, r9d                                                       ; +0x54, 0x14017d244\njz      loc_14017D34B                                                  ; +0x57, 0x14017d247\nlea     eax, [r9-2]                                                    ; +0x5d, 0x14017d24d\ncmp     eax, 1                                                         ; +0x61, 0x14017d251\njbe     loc_14017D308                                                  ; +0x64, 0x14017d254\ndec     r9d; switch 15 cases                                           ; +0x6a, 0x14017d25a\ncmp     r9d, 0Eh                                                       ; +0x6d, 0x14017d25d\nja      short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0x71, 0x14017d261\nmovsxd  rax, r9d                                                       ; +0x73, 0x14017d263\nlea     rdx, cs:140000000h                                             ; +0x76, 0x14017d266\nmov     ecx, ds:(jpt_14017D277 - 140000000h)[rdx+rax*4]                ; +0x7d, 0x14017d26d\nadd     rcx, rdx                                                       ; +0x84, 0x14017d274\njmp     rcx; switch jump                                               ; +0x87, 0x14017d277\nmov     ebx, 1; jumptable 000000014017D277 case 4                      ; +0x89, 0x14017d279\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0x8e, 0x14017d27e\nmov     ebx, 2; jumptable 000000014017D277 case 5                      ; +0x90, 0x14017d280\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0x95, 0x14017d285\nmov     ebx, 3; jumptable 000000014017D277 case 6                      ; +0x97, 0x14017d287\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0x9c, 0x14017d28c\nmov     ebx, 4; jumptable 000000014017D277 case 7                      ; +0x9e, 0x14017d28e\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xa3, 0x14017d293\nmov     ebx, 5; jumptable 000000014017D277 case 8                      ; +0xa5, 0x14017d295\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xaa, 0x14017d29a\nmov     ebx, 6; jumptable 000000014017D277 case 9                      ; +0xac, 0x14017d29c\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xb1, 0x14017d2a1\nmov     ebx, 7; jumptable 000000014017D277 case 13                     ; +0xb3, 0x14017d2a3\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xb8, 0x14017d2a8\nmov     ebx, 63h ; 'c'; jumptable 000000014017D277 case 10             ; +0xba, 0x14017d2aa\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xbf, 0x14017d2af\nmov     ebx, 62h ; 'b'; jumptable 000000014017D277 case 11             ; +0xc1, 0x14017d2b1\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xc6, 0x14017d2b6\nmov     ebx, 64h ; 'd'; jumptable 000000014017D277 case 12             ; +0xc8, 0x14017d2b8\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xcd, 0x14017d2bd\nmov     ebx, 8; jumptable 000000014017D277 case 14                     ; +0xcf, 0x14017d2bf\njmp     short def_14017D277; jumptable 000000014017D277 default case, cases 1-3 ; +0xd4, 0x14017d2c4\nmov     ebx, 65h ; 'e'; jumptable 000000014017D277 case 15             ; +0xd6, 0x14017d2c6\nmov     r9d, ebx; jumptable 000000014017D277 default case, cases 1-3   ; +0xdb, 0x14017d2cb\nmov     r8d, [rsp+68h+var_48]                                          ; +0xde, 0x14017d2ce\nlea     rdx, [rsp+68h+var_30]                                          ; +0xe3, 0x14017d2d3\ncall    GameManager__iconKey                                           ; +0xe8, 0x14017d2d8\nmov     rbx, rax                                                       ; +0xed, 0x14017d2dd\nmov     edx, 1                                                         ; +0xf0, 0x14017d2e0\nlea     rcx, aI_11; \"%i\"                                               ; +0xf5, 0x14017d2e5\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xfc, 0x14017d2ec\nmov     rdx, rax                                                       ; +0x102, 0x14017d2f2\nmov     r8, rbx                                                        ; +0x105, 0x14017d2f5\nmov     rcx, [rsi+198h]                                                ; +0x108, 0x14017d2f8\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x10f, 0x14017d2ff\nnop                                                                    ; +0x115, 0x14017d305\njmp     short loc_14017D340                                            ; +0x116, 0x14017d306\nmov     r8d, [rsp+68h+var_48]                                          ; +0x118, 0x14017d308\nlea     rdx, [rsp+68h+var_30]                                          ; +0x11d, 0x14017d30d\ncall    GameManager__colorKey                                          ; +0x122, 0x14017d312\nmov     rbx, rax                                                       ; +0x127, 0x14017d317\nmov     edx, 1                                                         ; +0x12a, 0x14017d31a\nlea     rcx, aI_11; \"%i\"                                               ; +0x12f, 0x14017d31f\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x136, 0x14017d326\nmov     rdx, rax                                                       ; +0x13c, 0x14017d32c\nmov     r8, rbx                                                        ; +0x13f, 0x14017d32f\nmov     rcx, [rsi+198h]                                                ; +0x142, 0x14017d332\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x149, 0x14017d339\nnop                                                                    ; +0x14f, 0x14017d33f\nlea     rcx, [rsp+68h+var_30]                                          ; +0x150, 0x14017d340\ncall    sub_14003A830                                                  ; +0x155, 0x14017d345\nnop                                                                    ; +0x15a, 0x14017d34a\nmov     rcx, rdi                                                       ; +0x15b, 0x14017d34b\ncall    sub_14003A830                                                  ; +0x15e, 0x14017d34e\nmov     rcx, [rsp+68h+var_10]                                          ; +0x163, 0x14017d353\nxor     rcx, rsp; StackCookie                                          ; +0x168, 0x14017d358\ncall    __security_check_cookie                                        ; +0x16b, 0x14017d35b\nlea     r11, [rsp+68h+var_8]                                           ; +0x170, 0x14017d360\nmov     rbx, [r11+20h]                                                 ; +0x175, 0x14017d365\nmov     rsi, [r11+28h]                                                 ; +0x179, 0x14017d369\nmov     rsp, r11                                                       ; +0x17d, 0x14017d36d\npop     rdi                                                            ; +0x180, 0x14017d370\nretn                                                                   ; +0x181, 0x14017d371\nalign 4                                                                ; +0x182, 0x14017d372\ndd offset def_14017D277 - 140000000h; jump table for switch statement  ; +0x184, 0x14017d374", "xrefs": ["GameManager::reportAchievementWithID @ 0x14017e075", "GameManager::dataLoaded @ 0x140187bf0", "<???> @ 0x1406cb3b8", "<???> @ 0x1406cb3c4"], "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"}