{"type": "func", "start": 5370669328, "end": 5370669961, "name": "GameStatsManager::markLevelAsCompletedAndClaimed", "pseudocode": "// \n// GameStatsManager::markLevelAsCompletedAndClaimed from 0x1401de910 to 0x1401deb89 (633 bytes)\n// \n// 2 xrefs:\n// > GameManager::recountUserStats @ 0x140185262\n// > <???> @ 0x1406cc42c\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\nvoid GameStatsManager::markLevelAsCompletedAndClaimed(GameStatsManager *a1, GJGameLevel *a2)\n{\n  int v4; // eax\n  char v5; // r9\n  cocos2d::CCString *v6; // rax\n  const char *v7; // rcx\n  const char *CString; // rax\n  size_t v9; // rbx\n  size_t v10; // r8\n  void *v11; // rcx\n  cocos2d::CCString *v12; // rax\n  const char *v13; // rcx\n  const char *v14; // rax\n  void *v15; // rcx\n  void *Block[2]; // [rsp+48h] [rbp-50h] BYREF\n  __int128 v17; // [rsp+58h] [rbp-40h]\n  _QWORD v18[4]; // [rsp+68h] [rbp-30h] BYREF\n\n  v4 = a2->m_dailyID.random - a2->m_dailyID.seed;\n  v5 = a2->m_levelType != Main && v4 <= 0;\n  GameStatsManager::getLevelKey(\n    a2->m_gauntletLevel,\n    v18,\n    a2->m_levelID.random - a2->m_levelID.seed,\n    v5,\n    v4 > 0,\n    a2->m_gauntletLevel,\n    v4 > 200000);\n  cocos2d::CCDictionary::setObject(a1->m_completedLevels, a1->m_trueString, v18);\n  if ( a2->m_dailyID.random - a2->m_dailyID.seed <= 0 )\n  {\n    v7 = \"gstar_%i\";\n    if ( !a2->m_gauntletLevel )\n      v7 = \"star_%i\";\n    v6 = cocos2d::CCString::createWithFormat(v7);\n  }\n  else\n  {\n    v6 = cocos2d::CCString::createWithFormat(\"dstar_%i\");\n  }\n  CString = cocos2d::CCString::getCString(v6);\n  *(_OWORD *)Block = 0;\n  v17 = 0;\n  v9 = -1;\n  v10 = -1;\n  do\n    ++v10;\n  while ( CString[v10] );\n  sub_14003A930(Block, CString, v10);\n  cocos2d::CCDictionary::setObject(a1->m_completedLevels, a1->m_trueString, Block);\n  if ( *((_QWORD *)&v17 + 1) > 0xFu )\n  {\n    v11 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v17 + 1) + 1LL) >= 0x1000 )\n    {\n      v11 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v11);\n  }\n  if ( a2->m_dailyID.random - a2->m_dailyID.seed <= 0 )\n  {\n    v13 = \"gdemon_%i\";\n    if ( !a2->m_gauntletLevel )\n      v13 = \"demon_%i\";\n    v12 = cocos2d::CCString::createWithFormat(v13);\n  }\n  else\n  {\n    v12 = cocos2d::CCString::createWithFormat(\"ddemon_%i\");\n  }\n  v14 = cocos2d::CCString::getCString(v12);\n  *(_OWORD *)Block = 0;\n  v17 = 0;\n  do\n    ++v9;\n  while ( v14[v9] );\n  sub_14003A930(Block, v14, v9);\n  cocos2d::CCDictionary::setObject(a1->m_completedLevels, a1->m_trueString, Block);\n  if ( *((_QWORD *)&v17 + 1) > 0xFu )\n  {\n    v15 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v17 + 1) + 1LL) >= 0x1000 )\n    {\n      v15 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v15);\n  }\n  sub_14003A830((__int64)v18);\n}", "assembly": "; \n; GameStatsManager::markLevelAsCompletedAndClaimed from 0x1401de910 to 0x1401deb89 (633 bytes)\n; \n; 2 xrefs:\n; > GameManager::recountUserStats @ 0x140185262\n; > <???> @ 0x1406cc42c\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_10], rbx                                              ; +0x0, 0x1401de910\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1401de915\npush    rdi                                                            ; +0xa, 0x1401de91a\nsub     rsp, 90h                                                       ; +0xb, 0x1401de91b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1401de922\nxor     rax, rsp                                                       ; +0x19, 0x1401de929\nmov     [rsp+98h+var_10], rax                                          ; +0x1c, 0x1401de92c\nmov     rdi, rdx                                                       ; +0x24, 0x1401de934\nmov     rsi, rcx                                                       ; +0x27, 0x1401de937\nmov     eax, [rdx+36Ch]                                                ; +0x2a, 0x1401de93a\nsub     eax, [rdx+370h]                                                ; +0x30, 0x1401de940\ntest    eax, eax                                                       ; +0x36, 0x1401de946\nsetnle  dl                                                             ; +0x38, 0x1401de948\ncmp     dword ptr [rdi+454h], 1                                        ; +0x3b, 0x1401de94b\njz      short loc_1401DE95D                                            ; +0x42, 0x1401de952\ntest    eax, eax                                                       ; +0x44, 0x1401de954\njg      short loc_1401DE95D                                            ; +0x46, 0x1401de956\nmov     r9b, 1                                                         ; +0x48, 0x1401de958\njmp     short loc_1401DE960                                            ; +0x4b, 0x1401de95b\nxor     r9b, r9b                                                       ; +0x4d, 0x1401de95d\nmovzx   ecx, byte ptr [rdi+2C9h]                                       ; +0x50, 0x1401de960\nmov     r8d, [rdi+148h]                                                ; +0x57, 0x1401de967\nsub     r8d, [rdi+14Ch]                                                ; +0x5e, 0x1401de96e\ncmp     eax, 30D40h                                                    ; +0x65, 0x1401de975\nsetnle  al                                                             ; +0x6a, 0x1401de97a\nmov     [rsp+98h+var_68], al                                           ; +0x6d, 0x1401de97d\nmov     [rsp+98h+var_70], cl                                           ; +0x71, 0x1401de981\nmov     [rsp+98h+var_78], dl                                           ; +0x75, 0x1401de985\nlea     rdx, [rsp+98h+var_30]                                          ; +0x79, 0x1401de989\ncall    GameStatsManager__getLevelKey                                  ; +0x7e, 0x1401de98e\nnop                                                                    ; +0x83, 0x1401de993\nlea     r8, [rsp+98h+var_30]                                           ; +0x84, 0x1401de994\nmov     rdx, [rsi+148h]                                                ; +0x89, 0x1401de999\nmov     rcx, [rsi+2C8h]                                                ; +0x90, 0x1401de9a0\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x97, 0x1401de9a7\nmov     edx, [rdi+36Ch]                                                ; +0x9d, 0x1401de9ad\nsub     edx, [rdi+370h]                                                ; +0xa3, 0x1401de9b3\ntest    edx, edx                                                       ; +0xa9, 0x1401de9b9\njle     short loc_1401DE9C6                                            ; +0xab, 0x1401de9bb\nlea     rcx, aDstarI; \"dstar_%i\"                                       ; +0xad, 0x1401de9bd\njmp     short loc_1401DE9EB                                            ; +0xb4, 0x1401de9c4\nmov     edx, [rdi+148h]                                                ; +0xb6, 0x1401de9c6\nmov     eax, [rdi+14Ch]                                                ; +0xbc, 0x1401de9cc\nsub     edx, eax                                                       ; +0xc2, 0x1401de9d2\ncmp     byte ptr [rdi+2C9h], 0                                         ; +0xc4, 0x1401de9d4\nlea     rcx, aGstarI; \"gstar_%i\"                                       ; +0xcb, 0x1401de9db\njnz     short loc_1401DE9EB                                            ; +0xd2, 0x1401de9e2\nlea     rcx, aStarI; \"star_%i\"                                         ; +0xd4, 0x1401de9e4\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xdb, 0x1401de9eb\nmov     rcx, rax                                                       ; +0xe1, 0x1401de9f1\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xe4, 0x1401de9f4\nxorps   xmm0, xmm0                                                     ; +0xea, 0x1401de9fa\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0xed, 0x1401de9fd\nxorps   xmm1, xmm1                                                     ; +0xf2, 0x1401dea02\nmovdqu  [rsp+98h+var_40], xmm1                                         ; +0xf5, 0x1401dea05\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0xfb, 0x1401dea0b\nmov     r8, rbx                                                        ; +0x102, 0x1401dea12\ninc     r8                                                             ; +0x105, 0x1401dea15\ncmp     byte ptr [rax+r8], 0                                           ; +0x108, 0x1401dea18\njnz     short loc_1401DEA15                                            ; +0x10d, 0x1401dea1d\nmov     rdx, rax                                                       ; +0x10f, 0x1401dea1f\nlea     rcx, [rsp+98h+Block]                                           ; +0x112, 0x1401dea22\ncall    sub_14003A930                                                  ; +0x117, 0x1401dea27\nnop                                                                    ; +0x11c, 0x1401dea2c\nlea     r8, [rsp+98h+Block]                                            ; +0x11d, 0x1401dea2d\nmov     rdx, [rsi+148h]                                                ; +0x122, 0x1401dea32\nmov     rcx, [rsi+2C8h]                                                ; +0x129, 0x1401dea39\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x130, 0x1401dea40\nnop                                                                    ; +0x136, 0x1401dea46\nmov     rdx, qword ptr [rsp+98h+var_40+8]                              ; +0x137, 0x1401dea47\ncmp     rdx, 0Fh                                                       ; +0x13c, 0x1401dea4c\njbe     short loc_1401DEA87                                            ; +0x140, 0x1401dea50\ninc     rdx                                                            ; +0x142, 0x1401dea52\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x145, 0x1401dea55\nmov     rax, rcx                                                       ; +0x14a, 0x1401dea5a\ncmp     rdx, 1000h                                                     ; +0x14d, 0x1401dea5d\njb      short loc_1401DEA82                                            ; +0x154, 0x1401dea64\nadd     rdx, 27h ; '''                                                 ; +0x156, 0x1401dea66\nmov     rcx, [rcx-8]                                                   ; +0x15a, 0x1401dea6a\nsub     rax, rcx                                                       ; +0x15e, 0x1401dea6e\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x161, 0x1401dea71\ncmp     rax, 1Fh                                                       ; +0x165, 0x1401dea75\njbe     short loc_1401DEA82                                            ; +0x169, 0x1401dea79\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x16b, 0x1401dea7b\nalign 2                                                                ; +0x171, 0x1401dea81\ncall    j_j_free                                                       ; +0x172, 0x1401dea82\nmov     edx, [rdi+36Ch]                                                ; +0x177, 0x1401dea87\nsub     edx, [rdi+370h]                                                ; +0x17d, 0x1401dea8d\ntest    edx, edx                                                       ; +0x183, 0x1401dea93\njle     short loc_1401DEAA0                                            ; +0x185, 0x1401dea95\nlea     rcx, aDdemonI; \"ddemon_%i\"                                     ; +0x187, 0x1401dea97\njmp     short loc_1401DEAC5                                            ; +0x18e, 0x1401dea9e\nmov     edx, [rdi+148h]                                                ; +0x190, 0x1401deaa0\nmov     eax, [rdi+14Ch]                                                ; +0x196, 0x1401deaa6\nsub     edx, eax                                                       ; +0x19c, 0x1401deaac\ncmp     byte ptr [rdi+2C9h], 0                                         ; +0x19e, 0x1401deaae\nlea     rcx, aGdemonI; \"gdemon_%i\"                                     ; +0x1a5, 0x1401deab5\njnz     short loc_1401DEAC5                                            ; +0x1ac, 0x1401deabc\nlea     rcx, aDemonI; \"demon_%i\"                                       ; +0x1ae, 0x1401deabe\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1b5, 0x1401deac5\nmov     rcx, rax                                                       ; +0x1bb, 0x1401deacb\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x1be, 0x1401deace\nxorps   xmm0, xmm0                                                     ; +0x1c4, 0x1401dead4\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0x1c7, 0x1401dead7\nxorps   xmm1, xmm1                                                     ; +0x1cc, 0x1401deadc\nmovdqu  [rsp+98h+var_40], xmm1                                         ; +0x1cf, 0x1401deadf\ninc     rbx                                                            ; +0x1d5, 0x1401deae5\ncmp     byte ptr [rax+rbx], 0                                          ; +0x1d8, 0x1401deae8\njnz     short loc_1401DEAE5                                            ; +0x1dc, 0x1401deaec\nmov     r8, rbx                                                        ; +0x1de, 0x1401deaee\nmov     rdx, rax                                                       ; +0x1e1, 0x1401deaf1\nlea     rcx, [rsp+98h+Block]                                           ; +0x1e4, 0x1401deaf4\ncall    sub_14003A930                                                  ; +0x1e9, 0x1401deaf9\nnop                                                                    ; +0x1ee, 0x1401deafe\nlea     r8, [rsp+98h+Block]                                            ; +0x1ef, 0x1401deaff\nmov     rdx, [rsi+148h]                                                ; +0x1f4, 0x1401deb04\nmov     rcx, [rsi+2C8h]                                                ; +0x1fb, 0x1401deb0b\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x202, 0x1401deb12\nnop                                                                    ; +0x208, 0x1401deb18\nmov     rdx, qword ptr [rsp+98h+var_40+8]                              ; +0x209, 0x1401deb19\ncmp     rdx, 0Fh                                                       ; +0x20e, 0x1401deb1e\njbe     short loc_1401DEB5A                                            ; +0x212, 0x1401deb22\ninc     rdx                                                            ; +0x214, 0x1401deb24\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x217, 0x1401deb27\nmov     rax, rcx                                                       ; +0x21c, 0x1401deb2c\ncmp     rdx, 1000h                                                     ; +0x21f, 0x1401deb2f\njb      short loc_1401DEB54                                            ; +0x226, 0x1401deb36\nadd     rdx, 27h ; '''                                                 ; +0x228, 0x1401deb38\nmov     rcx, [rcx-8]                                                   ; +0x22c, 0x1401deb3c\nsub     rax, rcx                                                       ; +0x230, 0x1401deb40\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x233, 0x1401deb43\ncmp     rax, 1Fh                                                       ; +0x237, 0x1401deb47\njbe     short loc_1401DEB54                                            ; +0x23b, 0x1401deb4b\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x23d, 0x1401deb4d\nalign 4                                                                ; +0x243, 0x1401deb53\ncall    j_j_free                                                       ; +0x244, 0x1401deb54\nnop                                                                    ; +0x249, 0x1401deb59\nlea     rcx, [rsp+98h+var_30]                                          ; +0x24a, 0x1401deb5a\ncall    sub_14003A830                                                  ; +0x24f, 0x1401deb5f\nmov     rcx, [rsp+98h+var_10]                                          ; +0x254, 0x1401deb64\nxor     rcx, rsp; StackCookie                                          ; +0x25c, 0x1401deb6c\ncall    __security_check_cookie                                        ; +0x25f, 0x1401deb6f\nlea     r11, [rsp+98h+var_8]                                           ; +0x264, 0x1401deb74\nmov     rbx, [r11+20h]                                                 ; +0x26c, 0x1401deb7c\nmov     rsi, [r11+28h]                                                 ; +0x270, 0x1401deb80\nmov     rsp, r11                                                       ; +0x274, 0x1401deb84\npop     rdi                                                            ; +0x277, 0x1401deb87\nretn                                                                   ; +0x278, 0x1401deb88", "xrefs": ["GameManager::recountUserStats @ 0x140185262", "<???> @ 0x1406cc42c"], "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"}