{"type": "func", "start": 5372491616, "end": 5372491846, "name": "GJOptionsLayer::countForPage", "pseudocode": "// \n// GJOptionsLayer::countForPage from 0x14039b760 to 0x14039b846 (230 bytes)\n// \n// 3 xrefs:\n// > GJOptionsLayer::nextPosition @ 0x14039b6e5\n// > GJOptionsLayer::incrementCountForPage @ 0x14039b873\n// > <???> @ 0x140923330\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:31:15 +0000\n// \n\n__int64 __fastcall GJOptionsLayer::countForPage(__int64 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  unsigned int v7; // ebx\n  void *v8; // r8\n  void *Block[2]; // [rsp+30h] [rbp-38h] BYREF\n  __int128 v11; // [rsp+40h] [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_14003D230(Block, CString, v5);\n  v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(a1 + 1032), 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        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v8);\n  }\n  return v7;\n}", "assembly": "; \n; GJOptionsLayer::countForPage from 0x14039b760 to 0x14039b846 (230 bytes)\n; \n; 3 xrefs:\n; > GJOptionsLayer::nextPosition @ 0x14039b6e5\n; > GJOptionsLayer::incrementCountForPage @ 0x14039b873\n; > <???> @ 0x140923330\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:31:15 +0000\n; \npush    rbx                                                            ; +0x0, 0x14039b760\nsub     rsp, 60h                                                       ; +0x2, 0x14039b762\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x14039b766\nxor     rax, rsp                                                       ; +0xd, 0x14039b76d\nmov     [rsp+68h+var_18], rax                                          ; +0x10, 0x14039b770\nmov     rbx, rcx                                                       ; +0x15, 0x14039b775\nlea     rcx, aPageI; \"page_%i\"                                         ; +0x18, 0x14039b778\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1f, 0x14039b77f\nmov     rcx, rax                                                       ; +0x25, 0x14039b785\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x28, 0x14039b788\nxorps   xmm0, xmm0                                                     ; +0x2e, 0x14039b78e\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x31, 0x14039b791\nxorps   xmm1, xmm1                                                     ; +0x36, 0x14039b796\nmovdqu  [rsp+68h+var_28], xmm1                                         ; +0x39, 0x14039b799\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x3f, 0x14039b79f\ninc     r8                                                             ; +0x46, 0x14039b7a6\ncmp     byte ptr [rax+r8], 0                                           ; +0x49, 0x14039b7a9\njnz     short loc_14039B7A6                                            ; +0x4e, 0x14039b7ae\nmov     rdx, rax                                                       ; +0x50, 0x14039b7b0\nlea     rcx, [rsp+68h+Block]                                           ; +0x53, 0x14039b7b3\ncall    sub_14003D230                                                  ; +0x58, 0x14039b7b8\nnop                                                                    ; +0x5d, 0x14039b7bd\nlea     rdx, [rsp+68h+Block]                                           ; +0x5e, 0x14039b7be\nmov     rcx, [rbx+408h]                                                ; +0x63, 0x14039b7c3\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, 0x14039b7ca\nmov     rcx, rax                                                       ; +0x70, 0x14039b7d0\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x73, 0x14039b7d3\nmov     ebx, eax                                                       ; +0x79, 0x14039b7d9\nmov     rdx, qword ptr [rsp+68h+var_28+8]                              ; +0x7b, 0x14039b7db\ncmp     rdx, 0Fh                                                       ; +0x80, 0x14039b7e0\njbe     short loc_14039B831                                            ; +0x84, 0x14039b7e4\ninc     rdx                                                            ; +0x86, 0x14039b7e6\nmov     r8, [rsp+68h+Block]                                            ; +0x89, 0x14039b7e9\nmov     rcx, r8                                                        ; +0x8e, 0x14039b7ee\ncmp     rdx, 1000h                                                     ; +0x91, 0x14039b7f1\njb      short loc_14039B829                                            ; +0x98, 0x14039b7f8\nadd     rdx, 27h ; '''                                                 ; +0x9a, 0x14039b7fa\nmov     r8, [r8-8]                                                     ; +0x9e, 0x14039b7fe\nsub     rcx, r8                                                        ; +0xa2, 0x14039b802\nsub     rcx, 8                                                         ; +0xa5, 0x14039b805\ncmp     rcx, 1Fh                                                       ; +0xa9, 0x14039b809\njbe     short loc_14039B829                                            ; +0xad, 0x14039b80d\nmov     [rsp+68h+Reserved], 0; Reserved                                ; +0xaf, 0x14039b80f\nxor     r9d, r9d; LineNo                                               ; +0xb8, 0x14039b818\nxor     r8d, r8d; FileName                                             ; +0xbb, 0x14039b81b\nxor     edx, edx; FunctionName                                         ; +0xbe, 0x14039b81e\nxor     ecx, ecx; Expression                                           ; +0xc0, 0x14039b820\ncall    cs:_invoke_watson                                              ; +0xc2, 0x14039b822\ndb 0CCh                                                                ; +0xc8, 0x14039b828\nmov     rcx, r8; Block                                                 ; +0xc9, 0x14039b829\ncall    j_j_free                                                       ; +0xcc, 0x14039b82c\nmov     eax, ebx                                                       ; +0xd1, 0x14039b831\nmov     rcx, [rsp+68h+var_18]                                          ; +0xd3, 0x14039b833\nxor     rcx, rsp; StackCookie                                          ; +0xd8, 0x14039b838\ncall    __security_check_cookie                                        ; +0xdb, 0x14039b83b\nadd     rsp, 60h                                                       ; +0xe0, 0x14039b840\npop     rbx                                                            ; +0xe4, 0x14039b844\nretn                                                                   ; +0xe5, 0x14039b845", "xrefs": ["GJOptionsLayer::nextPosition @ 0x14039b6e5", "GJOptionsLayer::incrementCountForPage @ 0x14039b873", "<???> @ 0x140923330"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}