{"type": "func", "start": 4295347152, "end": 4295347451, "name": "GameStatsManager::createSecretChestItems", "pseudocode": "// \n// GameStatsManager::createSecretChestItems from 0x10005cbd0 to 0x10005ccfb (299 bytes)\n// \n// 4 xrefs:\n// > GameStatsManager::init @ 0x10005a51c\n// > GameStatsManager::generateItemUnlockableData @ 0x100065bff\n// > GameStatsManager::generateItemUnlockableData @ 0x100065eee\n// > GameStatsManager::generateItemUnlockableData @ 0x1000661d1\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\nvoid __fastcall GameStatsManager::createSecretChestItems(GameStatsManager *a1)\n{\n  cocos2d::CCDictionary *v1; // rax\n  cocos2d::CCDictionary *v2; // rax\n  cocos2d::CCDictionary *m_allTreasureRoomChests; // rax\n  cocos2d::CCDictElement *i; // rax\n  cocos2d::CCObject *m_pObject; // r14\n  __int64 v6; // r12\n  unsigned int v7; // r13d\n  _DWORD *v8; // rax\n  cocos2d::CCDictionary *m_allTreasureRoomChestItems; // r15\n  __int64 v10; // rax\n  char v11; // [rsp+0h] [rbp-50h]\n  _BYTE v12[16]; // [rsp+8h] [rbp-48h] BYREF\n  void *__p; // [rsp+18h] [rbp-38h]\n  cocos2d::CCDictElement *next; // [rsp+20h] [rbp-30h]\n\n  if ( !a1->m_allTreasureRoomChestItems )\n  {\n    v1 = cocos2d::CCDictionary::create();\n    a1->m_allTreasureRoomChestItems = v1;\n    cocos2d::CCObject::retain(v1);\n    v2 = cocos2d::CCDictionary::create();\n    a1->m_allTreasureRoomChests = v2;\n    cocos2d::CCObject::retain(v2);\n    GameStatsManager::createSecretChestRewards(a1);\n    m_allTreasureRoomChests = a1->m_allTreasureRoomChests;\n    if ( m_allTreasureRoomChests )\n    {\n      for ( i = m_allTreasureRoomChests->m_pElements; i; i = next )\n      {\n        m_pObject = i->m_pObject;\n        next = (cocos2d::CCDictElement *)i->hh.next;\n        if ( m_pObject )\n        {\n          v6 = *(_QWORD *)&m_pObject[1].m_nTag;\n          if ( v6 )\n          {\n            if ( (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) )\n            {\n              v7 = 0;\n              do\n              {\n                v8 = (_DWORD *)sub_1007200C0(v6, v7);\n                if ( v8[14] == 9 )\n                {\n                  GameStatsManager::getItemKey(v12, v7, (unsigned int)v8[16], (unsigned int)v8[15]);\n                  cocos2d::CCDictionary::objectForKey_1(a1->m_allTreasureRoomChestItems, v12);\n                  m_allTreasureRoomChestItems = a1->m_allTreasureRoomChestItems;\n                  v10 = sub_1007AB580(\"%i\", v11);\n                  cocos2d::CCDictionary::setObject_1(m_allTreasureRoomChestItems, v10, v12);\n                  if ( (v12[0] & 1) != 0 )\n                    operator delete(__p);\n                }\n                ++v7;\n              }\n              while ( v7 < (unsigned int)sub_100720070(v6) );\n            }\n          }\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GameStatsManager::createSecretChestItems from 0x10005cbd0 to 0x10005ccfb (299 bytes)\n; \n; 4 xrefs:\n; > GameStatsManager::init @ 0x10005a51c\n; > GameStatsManager::generateItemUnlockableData @ 0x100065bff\n; > GameStatsManager::generateItemUnlockableData @ 0x100065eee\n; > GameStatsManager::generateItemUnlockableData @ 0x1000661d1\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, 0x10005cbd0\nmov     rbp, rsp                                                       ; +0x1, 0x10005cbd1\npush    r15                                                            ; +0x4, 0x10005cbd4\npush    r14                                                            ; +0x6, 0x10005cbd6\npush    r13                                                            ; +0x8, 0x10005cbd8\npush    r12                                                            ; +0xa, 0x10005cbda\npush    rbx                                                            ; +0xc, 0x10005cbdc\nsub     rsp, 28h                                                       ; +0xd, 0x10005cbdd\ncmp     qword ptr [rdi+160h], 0                                        ; +0x11, 0x10005cbe1\njz      short loc_10005CBFA                                            ; +0x19, 0x10005cbe9\nadd     rsp, 28h                                                       ; +0x1b, 0x10005cbeb\npop     rbx                                                            ; +0x1f, 0x10005cbef\npop     r12                                                            ; +0x20, 0x10005cbf0\npop     r13                                                            ; +0x22, 0x10005cbf2\npop     r14                                                            ; +0x24, 0x10005cbf4\npop     r15                                                            ; +0x26, 0x10005cbf6\npop     rbp                                                            ; +0x28, 0x10005cbf8\nretn                                                                   ; +0x29, 0x10005cbf9\nmov     rbx, rdi                                                       ; +0x2a, 0x10005cbfa\ncall    cocos2d__CCDictionary__create                                  ; +0x2d, 0x10005cbfd\nmov     [rbx+160h], rax                                                ; +0x32, 0x10005cc02\nmov     rdi, rax                                                       ; +0x39, 0x10005cc09\ncall    cocos2d__CCObject__retain                                      ; +0x3c, 0x10005cc0c\ncall    cocos2d__CCDictionary__create                                  ; +0x41, 0x10005cc11\nmov     [rbx+158h], rax                                                ; +0x46, 0x10005cc16\nmov     rdi, rax                                                       ; +0x4d, 0x10005cc1d\ncall    cocos2d__CCObject__retain                                      ; +0x50, 0x10005cc20\nmov     rdi, rbx                                                       ; +0x55, 0x10005cc25\ncall    GameStatsManager__createSecretChestRewards                     ; +0x58, 0x10005cc28\nmov     rax, [rbx+158h]                                                ; +0x5d, 0x10005cc2d\ntest    rax, rax                                                       ; +0x64, 0x10005cc34\njz      short loc_10005CBEB                                            ; +0x67, 0x10005cc37\nmov     rax, [rax+38h]                                                 ; +0x69, 0x10005cc39\njmp     short loc_10005CC44                                            ; +0x6d, 0x10005cc3d\nalign 20h                                                              ; +0x6f, 0x10005cc3f\nmov     rax, [rbp+var_30]                                              ; +0x70, 0x10005cc40\ntest    rax, rax                                                       ; +0x74, 0x10005cc44\njz      short loc_10005CBEB                                            ; +0x77, 0x10005cc47\nmov     r14, [rax+108h]                                                ; +0x79, 0x10005cc49\nmov     rax, [rax+120h]                                                ; +0x80, 0x10005cc50\nmov     [rbp+var_30], rax                                              ; +0x87, 0x10005cc57\ntest    r14, r14                                                       ; +0x8b, 0x10005cc5b\njz      short loc_10005CC40                                            ; +0x8e, 0x10005cc5e\nmov     r12, [r14+48h]                                                 ; +0x90, 0x10005cc60\ntest    r12, r12                                                       ; +0x94, 0x10005cc64\njz      short loc_10005CC40                                            ; +0x97, 0x10005cc67\nmov     rdi, r12                                                       ; +0x99, 0x10005cc69\ncall    sub_100720070                                                  ; +0x9c, 0x10005cc6c\ntest    eax, eax                                                       ; +0xa1, 0x10005cc71\njz      short loc_10005CC40                                            ; +0xa3, 0x10005cc73\nxor     r13d, r13d                                                     ; +0xa5, 0x10005cc75\njmp     short loc_10005CC90                                            ; +0xa8, 0x10005cc78\nalign 20h                                                              ; +0xaa, 0x10005cc7a\ninc     r13d                                                           ; +0xb0, 0x10005cc80\nmov     rdi, r12                                                       ; +0xb3, 0x10005cc83\ncall    sub_100720070                                                  ; +0xb6, 0x10005cc86\ncmp     r13d, eax                                                      ; +0xbb, 0x10005cc8b\njnb     short loc_10005CC40                                            ; +0xbe, 0x10005cc8e\nmov     rdi, r12                                                       ; +0xc0, 0x10005cc90\nmov     esi, r13d                                                      ; +0xc3, 0x10005cc93\ncall    sub_1007200C0                                                  ; +0xc6, 0x10005cc96\ncmp     dword ptr [rax+38h], 9                                         ; +0xcb, 0x10005cc9b\njnz     short loc_10005CC80                                            ; +0xcf, 0x10005cc9f\nmov     ecx, [rax+3Ch]                                                 ; +0xd1, 0x10005cca1\nmov     edx, [rax+40h]                                                 ; +0xd4, 0x10005cca4\nlea     r15, [rbp+var_48]                                              ; +0xd7, 0x10005cca7\nmov     rdi, r15                                                       ; +0xdb, 0x10005ccab\ncall    GameStatsManager__getItemKey                                   ; +0xde, 0x10005ccae\nmov     rdi, [rbx+160h]                                                ; +0xe3, 0x10005ccb3\nmov     rsi, r15                                                       ; +0xea, 0x10005ccba\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0xed, 0x10005ccbd\nmov     r15, [rbx+160h]                                                ; +0xf2, 0x10005ccc2\nmov     esi, [r14+38h]                                                 ; +0xf9, 0x10005ccc9\nlea     rdi, aI; \"%i\"                                                  ; +0xfd, 0x10005cccd\nxor     eax, eax                                                       ; +0x104, 0x10005ccd4\ncall    sub_1007AB580                                                  ; +0x106, 0x10005ccd6\nmov     rdi, r15                                                       ; +0x10b, 0x10005ccdb\nmov     rsi, rax                                                       ; +0x10e, 0x10005ccde\nlea     rdx, [rbp+var_48]                                              ; +0x111, 0x10005cce1\ncall    cocos2d__CCDictionary__setObject_1                             ; +0x115, 0x10005cce5\ntest    [rbp+var_48], 1                                                ; +0x11a, 0x10005ccea\njz      short loc_10005CC80                                            ; +0x11e, 0x10005ccee\nmov     rdi, [rbp+__p]; __p                                            ; +0x120, 0x10005ccf0\ncall    __ZdlPv; operator delete(void *)                               ; +0x124, 0x10005ccf4\njmp     short loc_10005CC80                                            ; +0x129, 0x10005ccf9", "xrefs": ["GameStatsManager::init @ 0x10005a51c", "GameStatsManager::generateItemUnlockableData @ 0x100065bff", "GameStatsManager::generateItemUnlockableData @ 0x100065eee", "GameStatsManager::generateItemUnlockableData @ 0x1000661d1"], "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"}