{"type": "func", "start": 4302852304, "end": 4302852499, "name": "AchievementManager::getAchievementsWithID", "pseudocode": "// \n// AchievementManager::getAchievementsWithID from 0x1007850d0 to 0x100785193 (195 bytes)\n// \n// 7 xrefs:\n// > GJGarageLayer::titleForUnlock @ 0x10036f609\n// > GJGarageLayer::descriptionForUnlock @ 0x10036f779\n// > GameManager::getUnlockForAchievement @ 0x10037878f\n// > AchievementManager::isAchievementAvailable @ 0x1007851c1\n// > AchievementManager::isAchievementAvailable @ 0x100785200\n// > AchievementManager::limitForAchievement @ 0x100785243\n// > AchievementManager::limitForAchievement @ 0x100785255\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\ncocos2d::CCDictionary *__fastcall AchievementManager::getAchievementsWithID(AchievementManager *a1, const char *a2)\n{\n  double v2; // xmm0_8\n  cocos2d::CCDictionary *m_platformAchievements; // rbx\n  size_t v4; // rax\n  size_t v5; // r15\n  char *v6; // r12\n  size_t v7; // r13\n  cocos2d::CCDictionary *result; // rax\n  cocos2d::CCDictionary *v9; // rbx\n  _QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF\n  void *__p; // [rsp+10h] [rbp-30h]\n\n  m_platformAchievements = a1->m_platformAchievements;\n  v4 = strlen(a2);\n  if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v2);\n  v5 = v4;\n  if ( v4 >= 0x17 )\n  {\n    v7 = 26;\n    if ( (v4 | 7) != 0x17 )\n      v7 = (v4 | 7) + 1;\n    v6 = (char *)operator new(v7);\n    __p = v6;\n    __dst[0] = v7 + 1;\n    __dst[1] = v5;\n    goto LABEL_8;\n  }\n  LOBYTE(__dst[0]) = 2 * v4;\n  v6 = (char *)__dst + 1;\n  if ( v4 )\nLABEL_8:\n    memcpy(v6, a2, v5);\n  v6[v5] = 0;\n  result = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1(\n                                      (__int64)m_platformAchievements,\n                                      (char *)__dst);\n  if ( (__dst[0] & 1) != 0 )\n  {\n    v9 = result;\n    operator delete(__p);\n    return v9;\n  }\n  return result;\n}", "assembly": "; \n; AchievementManager::getAchievementsWithID from 0x1007850d0 to 0x100785193 (195 bytes)\n; \n; 7 xrefs:\n; > GJGarageLayer::titleForUnlock @ 0x10036f609\n; > GJGarageLayer::descriptionForUnlock @ 0x10036f779\n; > GameManager::getUnlockForAchievement @ 0x10037878f\n; > AchievementManager::isAchievementAvailable @ 0x1007851c1\n; > AchievementManager::isAchievementAvailable @ 0x100785200\n; > AchievementManager::limitForAchievement @ 0x100785243\n; > AchievementManager::limitForAchievement @ 0x100785255\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\npush    rbp                                                            ; +0x0, 0x1007850d0\nmov     rbp, rsp                                                       ; +0x1, 0x1007850d1\npush    r15                                                            ; +0x4, 0x1007850d4\npush    r14                                                            ; +0x6, 0x1007850d6\npush    r13                                                            ; +0x8, 0x1007850d8\npush    r12                                                            ; +0xa, 0x1007850da\npush    rbx                                                            ; +0xc, 0x1007850dc\nsub     rsp, 18h                                                       ; +0xd, 0x1007850dd\nmov     r14, rsi                                                       ; +0x11, 0x1007850e1\nmov     rbx, [rdi+148h]                                                ; +0x14, 0x1007850e4\nmov     rdi, rsi; __s                                                  ; +0x1b, 0x1007850eb\ncall    _strlen                                                        ; +0x1e, 0x1007850ee\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x23, 0x1007850f3\njnb     loc_10078518E                                                  ; +0x27, 0x1007850f7\nmov     r15, rax                                                       ; +0x2d, 0x1007850fd\ncmp     rax, 17h                                                       ; +0x30, 0x100785100\njnb     short loc_100785118                                            ; +0x34, 0x100785104\nlea     eax, [r15+r15]                                                 ; +0x36, 0x100785106\nmov     byte ptr [rbp+__dst], al                                       ; +0x3a, 0x10078510a\nlea     r12, [rbp+__dst+1]                                             ; +0x3d, 0x10078510d\ntest    r15, r15                                                       ; +0x41, 0x100785111\njnz     short loc_10078514B                                            ; +0x44, 0x100785114\njmp     short loc_100785159                                            ; +0x46, 0x100785116\nmov     rax, r15                                                       ; +0x48, 0x100785118\nor      rax, 7                                                         ; +0x4b, 0x10078511b\nlea     rcx, [rax+1]                                                   ; +0x4f, 0x10078511f\ncmp     rax, 17h                                                       ; +0x53, 0x100785123\nmov     r13d, 1Ah                                                      ; +0x57, 0x100785127\ncmovnz  r13, rcx                                                       ; +0x5d, 0x10078512d\nmov     rdi, r13; __sz                                                 ; +0x61, 0x100785131\ncall    __Znwm; operator new(ulong)                                    ; +0x64, 0x100785134\nmov     r12, rax                                                       ; +0x69, 0x100785139\nmov     [rbp+__p], rax                                                 ; +0x6c, 0x10078513c\ninc     r13                                                            ; +0x70, 0x100785140\nmov     [rbp+__dst], r13                                               ; +0x73, 0x100785143\nmov     [rbp+var_38], r15                                              ; +0x77, 0x100785147\nmov     rdi, r12; __dst                                                ; +0x7b, 0x10078514b\nmov     rsi, r14; __src                                                ; +0x7e, 0x10078514e\nmov     rdx, r15; __n                                                  ; +0x81, 0x100785151\ncall    _memcpy                                                        ; +0x84, 0x100785154\nmov     byte ptr [r12+r15], 0                                          ; +0x89, 0x100785159\nlea     rsi, [rbp+__dst]                                               ; +0x8e, 0x10078515e\nmov     rdi, rbx                                                       ; +0x92, 0x100785162\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0x95, 0x100785165\ntest    byte ptr [rbp+__dst], 1                                        ; +0x9a, 0x10078516a\njz      short loc_10078517F                                            ; +0x9e, 0x10078516e\nmov     rdi, [rbp+__p]; __p                                            ; +0xa0, 0x100785170\nmov     rbx, rax                                                       ; +0xa4, 0x100785174\ncall    __ZdlPv; operator delete(void *)                               ; +0xa7, 0x100785177\nmov     rax, rbx                                                       ; +0xac, 0x10078517c\nadd     rsp, 18h                                                       ; +0xaf, 0x10078517f\npop     rbx                                                            ; +0xb3, 0x100785183\npop     r12                                                            ; +0xb4, 0x100785184\npop     r13                                                            ; +0xb6, 0x100785186\npop     r14                                                            ; +0xb8, 0x100785188\npop     r15                                                            ; +0xba, 0x10078518a\npop     rbp                                                            ; +0xbc, 0x10078518c\nretn                                                                   ; +0xbd, 0x10078518d\ncall    sub_100006BF0                                                  ; +0xbe, 0x10078518e", "xrefs": ["GJGarageLayer::titleForUnlock @ 0x10036f609", "GJGarageLayer::descriptionForUnlock @ 0x10036f779", "GameManager::getUnlockForAchievement @ 0x10037878f", "AchievementManager::isAchievementAvailable @ 0x1007851c1", "AchievementManager::isAchievementAvailable @ 0x100785200", "AchievementManager::limitForAchievement @ 0x100785243", "AchievementManager::limitForAchievement @ 0x100785255"], "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"}