{"type": "func", "start": 5368957456, "end": 5368958124, "name": "AchievementManager::achievementForUnlock", "pseudocode": "// \n// AchievementManager::achievementForUnlock from 0x14003ca10 to 0x14003ccac (668 bytes)\n// \n// 5 xrefs:\n// > GameStatsManager::generateItemUnlockableData @ 0x1402d6e70\n// > GJGarageLayer::descriptionForUnlock @ 0x140380c63\n// > ItemInfoPopup::init @ 0x140384628\n// > ItemInfoPopup::init @ 0x140385496\n// > <???> @ 0x14090f020\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=2\n_QWORD *__fastcall AchievementManager::achievementForUnlock(__int64 a1, _QWORD *a2, int a3, int a4)\n{\n  int v4; // ebx\n  const char *v8; // rax\n  __int64 v9; // rax\n  __int64 v10; // rbx\n  __int64 v11; // r8\n  cocos2d::CCString *v12; // rax\n  const char *CString; // rax\n  void *v14; // rcx\n  void *Block[2]; // [rsp+40h] [rbp-C0h] BYREF\n  __m128i si128; // [rsp+50h] [rbp-B0h]\n  _BYTE v18[528]; // [rsp+60h] [rbp-A0h] BYREF\n\n  v4 = a4 - 1;\n  Block[0] = a2;\n  fmt::BasicWriter<char>::BasicWriter<char>(v18);\n  switch ( v4 )\n  {\n    case 0:\n      v8 = \"icon_\";\n      break;\n    case 1:\n      v8 = \"color_\";\n      break;\n    case 2:\n      v8 = \"color2_\";\n      break;\n    case 3:\n      v8 = \"ship_\";\n      break;\n    case 4:\n      v8 = \"ball_\";\n      break;\n    case 5:\n      v8 = \"bird_\";\n      break;\n    case 6:\n      v8 = \"dart_\";\n      break;\n    case 7:\n      v8 = \"robot_\";\n      break;\n    case 8:\n      v8 = \"spider_\";\n      break;\n    case 9:\n      v8 = \"special_\";\n      break;\n    case 10:\n      v8 = \"death_\";\n      break;\n    case 11:\n      v8 = \"item_\";\n      break;\n    case 12:\n      v8 = \"swing_\";\n      break;\n    case 13:\n      v8 = \"jetpack_\";\n      break;\n    case 14:\n      v8 = \"shipstreak_\";\n      break;\n    default:\n      v8 = \" _\";\n      break;\n  }\n  Block[0] = (void *)v8;\n  Block[1] = nullptr;\n  fmt::BasicWriter<char>::operator<<(v18, Block);\n  if ( a3 < 10 )\n  {\n    Block[0] = \"0\";\n    Block[1] = nullptr;\n    fmt::BasicWriter<char>::operator<<(v18, Block);\n  }\n  fmt::BasicWriter<char>::operator<<(v18, (unsigned int)a3);\n  v9 = fmt::BasicWriter<char>::c_str(v18);\n  *(_OWORD *)Block = 0;\n  si128 = 0;\n  v10 = -1;\n  v11 = -1;\n  do\n    ++v11;\n  while ( *(_BYTE *)(v9 + v11) );\n  sub_14003D230(Block);\n  v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(a1 + 336), Block);\n  CString = cocos2d::CCString::getCString(v12);\n  *(_OWORD *)a2 = 0;\n  a2[2] = 0;\n  a2[3] = 0;\n  do\n    ++v10;\n  while ( CString[v10] );\n  sub_14003D230(a2);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v14 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v14 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v14);\n  }\n  si128 = _mm_load_si128((const __m128i *)&Size);\n  LOBYTE(Block[0]) = 0;\n  fmt::BasicWriter<char>::~BasicWriter<char>(v18);\n  return a2;\n}", "assembly": "; \n; AchievementManager::achievementForUnlock from 0x14003ca10 to 0x14003ccac (668 bytes)\n; \n; 5 xrefs:\n; > GameStatsManager::generateItemUnlockableData @ 0x1402d6e70\n; > GJGarageLayer::descriptionForUnlock @ 0x140380c63\n; > ItemInfoPopup::init @ 0x140384628\n; > ItemInfoPopup::init @ 0x140385496\n; > <???> @ 0x14090f020\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; \nmov     [rsp-8+arg_18], rbx                                            ; +0x0, 0x14003ca10\npush    rbp                                                            ; +0x5, 0x14003ca15\npush    rsi                                                            ; +0x6, 0x14003ca16\npush    rdi                                                            ; +0x7, 0x14003ca17\npush    r14                                                            ; +0x8, 0x14003ca18\npush    r15                                                            ; +0xa, 0x14003ca1a\nlea     rbp, [rsp-180h]                                                ; +0xc, 0x14003ca1c\nsub     rsp, 280h                                                      ; +0x14, 0x14003ca24\nmov     rax, cs:__security_cookie                                      ; +0x1b, 0x14003ca2b\nxor     rax, rsp                                                       ; +0x22, 0x14003ca32\nmov     [rbp+1A0h+var_30], rax                                         ; +0x25, 0x14003ca35\nlea     ebx, [r9-1]; switch 15 cases                                   ; +0x2c, 0x14003ca3c\nmov     esi, r8d                                                       ; +0x30, 0x14003ca40\nmov     rdi, rdx                                                       ; +0x33, 0x14003ca43\nmov     r14, rcx                                                       ; +0x36, 0x14003ca46\nmov     [rsp+2A0h+Block], rdx                                          ; +0x39, 0x14003ca49\nxor     r15d, r15d                                                     ; +0x3e, 0x14003ca4e\nlea     rcx, [rsp+2A0h+var_240]                                        ; +0x41, 0x14003ca51\ncall    cs:??0?$BasicWriter@D@fmt@@QEAA@XZ; fmt::BasicWriter<char>::BasicWriter<char>(void) ; +0x46, 0x14003ca56\nnop                                                                    ; +0x4c, 0x14003ca5c\ncmp     ebx, 0Eh                                                       ; +0x4d, 0x14003ca5d\nja      def_14003CA7A; jumptable 000000014003CA7A default case         ; +0x50, 0x14003ca60\nmovsxd  rax, ebx                                                       ; +0x56, 0x14003ca66\nlea     rdx, cs:140000000h                                             ; +0x59, 0x14003ca69\nmov     ecx, ds:(jpt_14003CA7A - 140000000h)[rdx+rax*4]                ; +0x60, 0x14003ca70\nadd     rcx, rdx                                                       ; +0x67, 0x14003ca77\njmp     rcx; switch jump                                               ; +0x6a, 0x14003ca7a\nlea     rax, aIcon; jumptable 000000014003CA7A case 1                  ; +0x6c, 0x14003ca7c\njmp     loc_14003CB0D                                                  ; +0x73, 0x14003ca83\nlea     rax, aColor; jumptable 000000014003CA7A case 2                 ; +0x78, 0x14003ca88\njmp     short loc_14003CB0D                                            ; +0x7f, 0x14003ca8f\nlea     rax, aColor2; jumptable 000000014003CA7A case 3                ; +0x81, 0x14003ca91\njmp     short loc_14003CB0D                                            ; +0x88, 0x14003ca98\nlea     rax, aShip; jumptable 000000014003CA7A case 4                  ; +0x8a, 0x14003ca9a\njmp     short loc_14003CB0D                                            ; +0x91, 0x14003caa1\nlea     rax, aBall; jumptable 000000014003CA7A case 5                  ; +0x93, 0x14003caa3\njmp     short loc_14003CB0D                                            ; +0x9a, 0x14003caaa\nlea     rax, aBird; jumptable 000000014003CA7A case 6                  ; +0x9c, 0x14003caac\njmp     short loc_14003CB0D                                            ; +0xa3, 0x14003cab3\nlea     rax, aDart; jumptable 000000014003CA7A case 7                  ; +0xa5, 0x14003cab5\njmp     short loc_14003CB0D                                            ; +0xac, 0x14003cabc\nlea     rax, aRobot; jumptable 000000014003CA7A case 8                 ; +0xae, 0x14003cabe\njmp     short loc_14003CB0D                                            ; +0xb5, 0x14003cac5\nlea     rax, aSpider; jumptable 000000014003CA7A case 9                ; +0xb7, 0x14003cac7\njmp     short loc_14003CB0D                                            ; +0xbe, 0x14003cace\nlea     rax, aSpecial; jumptable 000000014003CA7A case 10              ; +0xc0, 0x14003cad0\njmp     short loc_14003CB0D                                            ; +0xc7, 0x14003cad7\nlea     rax, aDeath; jumptable 000000014003CA7A case 11                ; +0xc9, 0x14003cad9\njmp     short loc_14003CB0D                                            ; +0xd0, 0x14003cae0\nlea     rax, aSwing; jumptable 000000014003CA7A case 13                ; +0xd2, 0x14003cae2\njmp     short loc_14003CB0D                                            ; +0xd9, 0x14003cae9\nlea     rax, aJetpack; jumptable 000000014003CA7A case 14              ; +0xdb, 0x14003caeb\njmp     short loc_14003CB0D                                            ; +0xe2, 0x14003caf2\nlea     rax, aItem; jumptable 000000014003CA7A case 12                 ; +0xe4, 0x14003caf4\njmp     short loc_14003CB0D                                            ; +0xeb, 0x14003cafb\nlea     rax, aShipstreak; jumptable 000000014003CA7A case 15           ; +0xed, 0x14003cafd\njmp     short loc_14003CB0D                                            ; +0xf4, 0x14003cb04\nlea     rax, asc_1406FE78C; jumptable 000000014003CA7A default case    ; +0xf6, 0x14003cb06\nmov     [rsp+2A0h+Block], rax                                          ; +0xfd, 0x14003cb0d\nmov     [rsp+2A0h+Block+8], r15                                        ; +0x102, 0x14003cb12\nlea     rdx, [rsp+2A0h+Block]                                          ; +0x107, 0x14003cb17\nlea     rcx, [rsp+2A0h+var_240]                                        ; +0x10c, 0x14003cb1c\ncall    cs:??6?$BasicWriter@D@fmt@@QEAAAEAV01@V?$BasicStringRef@D@1@@Z; fmt::BasicWriter<char>::operator<<(fmt::BasicStringRef<char>) ; +0x111, 0x14003cb21\ncmp     esi, 0Ah                                                       ; +0x117, 0x14003cb27\njge     short loc_14003CB4D                                            ; +0x11a, 0x14003cb2a\nlea     rax, a0; \"0\"                                                   ; +0x11c, 0x14003cb2c\nmov     [rsp+2A0h+Block], rax                                          ; +0x123, 0x14003cb33\nmov     [rsp+2A0h+Block+8], r15                                        ; +0x128, 0x14003cb38\nlea     rdx, [rsp+2A0h+Block]                                          ; +0x12d, 0x14003cb3d\nlea     rcx, [rsp+2A0h+var_240]                                        ; +0x132, 0x14003cb42\ncall    cs:??6?$BasicWriter@D@fmt@@QEAAAEAV01@V?$BasicStringRef@D@1@@Z; fmt::BasicWriter<char>::operator<<(fmt::BasicStringRef<char>) ; +0x137, 0x14003cb47\nmov     edx, esi                                                       ; +0x13d, 0x14003cb4d\nlea     rcx, [rsp+2A0h+var_240]                                        ; +0x13f, 0x14003cb4f\ncall    cs:??6?$BasicWriter@D@fmt@@QEAAAEAV01@H@Z; fmt::BasicWriter<char>::operator<<(int) ; +0x144, 0x14003cb54\nlea     rcx, [rsp+2A0h+var_240]                                        ; +0x14a, 0x14003cb5a\ncall    cs:?c_str@?$BasicWriter@D@fmt@@QEBAPEBDXZ; fmt::BasicWriter<char>::c_str(void) ; +0x14f, 0x14003cb5f\nxorps   xmm0, xmm0                                                     ; +0x155, 0x14003cb65\nmovups  xmmword ptr [rsp+2A0h+Block], xmm0                             ; +0x158, 0x14003cb68\nxorps   xmm1, xmm1                                                     ; +0x15d, 0x14003cb6d\nmovdqu  [rsp+2A0h+var_250], xmm1                                       ; +0x160, 0x14003cb70\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0x166, 0x14003cb76\nmov     r8, rbx                                                        ; +0x16d, 0x14003cb7d\ninc     r8                                                             ; +0x170, 0x14003cb80\ncmp     byte ptr [rax+r8], 0                                           ; +0x173, 0x14003cb83\njnz     short loc_14003CB80                                            ; +0x178, 0x14003cb88\nmov     rdx, rax                                                       ; +0x17a, 0x14003cb8a\nlea     rcx, [rsp+2A0h+Block]                                          ; +0x17d, 0x14003cb8d\ncall    sub_14003D230                                                  ; +0x182, 0x14003cb92\nnop                                                                    ; +0x187, 0x14003cb97\nlea     rdx, [rsp+2A0h+Block]                                          ; +0x188, 0x14003cb98\nmov     rcx, [r14+150h]                                                ; +0x18d, 0x14003cb9d\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 &) ; +0x194, 0x14003cba4\nmov     rcx, rax                                                       ; +0x19a, 0x14003cbaa\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x19d, 0x14003cbad\nxorps   xmm0, xmm0                                                     ; +0x1a3, 0x14003cbb3\nmovups  xmmword ptr [rdi], xmm0                                        ; +0x1a6, 0x14003cbb6\nmov     [rdi+10h], r15                                                 ; +0x1a9, 0x14003cbb9\nmov     [rdi+18h], r15                                                 ; +0x1ad, 0x14003cbbd\ninc     rbx                                                            ; +0x1b1, 0x14003cbc1\ncmp     byte ptr [rax+rbx], 0                                          ; +0x1b4, 0x14003cbc4\njnz     short loc_14003CBC1                                            ; +0x1b8, 0x14003cbc8\nmov     r8, rbx                                                        ; +0x1ba, 0x14003cbca\nmov     rdx, rax                                                       ; +0x1bd, 0x14003cbcd\nmov     rcx, rdi                                                       ; +0x1c0, 0x14003cbd0\ncall    sub_14003D230                                                  ; +0x1c3, 0x14003cbd3\nnop                                                                    ; +0x1c8, 0x14003cbd8\nmov     rdx, qword ptr [rsp+2A0h+var_250+8]                            ; +0x1c9, 0x14003cbd9\ncmp     rdx, 0Fh                                                       ; +0x1ce, 0x14003cbde\njbe     short loc_14003CC28                                            ; +0x1d2, 0x14003cbe2\ninc     rdx                                                            ; +0x1d4, 0x14003cbe4\nmov     rcx, [rsp+2A0h+Block]; Block                                   ; +0x1d7, 0x14003cbe7\nmov     rax, rcx                                                       ; +0x1dc, 0x14003cbec\ncmp     rdx, 1000h                                                     ; +0x1df, 0x14003cbef\njb      short loc_14003CC23                                            ; +0x1e6, 0x14003cbf6\nadd     rdx, 27h ; '''                                                 ; +0x1e8, 0x14003cbf8\nmov     rcx, [rcx-8]                                                   ; +0x1ec, 0x14003cbfc\nsub     rax, rcx                                                       ; +0x1f0, 0x14003cc00\nsub     rax, 8                                                         ; +0x1f3, 0x14003cc03\ncmp     rax, 1Fh                                                       ; +0x1f7, 0x14003cc07\njbe     short loc_14003CC23                                            ; +0x1fb, 0x14003cc0b\nmov     [rsp+2A0h+Reserved], r15; Reserved                             ; +0x1fd, 0x14003cc0d\nxor     r9d, r9d; LineNo                                               ; +0x202, 0x14003cc12\nxor     r8d, r8d; FileName                                             ; +0x205, 0x14003cc15\nxor     edx, edx; FunctionName                                         ; +0x208, 0x14003cc18\nxor     ecx, ecx; Expression                                           ; +0x20a, 0x14003cc1a\ncall    cs:_invoke_watson                                              ; +0x20c, 0x14003cc1c\ndb 0CCh                                                                ; +0x212, 0x14003cc22\ncall    j_j_free                                                       ; +0x213, 0x14003cc23\nmovdqa  xmm0, cs:Size                                                  ; +0x218, 0x14003cc28\nmovdqu  [rsp+2A0h+var_250], xmm0                                       ; +0x220, 0x14003cc30\nmov     byte ptr [rsp+2A0h+Block], 0                                   ; +0x226, 0x14003cc36\nlea     rcx, [rsp+2A0h+var_240]                                        ; +0x22b, 0x14003cc3b\ncall    cs:__imp_??1?$BasicWriter@D@fmt@@QEAA@XZ; fmt::BasicWriter<char>::~BasicWriter<char>(void) ; +0x230, 0x14003cc40\nmov     rax, rdi                                                       ; +0x236, 0x14003cc46\nmov     rcx, [rbp+1A0h+var_30]                                         ; +0x239, 0x14003cc49\nxor     rcx, rsp; StackCookie                                          ; +0x240, 0x14003cc50\ncall    __security_check_cookie                                        ; +0x243, 0x14003cc53\nmov     rbx, [rsp+2A0h+arg_18]                                         ; +0x248, 0x14003cc58\nadd     rsp, 280h                                                      ; +0x250, 0x14003cc60\npop     r15                                                            ; +0x257, 0x14003cc67\npop     r14                                                            ; +0x259, 0x14003cc69\npop     rdi                                                            ; +0x25b, 0x14003cc6b\npop     rsi                                                            ; +0x25c, 0x14003cc6c\npop     rbp                                                            ; +0x25d, 0x14003cc6d\nretn                                                                   ; +0x25e, 0x14003cc6e\nalign 10h                                                              ; +0x25f, 0x14003cc6f\ndd offset loc_14003CA7C - 140000000h; jump table for switch statement  ; +0x260, 0x14003cc70", "xrefs": ["GameStatsManager::generateItemUnlockableData @ 0x1402d6e70", "GJGarageLayer::descriptionForUnlock @ 0x140380c63", "ItemInfoPopup::init @ 0x140384628", "ItemInfoPopup::init @ 0x140385496", "<???> @ 0x14090f020"], "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"}