{"type": "func", "start": 5371397360, "end": 5371397611, "name": "GJOptionsLayer::incrementCountForPage", "pseudocode": "// \n// GJOptionsLayer::incrementCountForPage from 0x1402904f0 to 0x1402905eb (251 bytes)\n// \n// 4 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x1402900a0\n// > GameOptionsLayer::setupOptions @ 0x14029f687\n// > <???> @ 0x1406d194c\n// > <???> @ 0x1406d1958\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\nvoid GJOptionsLayer::incrementCountForPage(GJOptionsLayer *a1, int a2)\n{\n  int v4; // edi\n  cocos2d::CCString *v5; // rax\n  const char *CString; // rax\n  size_t v7; // r8\n  struct cocos2d::CCString *v8; // rax\n  void *v9; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-38h] BYREF\n  __int128 v11; // [rsp+30h] [rbp-28h]\n\n  v4 = GJOptionsLayer::countForPage(a1, a2);\n  v5 = cocos2d::CCString::createWithFormat(\"page_%i\", a2);\n  CString = cocos2d::CCString::getCString(v5);\n  *(_OWORD *)Block = 0;\n  v11 = 0;\n  v7 = -1;\n  do\n    ++v7;\n  while ( CString[v7] );\n  sub_14003A930(Block, CString, v7);\n  v8 = cocos2d::CCString::createWithFormat(\"%i\", v4 + 1);\n  cocos2d::CCDictionary::setObject(a1->m_values, v8, Block);\n  if ( *((_QWORD *)&v11 + 1) > 0xFu )\n  {\n    v9 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v11 + 1) + 1LL) >= 0x1000 )\n    {\n      v9 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v9);\n  }\n}", "assembly": "; \n; GJOptionsLayer::incrementCountForPage from 0x1402904f0 to 0x1402905eb (251 bytes)\n; \n; 4 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x1402900a0\n; > GameOptionsLayer::setupOptions @ 0x14029f687\n; > <???> @ 0x1406d194c\n; > <???> @ 0x1406d1958\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, 0x1402904f0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1402904f5\npush    rdi                                                            ; +0xa, 0x1402904fa\nsub     rsp, 50h                                                       ; +0xb, 0x1402904fb\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x1402904ff\nxor     rax, rsp                                                       ; +0x16, 0x140290506\nmov     [rsp+58h+var_18], rax                                          ; +0x19, 0x140290509\nmov     ebx, edx                                                       ; +0x1e, 0x14029050e\nmov     rsi, rcx                                                       ; +0x20, 0x140290510\ncall    GJOptionsLayer__countForPage                                   ; +0x23, 0x140290513\nmov     edi, eax                                                       ; +0x28, 0x140290518\nmov     edx, ebx                                                       ; +0x2a, 0x14029051a\nlea     rcx, aPageI; \"page_%i\"                                         ; +0x2c, 0x14029051c\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x33, 0x140290523\nmov     rcx, rax                                                       ; +0x39, 0x140290529\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x3c, 0x14029052c\nxorps   xmm0, xmm0                                                     ; +0x42, 0x140290532\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x45, 0x140290535\nxorps   xmm1, xmm1                                                     ; +0x4a, 0x14029053a\nmovdqu  [rsp+58h+var_28], xmm1                                         ; +0x4d, 0x14029053d\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x53, 0x140290543\nnop     word ptr [rax+rax+00h]                                         ; +0x5a, 0x14029054a\ninc     r8                                                             ; +0x60, 0x140290550\ncmp     byte ptr [rax+r8], 0                                           ; +0x63, 0x140290553\njnz     short loc_140290550                                            ; +0x68, 0x140290558\nmov     rdx, rax                                                       ; +0x6a, 0x14029055a\nlea     rcx, [rsp+58h+Block]                                           ; +0x6d, 0x14029055d\ncall    sub_14003A930                                                  ; +0x72, 0x140290562\nnop                                                                    ; +0x77, 0x140290567\nlea     edx, [rdi+1]                                                   ; +0x78, 0x140290568\nlea     rcx, aI_11; \"%i\"                                               ; +0x7b, 0x14029056b\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x82, 0x140290572\nmov     rdx, rax                                                       ; +0x88, 0x140290578\nlea     r8, [rsp+58h+Block]                                            ; +0x8b, 0x14029057b\nmov     rcx, [rsi+3C8h]                                                ; +0x90, 0x140290580\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, 0x140290587\nnop                                                                    ; +0x9d, 0x14029058d\nmov     rdx, qword ptr [rsp+58h+var_28+8]                              ; +0x9e, 0x14029058e\ncmp     rdx, 0Fh                                                       ; +0xa3, 0x140290593\njbe     short loc_1402905CE                                            ; +0xa7, 0x140290597\ninc     rdx                                                            ; +0xa9, 0x140290599\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0xac, 0x14029059c\nmov     rax, rcx                                                       ; +0xb1, 0x1402905a1\ncmp     rdx, 1000h                                                     ; +0xb4, 0x1402905a4\njb      short loc_1402905C9                                            ; +0xbb, 0x1402905ab\nadd     rdx, 27h ; '''                                                 ; +0xbd, 0x1402905ad\nmov     rcx, [rcx-8]                                                   ; +0xc1, 0x1402905b1\nsub     rax, rcx                                                       ; +0xc5, 0x1402905b5\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xc8, 0x1402905b8\ncmp     rax, 1Fh                                                       ; +0xcc, 0x1402905bc\njbe     short loc_1402905C9                                            ; +0xd0, 0x1402905c0\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xd2, 0x1402905c2\ndb 0CCh                                                                ; +0xd8, 0x1402905c8\ncall    j_j_free                                                       ; +0xd9, 0x1402905c9\nmov     rcx, [rsp+58h+var_18]                                          ; +0xde, 0x1402905ce\nxor     rcx, rsp; StackCookie                                          ; +0xe3, 0x1402905d3\ncall    __security_check_cookie                                        ; +0xe6, 0x1402905d6\nmov     rbx, [rsp+58h+arg_10]                                          ; +0xeb, 0x1402905db\nmov     rsi, [rsp+58h+arg_18]                                          ; +0xf0, 0x1402905e0\nadd     rsp, 50h                                                       ; +0xf5, 0x1402905e5\npop     rdi                                                            ; +0xf9, 0x1402905e9\nretn                                                                   ; +0xfa, 0x1402905ea", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x1402900a0", "GameOptionsLayer::setupOptions @ 0x14029f687", "<???> @ 0x1406d194c", "<???> @ 0x1406d1958"], "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"}