{"type": "func", "start": 5371298576, "end": 5371298966, "name": "GJGarageLayer::descriptionForUnlock", "pseudocode": "// \n// GJGarageLayer::descriptionForUnlock from 0x140278310 to 0x140278496 (390 bytes)\n// \n// 2 xrefs:\n// > ItemInfoPopup::init @ 0x14027cb29\n// > <???> @ 0x1406d0fec\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\n_QWORD *__fastcall GJGarageLayer::descriptionForUnlock(_QWORD *a1, int a2, int a3)\n{\n  AchievementManager *v6; // rax\n  _QWORD *v7; // rbx\n  AchievementManager *v8; // rax\n  __int64 AchievementsWithID; // rbx\n  cocos2d::CCString *v10; // rax\n  const char *CString; // rax\n  size_t v12; // r8\n  void *v13; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-68h] BYREF\n  __int64 v16; // [rsp+40h] [rbp-58h]\n  unsigned __int64 v17; // [rsp+48h] [rbp-50h]\n  _QWORD v18[4]; // [rsp+50h] [rbp-48h] BYREF\n\n  v6 = AchievementManager::sharedState();\n  AchievementManager::achievementForUnlock((__int64)v6, v18, a2, a3);\n  v7 = v18;\n  if ( v18[3] > 0xFu )\n    v7 = (_QWORD *)v18[0];\n  v8 = AchievementManager::sharedState();\n  AchievementsWithID = AchievementManager::getAchievementsWithID((__int64)v8, (__int64)v7);\n  *(_OWORD *)Block = 0;\n  Block[0] = sub_14003AA10(0x20u);\n  v16 = 21;\n  v17 = 31;\n  strcpy((char *)Block[0], \"unachievedDescription\");\n  v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(AchievementsWithID, Block);\n  CString = cocos2d::CCString::getCString(v10);\n  *(_OWORD *)a1 = 0;\n  a1[2] = 0;\n  a1[3] = 0;\n  v12 = -1;\n  do\n    ++v12;\n  while ( CString[v12] );\n  sub_14003A930(a1, CString, v12);\n  if ( v17 > 0xF )\n  {\n    v13 = Block[0];\n    if ( v17 + 1 >= 0x1000 )\n    {\n      v13 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v13);\n  }\n  v16 = 0;\n  v17 = 15;\n  LOBYTE(Block[0]) = 0;\n  sub_14003A830((__int64)v18);\n  return a1;\n}", "assembly": "; \n; GJGarageLayer::descriptionForUnlock from 0x140278310 to 0x140278496 (390 bytes)\n; \n; 2 xrefs:\n; > ItemInfoPopup::init @ 0x14027cb29\n; > <???> @ 0x1406d0fec\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_18], rbx                                              ; +0x0, 0x140278310\npush    rbp                                                            ; +0x5, 0x140278315\npush    rsi                                                            ; +0x6, 0x140278316\npush    rdi                                                            ; +0x7, 0x140278317\nsub     rsp, 80h                                                       ; +0x8, 0x140278318\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x14027831f\nxor     rax, rsp                                                       ; +0x16, 0x140278326\nmov     [rsp+98h+var_28], rax                                          ; +0x19, 0x140278329\nmov     edi, r8d                                                       ; +0x1e, 0x14027832e\nmov     ebx, edx                                                       ; +0x21, 0x140278331\nmov     rsi, rcx                                                       ; +0x23, 0x140278333\nmov     [rsp+98h+var_70], rcx                                          ; +0x26, 0x140278336\nxor     ebp, ebp                                                       ; +0x2b, 0x14027833b\ncall    AchievementManager__sharedState                                ; +0x2d, 0x14027833d\nmov     rcx, rax                                                       ; +0x32, 0x140278342\nmov     r9d, edi                                                       ; +0x35, 0x140278345\nmov     r8d, ebx                                                       ; +0x38, 0x140278348\nlea     rdx, [rsp+98h+var_48]                                          ; +0x3b, 0x14027834b\ncall    AchievementManager__achievementForUnlock                       ; +0x40, 0x140278350\nnop                                                                    ; +0x45, 0x140278355\nlea     rbx, [rsp+98h+var_48]                                          ; +0x46, 0x140278356\ncmp     [rsp+98h+var_30], 0Fh                                          ; +0x4b, 0x14027835b\ncmova   rbx, [rsp+98h+var_48]                                          ; +0x51, 0x140278361\ncall    AchievementManager__sharedState                                ; +0x57, 0x140278367\nmov     rcx, rax                                                       ; +0x5c, 0x14027836c\nmov     rdx, rbx                                                       ; +0x5f, 0x14027836f\ncall    AchievementManager__getAchievementsWithID; Merged with: AchievementManager::getAchievementsWithID, MusicDownloadManager::getDLObject ; +0x62, 0x140278372\nmov     rbx, rax                                                       ; +0x67, 0x140278377\nxorps   xmm0, xmm0                                                     ; +0x6a, 0x14027837a\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0x6d, 0x14027837d\nmov     [rsp+98h+var_58], rbp                                          ; +0x72, 0x140278382\nmov     [rsp+98h+var_50], 0Fh                                          ; +0x77, 0x140278387\nlea     ecx, [rbp+20h]                                                 ; +0x80, 0x140278390\ncall    sub_14003AA10                                                  ; +0x83, 0x140278393\nmov     rcx, rax                                                       ; +0x88, 0x140278398\nmov     [rsp+98h+Block], rax                                           ; +0x8b, 0x14027839b\nmov     [rsp+98h+var_58], 15h                                          ; +0x90, 0x1402783a0\nmov     [rsp+98h+var_50], 1Fh                                          ; +0x99, 0x1402783a9\nmovups  xmm0, cs:xmmword_1405193C8                                     ; +0xa2, 0x1402783b2\nmovups  xmmword ptr [rax], xmm0                                        ; +0xa9, 0x1402783b9\nmov     eax, cs:dword_1405193D8                                        ; +0xac, 0x1402783bc\nmov     [rcx+10h], eax                                                 ; +0xb2, 0x1402783c2\nmovzx   eax, cs:byte_1405193DC                                         ; +0xb5, 0x1402783c5\nmov     [rcx+14h], al                                                  ; +0xbc, 0x1402783cc\nmov     [rcx+15h], bpl                                                 ; +0xbf, 0x1402783cf\nlea     rdx, [rsp+98h+Block]                                           ; +0xc3, 0x1402783d3\nmov     rcx, rbx                                                       ; +0xc8, 0x1402783d8\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 &) ; +0xcb, 0x1402783db\nmov     rcx, rax                                                       ; +0xd1, 0x1402783e1\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xd4, 0x1402783e4\nxorps   xmm0, xmm0                                                     ; +0xda, 0x1402783ea\nmovups  xmmword ptr [rsi], xmm0                                        ; +0xdd, 0x1402783ed\nmov     [rsi+10h], rbp                                                 ; +0xe0, 0x1402783f0\nmov     [rsi+18h], rbp                                                 ; +0xe4, 0x1402783f4\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xe8, 0x1402783f8\nnop                                                                    ; +0xef, 0x1402783ff\ninc     r8                                                             ; +0xf0, 0x140278400\ncmp     byte ptr [rax+r8], 0                                           ; +0xf3, 0x140278403\njnz     short loc_140278400                                            ; +0xf8, 0x140278408\nmov     rdx, rax                                                       ; +0xfa, 0x14027840a\nmov     rcx, rsi                                                       ; +0xfd, 0x14027840d\ncall    sub_14003A930                                                  ; +0x100, 0x140278410\nnop                                                                    ; +0x105, 0x140278415\nmov     rdx, [rsp+98h+var_50]                                          ; +0x106, 0x140278416\ncmp     rdx, 0Fh                                                       ; +0x10b, 0x14027841b\njbe     short loc_140278456                                            ; +0x10f, 0x14027841f\ninc     rdx                                                            ; +0x111, 0x140278421\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x114, 0x140278424\nmov     rax, rcx                                                       ; +0x119, 0x140278429\ncmp     rdx, 1000h                                                     ; +0x11c, 0x14027842c\njb      short loc_140278451                                            ; +0x123, 0x140278433\nadd     rdx, 27h ; '''                                                 ; +0x125, 0x140278435\nmov     rcx, [rcx-8]                                                   ; +0x129, 0x140278439\nsub     rax, rcx                                                       ; +0x12d, 0x14027843d\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x130, 0x140278440\ncmp     rax, 1Fh                                                       ; +0x134, 0x140278444\njbe     short loc_140278451                                            ; +0x138, 0x140278448\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x13a, 0x14027844a\ndb 0CCh                                                                ; +0x140, 0x140278450\ncall    j_j_free                                                       ; +0x141, 0x140278451\nmov     [rsp+98h+var_58], rbp                                          ; +0x146, 0x140278456\nmov     [rsp+98h+var_50], 0Fh                                          ; +0x14b, 0x14027845b\nmov     byte ptr [rsp+98h+Block], 0                                    ; +0x154, 0x140278464\nlea     rcx, [rsp+98h+var_48]                                          ; +0x159, 0x140278469\ncall    sub_14003A830                                                  ; +0x15e, 0x14027846e\nmov     rax, rsi                                                       ; +0x163, 0x140278473\nmov     rcx, [rsp+98h+var_28]                                          ; +0x166, 0x140278476\nxor     rcx, rsp; StackCookie                                          ; +0x16b, 0x14027847b\ncall    __security_check_cookie                                        ; +0x16e, 0x14027847e\nmov     rbx, [rsp+98h+arg_18]                                          ; +0x173, 0x140278483\nadd     rsp, 80h                                                       ; +0x17b, 0x14027848b\npop     rdi                                                            ; +0x182, 0x140278492\npop     rsi                                                            ; +0x183, 0x140278493\npop     rbp                                                            ; +0x184, 0x140278494\nretn                                                                   ; +0x185, 0x140278495", "xrefs": ["ItemInfoPopup::init @ 0x14027cb29", "<???> @ 0x1406d0fec"], "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"}