{"type": "func", "start": 5370203680, "end": 5370203888, "name": "GJGameLevel::getLastBuildPageForTab", "pseudocode": "// \n// GJGameLevel::getLastBuildPageForTab from 0x14016ce20 to 0x14016cef0 (208 bytes)\n// \n// 2 xrefs:\n// > EditorUI::setupCreateMenu @ 0x14010dd77\n// > <???> @ 0x1406cadd0\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 GJGameLevel::getLastBuildPageForTab(GJGameLevel *a1, int a2)\n{\n  cocos2d::CCString *v3; // rax\n  const char *CString; // rax\n  size_t v5; // r8\n  cocos2d::CCString *v6; // rax\n  int v7; // ebx\n  void *v8; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-38h] BYREF\n  __int128 v11; // [rsp+30h] [rbp-28h]\n\n  v3 = cocos2d::CCString::createWithFormat(\"%i\", a2);\n  CString = cocos2d::CCString::getCString(v3);\n  *(_OWORD *)Block = 0;\n  v11 = 0;\n  v5 = -1;\n  do\n    ++v5;\n  while ( CString[v5] );\n  sub_14003A930(Block, CString, v5);\n  v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(a1->m_lastBuildSave, Block);\n  v7 = cocos2d::CCString::intValue(v6);\n  if ( *((_QWORD *)&v11 + 1) > 0xFu )\n  {\n    v8 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v11 + 1) + 1LL) >= 0x1000 )\n    {\n      v8 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v8);\n  }\n  return v7;\n}", "assembly": "; \n; GJGameLevel::getLastBuildPageForTab from 0x14016ce20 to 0x14016cef0 (208 bytes)\n; \n; 2 xrefs:\n; > EditorUI::setupCreateMenu @ 0x14010dd77\n; > <???> @ 0x1406cadd0\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, 0x14016ce20\nsub     rsp, 50h                                                       ; +0x2, 0x14016ce22\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x14016ce26\nxor     rax, rsp                                                       ; +0xd, 0x14016ce2d\nmov     [rsp+58h+var_18], rax                                          ; +0x10, 0x14016ce30\nmov     rbx, rcx                                                       ; +0x15, 0x14016ce35\nlea     rcx, aI_11; \"%i\"                                               ; +0x18, 0x14016ce38\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1f, 0x14016ce3f\nmov     rcx, rax                                                       ; +0x25, 0x14016ce45\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x28, 0x14016ce48\nxorps   xmm0, xmm0                                                     ; +0x2e, 0x14016ce4e\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x31, 0x14016ce51\nxorps   xmm1, xmm1                                                     ; +0x36, 0x14016ce56\nmovdqu  [rsp+58h+var_28], xmm1                                         ; +0x39, 0x14016ce59\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x3f, 0x14016ce5f\ninc     r8                                                             ; +0x46, 0x14016ce66\ncmp     byte ptr [rax+r8], 0                                           ; +0x49, 0x14016ce69\njnz     short loc_14016CE66                                            ; +0x4e, 0x14016ce6e\nmov     rdx, rax                                                       ; +0x50, 0x14016ce70\nlea     rcx, [rsp+58h+Block]                                           ; +0x53, 0x14016ce73\ncall    sub_14003A930                                                  ; +0x58, 0x14016ce78\nnop                                                                    ; +0x5d, 0x14016ce7d\nlea     rdx, [rsp+58h+Block]                                           ; +0x5e, 0x14016ce7e\nmov     rcx, [rbx+140h]                                                ; +0x63, 0x14016ce83\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0x6a, 0x14016ce8a\nmov     rcx, rax                                                       ; +0x70, 0x14016ce90\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x73, 0x14016ce93\nmov     ebx, eax                                                       ; +0x79, 0x14016ce99\nmov     rdx, qword ptr [rsp+58h+var_28+8]                              ; +0x7b, 0x14016ce9b\ncmp     rdx, 0Fh                                                       ; +0x80, 0x14016cea0\njbe     short loc_14016CEDB                                            ; +0x84, 0x14016cea4\ninc     rdx                                                            ; +0x86, 0x14016cea6\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0x89, 0x14016cea9\nmov     rax, rcx                                                       ; +0x8e, 0x14016ceae\ncmp     rdx, 1000h                                                     ; +0x91, 0x14016ceb1\njb      short loc_14016CED6                                            ; +0x98, 0x14016ceb8\nadd     rdx, 27h ; '''                                                 ; +0x9a, 0x14016ceba\nmov     rcx, [rcx-8]                                                   ; +0x9e, 0x14016cebe\nsub     rax, rcx                                                       ; +0xa2, 0x14016cec2\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa5, 0x14016cec5\ncmp     rax, 1Fh                                                       ; +0xa9, 0x14016cec9\njbe     short loc_14016CED6                                            ; +0xad, 0x14016cecd\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xaf, 0x14016cecf\nalign 2                                                                ; +0xb5, 0x14016ced5\ncall    j_j_free                                                       ; +0xb6, 0x14016ced6\nmov     eax, ebx                                                       ; +0xbb, 0x14016cedb\nmov     rcx, [rsp+58h+var_18]                                          ; +0xbd, 0x14016cedd\nxor     rcx, rsp; StackCookie                                          ; +0xc2, 0x14016cee2\ncall    __security_check_cookie                                        ; +0xc5, 0x14016cee5\nadd     rsp, 50h                                                       ; +0xca, 0x14016ceea\npop     rbx                                                            ; +0xce, 0x14016ceee\nretn                                                                   ; +0xcf, 0x14016ceef", "xrefs": ["EditorUI::setupCreateMenu @ 0x14010dd77", "<???> @ 0x1406cadd0"], "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"}