{"type": "func", "start": 5370698496, "end": 5370698696, "name": "GameStatsManager::getItemUnlockState", "pseudocode": "// \n// GameStatsManager::getItemUnlockState from 0x1401e5b00 to 0x1401e5bc8 (200 bytes)\n// \n// 4 xrefs:\n// > CharacterColorPage::updateColorMode @ 0x140089a96\n// > GJGarageLayer::setupSpecialPage @ 0x140276ed3\n// > ItemInfoPopup::init @ 0x14027c210\n// > <???> @ 0x1406cc600\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=1\nint GameStatsManager::getItemUnlockState(GameStatsManager *a1, int a2, UnlockType a3)\n{\n  _QWORD *ItemKey; // rax\n  __int64 v7; // rsi\n  std::_Tree_val<std::_Tree_simple_types<std::pair<UnlockType, int>>>::_Nodeptr Myhead; // rdx\n  std::_Tree_simple_types<std::pair<UnlockType, int>>::_Node *v10; // rax\n  _QWORD v11[4]; // [rsp+20h] [rbp-48h] BYREF\n\n  ItemKey = GameStatsManager::getItemKey((__int64)a1, v11, a2, a3);\n  v7 = cocos2d::CCDictionary::objectForKey(a1->m_unlockedItems, ItemKey);\n  sub_14003A830((__int64)v11);\n  if ( v7 )\n    return (*(int (__fastcall **)(__int64))(*(_QWORD *)v7 + 56LL))(v7);\n  Myhead = a1->m_wraithIcons._Mypair._Myval2._Myval2._Myhead;\n  v10 = *((std::_Tree_simple_types<std::pair<UnlockType, int>>::_Node **)Myhead + 1);\n  while ( !*((_BYTE *)v10 + 25) )\n  {\n    if ( *((_DWORD *)v10 + 7) < a3 || *((_DWORD *)v10 + 7) <= a3 && *((_DWORD *)v10 + 8) < a2 )\n    {\n      v10 = *((std::_Tree_simple_types<std::pair<UnlockType, int>>::_Node **)v10 + 2);\n    }\n    else\n    {\n      Myhead = v10;\n      v10 = *(std::_Tree_simple_types<std::pair<UnlockType, int>>::_Node **)v10;\n    }\n  }\n  if ( *((_BYTE *)Myhead + 25)\n    || a3 < *((_DWORD *)Myhead + 7)\n    || a3 <= *((_DWORD *)Myhead + 7) && a2 < *((_DWORD *)Myhead + 8) )\n  {\n    return 0;\n  }\n  else\n  {\n    return 3;\n  }\n}", "assembly": "; \n; GameStatsManager::getItemUnlockState from 0x1401e5b00 to 0x1401e5bc8 (200 bytes)\n; \n; 4 xrefs:\n; > CharacterColorPage::updateColorMode @ 0x140089a96\n; > GJGarageLayer::setupSpecialPage @ 0x140276ed3\n; > ItemInfoPopup::init @ 0x14027c210\n; > <???> @ 0x1406cc600\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, 0x1401e5b00\npush    rbp                                                            ; +0x5, 0x1401e5b05\npush    rsi                                                            ; +0x6, 0x1401e5b06\npush    rdi                                                            ; +0x7, 0x1401e5b07\nsub     rsp, 50h                                                       ; +0x8, 0x1401e5b08\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x1401e5b0c\nxor     rax, rsp                                                       ; +0x13, 0x1401e5b13\nmov     [rsp+68h+var_28], rax                                          ; +0x16, 0x1401e5b16\nmov     ebx, r8d                                                       ; +0x1b, 0x1401e5b1b\nmov     edi, edx                                                       ; +0x1e, 0x1401e5b1e\nmov     rbp, rcx                                                       ; +0x20, 0x1401e5b20\nmov     r9d, r8d                                                       ; +0x23, 0x1401e5b23\nmov     r8d, edx                                                       ; +0x26, 0x1401e5b26\nlea     rdx, [rsp+68h+var_48]                                          ; +0x29, 0x1401e5b29\ncall    GameStatsManager__getItemKey                                   ; +0x2e, 0x1401e5b2e\nnop                                                                    ; +0x33, 0x1401e5b33\nmov     rdx, rax                                                       ; +0x34, 0x1401e5b34\nmov     rcx, [rbp+3A0h]                                                ; +0x37, 0x1401e5b37\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x3e, 0x1401e5b3e\nmov     rsi, rax                                                       ; +0x44, 0x1401e5b44\nlea     rcx, [rsp+68h+var_48]                                          ; +0x47, 0x1401e5b47\ncall    sub_14003A830                                                  ; +0x4c, 0x1401e5b4c\ntest    rsi, rsi                                                       ; +0x51, 0x1401e5b51\njz      short loc_1401E5B61                                            ; +0x54, 0x1401e5b54\nmov     rdx, [rsi]                                                     ; +0x56, 0x1401e5b56\nmov     rcx, rsi                                                       ; +0x59, 0x1401e5b59\ncall    qword ptr [rdx+38h]                                            ; +0x5c, 0x1401e5b5c\njmp     short loc_1401E5BAB                                            ; +0x5f, 0x1401e5b5f\nmov     rdx, [rbp+3C8h]                                                ; +0x61, 0x1401e5b61\nmov     rax, [rdx+8]                                                   ; +0x68, 0x1401e5b68\ncmp     byte ptr [rax+19h], 0                                          ; +0x6c, 0x1401e5b6c\njnz     short loc_1401E5B90                                            ; +0x70, 0x1401e5b70\ncmp     [rax+1Ch], ebx                                                 ; +0x72, 0x1401e5b72\njl      short loc_1401E5B86                                            ; +0x75, 0x1401e5b75\njg      short loc_1401E5B7E                                            ; +0x77, 0x1401e5b77\ncmp     [rax+20h], edi                                                 ; +0x79, 0x1401e5b79\njl      short loc_1401E5B86                                            ; +0x7c, 0x1401e5b7c\nmov     rdx, rax                                                       ; +0x7e, 0x1401e5b7e\nmov     rax, [rax]                                                     ; +0x81, 0x1401e5b81\njmp     short loc_1401E5B8A                                            ; +0x84, 0x1401e5b84\nmov     rax, [rax+10h]                                                 ; +0x86, 0x1401e5b86\ncmp     byte ptr [rax+19h], 0                                          ; +0x8a, 0x1401e5b8a\njz      short loc_1401E5B72                                            ; +0x8e, 0x1401e5b8e\ncmp     byte ptr [rdx+19h], 0                                          ; +0x90, 0x1401e5b90\njnz     short loc_1401E5BA9                                            ; +0x94, 0x1401e5b94\ncmp     ebx, [rdx+1Ch]                                                 ; +0x96, 0x1401e5b96\njl      short loc_1401E5BA9                                            ; +0x99, 0x1401e5b99\njg      short loc_1401E5BA2                                            ; +0x9b, 0x1401e5b9b\ncmp     edi, [rdx+20h]                                                 ; +0x9d, 0x1401e5b9d\njl      short loc_1401E5BA9                                            ; +0xa0, 0x1401e5ba0\nmov     eax, 3                                                         ; +0xa2, 0x1401e5ba2\njmp     short loc_1401E5BAB                                            ; +0xa7, 0x1401e5ba7\nxor     eax, eax                                                       ; +0xa9, 0x1401e5ba9\nmov     rcx, [rsp+68h+var_28]                                          ; +0xab, 0x1401e5bab\nxor     rcx, rsp; StackCookie                                          ; +0xb0, 0x1401e5bb0\ncall    __security_check_cookie                                        ; +0xb3, 0x1401e5bb3\nmov     rbx, [rsp+68h+arg_18]                                          ; +0xb8, 0x1401e5bb8\nadd     rsp, 50h                                                       ; +0xc0, 0x1401e5bc0\npop     rdi                                                            ; +0xc4, 0x1401e5bc4\npop     rsi                                                            ; +0xc5, 0x1401e5bc5\npop     rbp                                                            ; +0xc6, 0x1401e5bc6\nretn                                                                   ; +0xc7, 0x1401e5bc7", "xrefs": ["CharacterColorPage::updateColorMode @ 0x140089a96", "GJGarageLayer::setupSpecialPage @ 0x140276ed3", "ItemInfoPopup::init @ 0x14027c210", "<???> @ 0x1406cc600"], "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"}