{"type": "func", "start": 5371397152, "end": 5371397360, "name": "GJOptionsLayer::countForPage", "pseudocode": "// \n// GJOptionsLayer::countForPage from 0x140290420 to 0x1402904f0 (208 bytes)\n// \n// 3 xrefs:\n// > sub_140290310 @ 0x1402903a5\n// > GJOptionsLayer::incrementCountForPage @ 0x140290513\n// > <???> @ 0x1406d194c\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\nint GJOptionsLayer::countForPage(GJOptionsLayer *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(\"page_%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_values, 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; GJOptionsLayer::countForPage from 0x140290420 to 0x1402904f0 (208 bytes)\n; \n; 3 xrefs:\n; > sub_140290310 @ 0x1402903a5\n; > GJOptionsLayer::incrementCountForPage @ 0x140290513\n; > <???> @ 0x1406d194c\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, 0x140290420\nsub     rsp, 50h                                                       ; +0x2, 0x140290422\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x140290426\nxor     rax, rsp                                                       ; +0xd, 0x14029042d\nmov     [rsp+58h+var_18], rax                                          ; +0x10, 0x140290430\nmov     rbx, rcx                                                       ; +0x15, 0x140290435\nlea     rcx, aPageI; \"page_%i\"                                         ; +0x18, 0x140290438\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1f, 0x14029043f\nmov     rcx, rax                                                       ; +0x25, 0x140290445\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x28, 0x140290448\nxorps   xmm0, xmm0                                                     ; +0x2e, 0x14029044e\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x31, 0x140290451\nxorps   xmm1, xmm1                                                     ; +0x36, 0x140290456\nmovdqu  [rsp+58h+var_28], xmm1                                         ; +0x39, 0x140290459\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x3f, 0x14029045f\ninc     r8                                                             ; +0x46, 0x140290466\ncmp     byte ptr [rax+r8], 0                                           ; +0x49, 0x140290469\njnz     short loc_140290466                                            ; +0x4e, 0x14029046e\nmov     rdx, rax                                                       ; +0x50, 0x140290470\nlea     rcx, [rsp+58h+Block]                                           ; +0x53, 0x140290473\ncall    sub_14003A930                                                  ; +0x58, 0x140290478\nnop                                                                    ; +0x5d, 0x14029047d\nlea     rdx, [rsp+58h+Block]                                           ; +0x5e, 0x14029047e\nmov     rcx, [rbx+3C8h]                                                ; +0x63, 0x140290483\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, 0x14029048a\nmov     rcx, rax                                                       ; +0x70, 0x140290490\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x73, 0x140290493\nmov     ebx, eax                                                       ; +0x79, 0x140290499\nmov     rdx, qword ptr [rsp+58h+var_28+8]                              ; +0x7b, 0x14029049b\ncmp     rdx, 0Fh                                                       ; +0x80, 0x1402904a0\njbe     short loc_1402904DB                                            ; +0x84, 0x1402904a4\ninc     rdx                                                            ; +0x86, 0x1402904a6\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0x89, 0x1402904a9\nmov     rax, rcx                                                       ; +0x8e, 0x1402904ae\ncmp     rdx, 1000h                                                     ; +0x91, 0x1402904b1\njb      short loc_1402904D6                                            ; +0x98, 0x1402904b8\nadd     rdx, 27h ; '''                                                 ; +0x9a, 0x1402904ba\nmov     rcx, [rcx-8]                                                   ; +0x9e, 0x1402904be\nsub     rax, rcx                                                       ; +0xa2, 0x1402904c2\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa5, 0x1402904c5\ncmp     rax, 1Fh                                                       ; +0xa9, 0x1402904c9\njbe     short loc_1402904D6                                            ; +0xad, 0x1402904cd\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xaf, 0x1402904cf\nalign 2                                                                ; +0xb5, 0x1402904d5\ncall    j_j_free                                                       ; +0xb6, 0x1402904d6\nmov     eax, ebx                                                       ; +0xbb, 0x1402904db\nmov     rcx, [rsp+58h+var_18]                                          ; +0xbd, 0x1402904dd\nxor     rcx, rsp; StackCookie                                          ; +0xc2, 0x1402904e2\ncall    __security_check_cookie                                        ; +0xc5, 0x1402904e5\nadd     rsp, 50h                                                       ; +0xca, 0x1402904ea\npop     rbx                                                            ; +0xce, 0x1402904ee\nretn                                                                   ; +0xcf, 0x1402904ef", "xrefs": ["sub_140290310 @ 0x1402903a5", "GJOptionsLayer::incrementCountForPage @ 0x140290513", "<???> @ 0x1406d194c"], "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"}