{"type": "func", "start": 4295456000, "end": 4295456162, "name": "GameStatsManager::getItemUnlockState", "pseudocode": "// \n// GameStatsManager::getItemUnlockState from 0x100077500 to 0x1000775a2 (162 bytes)\n// \n// 4 xrefs:\n// > GameStatsManager::getItemUnlockStateLite @ 0x10007765e\n// > GJGarageLayer::setupSpecialPage @ 0x10036d7a9\n// > ItemInfoPopup::init @ 0x100372015\n// > CharacterColorPage::updateColorMode @ 0x10065e175\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// local variable allocation has failed, the output may be wrong!\nint __fastcall GameStatsManager::getItemUnlockState(GameStatsManager *a1, int a2, UnlockType a3)\n{\n  double v3; // xmm0_8\n  cocos2d::CCDictionary *m_unlockedItems; // r12\n  __int64 v6; // r12\n  int result; // eax\n  std::__tree_end_node<std::__tree_node_base<void *> *>::pointer left; // rcx\n  size_t v9[8]; // [rsp+0h] [rbp-40h] BYREF\n\n  m_unlockedItems = a1->m_unlockedItems;\n  GameStatsManager::getItemKey(v9, v3, *(__int64 *)&a2, a2, a3);\n  v6 = cocos2d::CCDictionary::objectForKey_1(m_unlockedItems, v9);\n  if ( (v9[0] & 1) != 0 )\n    operator delete((void *)v9[2]);\n  if ( !v6 )\n  {\n    left = a1->m_wraithIcons.__tree_.__pair1_.__value_.__left_;\n    result = 0;\n    while ( 1 )\n    {\n      if ( !left )\n        return result;\n      if ( *((_DWORD *)left + 7) <= a3 )\n      {\n        if ( *((_DWORD *)left + 7) < a3 )\n          goto LABEL_7;\n        if ( *((_DWORD *)left + 8) <= a2 )\n          break;\n      }\nLABEL_8:\n      left = *(std::__tree_end_node<std::__tree_node_base<void *> *>::pointer *)left;\n    }\n    if ( *((_DWORD *)left + 8) >= a2 )\n      return 3;\nLABEL_7:\n    left = (std::__tree_end_node<std::__tree_node_base<void *> *>::pointer)((char *)left + 8);\n    goto LABEL_8;\n  }\n  return (*(int (__fastcall **)(__int64))(*(_QWORD *)v6 + 64LL))(v6);\n}", "assembly": "; \n; GameStatsManager::getItemUnlockState from 0x100077500 to 0x1000775a2 (162 bytes)\n; \n; 4 xrefs:\n; > GameStatsManager::getItemUnlockStateLite @ 0x10007765e\n; > GJGarageLayer::setupSpecialPage @ 0x10036d7a9\n; > ItemInfoPopup::init @ 0x100372015\n; > CharacterColorPage::updateColorMode @ 0x10065e175\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, 0x100077500\nmov     rbp, rsp                                                       ; +0x1, 0x100077501\npush    r15                                                            ; +0x4, 0x100077504\npush    r14                                                            ; +0x6, 0x100077506\npush    r13                                                            ; +0x8, 0x100077508\npush    r12                                                            ; +0xa, 0x10007750a\npush    rbx                                                            ; +0xc, 0x10007750c\nsub     rsp, 18h                                                       ; +0xd, 0x10007750d\nmov     ebx, edx                                                       ; +0x11, 0x100077511\nmov     r14d, esi                                                      ; +0x13, 0x100077513\nmov     r15, rdi                                                       ; +0x16, 0x100077516\nmov     r12, [rdi+338h]                                                ; +0x19, 0x100077519\nlea     r13, [rbp+var_40]                                              ; +0x20, 0x100077520\nmov     rdi, r13                                                       ; +0x24, 0x100077524\nmov     edx, esi                                                       ; +0x27, 0x100077527\nmov     ecx, ebx                                                       ; +0x29, 0x100077529\ncall    GameStatsManager__getItemKey                                   ; +0x2b, 0x10007752b\nmov     rdi, r12                                                       ; +0x30, 0x100077530\nmov     rsi, r13                                                       ; +0x33, 0x100077533\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0x36, 0x100077536\nmov     r12, rax                                                       ; +0x3b, 0x10007753b\ntest    [rbp+var_40], 1                                                ; +0x3e, 0x10007753e\njz      short loc_10007754D                                            ; +0x42, 0x100077542\nmov     rdi, [rbp+__p]; __p                                            ; +0x44, 0x100077544\ncall    __ZdlPv; operator delete(void *)                               ; +0x48, 0x100077548\ntest    r12, r12                                                       ; +0x4d, 0x10007754d\njz      short loc_10007756B                                            ; +0x50, 0x100077550\nmov     rax, [r12]                                                     ; +0x52, 0x100077552\nmov     rdi, r12                                                       ; +0x56, 0x100077556\ncall    qword ptr [rax+40h]                                            ; +0x59, 0x100077559\nadd     rsp, 18h                                                       ; +0x5c, 0x10007755c\npop     rbx                                                            ; +0x60, 0x100077560\npop     r12                                                            ; +0x61, 0x100077561\npop     r13                                                            ; +0x63, 0x100077563\npop     r14                                                            ; +0x65, 0x100077565\npop     r15                                                            ; +0x67, 0x100077567\npop     rbp                                                            ; +0x69, 0x100077569\nretn                                                                   ; +0x6a, 0x10007756a\nmov     rcx, [r15+378h]                                                ; +0x6b, 0x10007756b\nxor     eax, eax                                                       ; +0x72, 0x100077572\njmp     short loc_100077587                                            ; +0x74, 0x100077574\nalign 20h                                                              ; +0x76, 0x100077576\nadd     rcx, 8                                                         ; +0x80, 0x100077580\nmov     rcx, [rcx]                                                     ; +0x84, 0x100077584\ntest    rcx, rcx                                                       ; +0x87, 0x100077587\njz      short loc_10007755C                                            ; +0x8a, 0x10007758a\ncmp     [rcx+1Ch], ebx                                                 ; +0x8c, 0x10007758c\njg      short loc_100077584                                            ; +0x8f, 0x10007758f\njl      short loc_100077580                                            ; +0x91, 0x100077591\ncmp     [rcx+20h], r14d                                                ; +0x93, 0x100077593\njg      short loc_100077584                                            ; +0x97, 0x100077597\njl      short loc_100077580                                            ; +0x99, 0x100077599\nmov     eax, 3                                                         ; +0x9b, 0x10007759b\njmp     short loc_10007755C                                            ; +0xa0, 0x1000775a0", "xrefs": ["GameStatsManager::getItemUnlockStateLite @ 0x10007765e", "GJGarageLayer::setupSpecialPage @ 0x10036d7a9", "ItemInfoPopup::init @ 0x100372015", "CharacterColorPage::updateColorMode @ 0x10065e175"], "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"}