{"type": "func", "start": 5370683360, "end": 5370683571, "name": "GameStatsManager::getSecondaryQueuedChallenge", "pseudocode": "// \n// GameStatsManager::getSecondaryQueuedChallenge from 0x1401e1fe0 to 0x1401e20b3 (211 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::onGetGJChallengesCompleted @ 0x1401684d7\n// > GameStatsManager::processChallengeQueue @ 0x1401e2955\n// > <???> @ 0x1406cc570\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\nGJChallengeItem *GameStatsManager::getSecondaryQueuedChallenge(GameStatsManager *a1, int a2)\n{\n  cocos2d::CCString *v3; // rax\n  const char *CString; // rax\n  size_t v5; // r8\n  GJChallengeItem *v6; // rbx\n  void *v7; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-38h] BYREF\n  __int128 v10; // [rsp+30h] [rbp-28h]\n\n  v3 = cocos2d::CCString::createWithFormat(\"%i\", a2 + 100);\n  CString = cocos2d::CCString::getCString(v3);\n  *(_OWORD *)Block = 0;\n  v10 = 0;\n  v5 = -1;\n  do\n    ++v5;\n  while ( CString[v5] );\n  sub_14003A930(Block, CString, v5);\n  v6 = (GJChallengeItem *)cocos2d::CCDictionary::objectForKey(a1->m_upcomingChallenges, Block);\n  if ( *((_QWORD *)&v10 + 1) > 0xFu )\n  {\n    v7 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v10 + 1) + 1LL) >= 0x1000 )\n    {\n      v7 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v7);\n  }\n  return v6;\n}", "assembly": "; \n; GameStatsManager::getSecondaryQueuedChallenge from 0x1401e1fe0 to 0x1401e20b3 (211 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::onGetGJChallengesCompleted @ 0x1401684d7\n; > GameStatsManager::processChallengeQueue @ 0x1401e2955\n; > <???> @ 0x1406cc570\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    rbx                                                            ; +0x0, 0x1401e1fe0\nsub     rsp, 50h                                                       ; +0x2, 0x1401e1fe2\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x1401e1fe6\nxor     rax, rsp                                                       ; +0xd, 0x1401e1fed\nmov     [rsp+58h+var_18], rax                                          ; +0x10, 0x1401e1ff0\nmov     rbx, rcx                                                       ; +0x15, 0x1401e1ff5\nadd     edx, 64h ; 'd'                                                 ; +0x18, 0x1401e1ff8\nlea     rcx, aI_11; \"%i\"                                               ; +0x1b, 0x1401e1ffb\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x22, 0x1401e2002\nmov     rcx, rax                                                       ; +0x28, 0x1401e2008\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x2b, 0x1401e200b\nxorps   xmm0, xmm0                                                     ; +0x31, 0x1401e2011\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x34, 0x1401e2014\nxorps   xmm1, xmm1                                                     ; +0x39, 0x1401e2019\nmovdqu  [rsp+58h+var_28], xmm1                                         ; +0x3c, 0x1401e201c\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x42, 0x1401e2022\nnop     dword ptr [rax+00000000h]                                      ; +0x49, 0x1401e2029\ninc     r8                                                             ; +0x50, 0x1401e2030\ncmp     byte ptr [rax+r8], 0                                           ; +0x53, 0x1401e2033\njnz     short loc_1401E2030                                            ; +0x58, 0x1401e2038\nmov     rdx, rax                                                       ; +0x5a, 0x1401e203a\nlea     rcx, [rsp+58h+Block]                                           ; +0x5d, 0x1401e203d\ncall    sub_14003A930                                                  ; +0x62, 0x1401e2042\nnop                                                                    ; +0x67, 0x1401e2047\nlea     rdx, [rsp+58h+Block]                                           ; +0x68, 0x1401e2048\nmov     rcx, [rbx+230h]                                                ; +0x6d, 0x1401e204d\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 &) ; +0x74, 0x1401e2054\nmov     rbx, rax                                                       ; +0x7a, 0x1401e205a\nmov     rdx, qword ptr [rsp+58h+var_28+8]                              ; +0x7d, 0x1401e205d\ncmp     rdx, 0Fh                                                       ; +0x82, 0x1401e2062\njbe     short loc_1401E209D                                            ; +0x86, 0x1401e2066\ninc     rdx                                                            ; +0x88, 0x1401e2068\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0x8b, 0x1401e206b\nmov     rax, rcx                                                       ; +0x90, 0x1401e2070\ncmp     rdx, 1000h                                                     ; +0x93, 0x1401e2073\njb      short loc_1401E2098                                            ; +0x9a, 0x1401e207a\nadd     rdx, 27h ; '''                                                 ; +0x9c, 0x1401e207c\nmov     rcx, [rcx-8]                                                   ; +0xa0, 0x1401e2080\nsub     rax, rcx                                                       ; +0xa4, 0x1401e2084\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa7, 0x1401e2087\ncmp     rax, 1Fh                                                       ; +0xab, 0x1401e208b\njbe     short loc_1401E2098                                            ; +0xaf, 0x1401e208f\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xb1, 0x1401e2091\nalign 8                                                                ; +0xb7, 0x1401e2097\ncall    j_j_free                                                       ; +0xb8, 0x1401e2098\nmov     rax, rbx                                                       ; +0xbd, 0x1401e209d\nmov     rcx, [rsp+58h+var_18]                                          ; +0xc0, 0x1401e20a0\nxor     rcx, rsp; StackCookie                                          ; +0xc5, 0x1401e20a5\ncall    __security_check_cookie                                        ; +0xc8, 0x1401e20a8\nadd     rsp, 50h                                                       ; +0xcd, 0x1401e20ad\npop     rbx                                                            ; +0xd1, 0x1401e20b1\nretn                                                                   ; +0xd2, 0x1401e20b2", "xrefs": ["GameLevelManager::onGetGJChallengesCompleted @ 0x1401684d7", "GameStatsManager::processChallengeQueue @ 0x1401e2955", "<???> @ 0x1406cc570"], "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"}