{"type": "func", "start": 5372492592, "end": 5372493045, "name": "GJOptionsLayer::layerForPage", "pseudocode": "// \n// GJOptionsLayer::layerForPage from 0x14039bb30 to 0x14039bcf5 (453 bytes)\n// \n// 2 xrefs:\n// > GJOptionsLayer::addToggleInternal @ 0x14039b240\n// > <???> @ 0x140923354\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// Hidden C++ exception states: #wind=1\n__int64 __fastcall GJOptionsLayer::layerForPage(__int64 a1, int a2)\n{\n  cocos2d::CCString *v4; // rax\n  const char *CString; // rax\n  size_t v6; // rbx\n  size_t v7; // r8\n  __int64 v8; // rdi\n  void *v9; // r8\n  cocos2d::CCString *v10; // rax\n  const char *v11; // rax\n  void *v12; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-48h] BYREF\n  __int128 v15; // [rsp+40h] [rbp-38h]\n\n  v4 = cocos2d::CCString::createWithFormat(\"layer_%i\", a2);\n  CString = cocos2d::CCString::getCString(v4);\n  *(_OWORD *)Block = 0;\n  v15 = 0;\n  v6 = -1;\n  v7 = -1;\n  do\n    ++v7;\n  while ( CString[v7] );\n  sub_14003D230(Block, CString, v7);\n  v8 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1032), Block);\n  if ( *((_QWORD *)&v15 + 1) > 0xFu )\n  {\n    v9 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v15 + 1) + 1LL) >= 0x1000 )\n    {\n      v9 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v9);\n  }\n  if ( !v8 )\n  {\n    v8 = cocos2d::CCLayer::create();\n    (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v8);\n    v10 = cocos2d::CCString::createWithFormat(\"layer_%i\", a2);\n    v11 = cocos2d::CCString::getCString(v10);\n    *(_OWORD *)Block = 0;\n    v15 = 0;\n    do\n      ++v6;\n    while ( v11[v6] );\n    sub_14003D230(Block, v11, v6);\n    cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 1032), v8, Block);\n    if ( *((_QWORD *)&v15 + 1) > 0xFu )\n    {\n      v12 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v15 + 1) + 1LL) >= 0x1000 )\n      {\n        v12 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v12);\n    }\n  }\n  return v8;\n}", "assembly": "; \n; GJOptionsLayer::layerForPage from 0x14039bb30 to 0x14039bcf5 (453 bytes)\n; \n; 2 xrefs:\n; > GJOptionsLayer::addToggleInternal @ 0x14039b240\n; > <???> @ 0x140923354\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; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x14039bb30\npush    rbp                                                            ; +0x5, 0x14039bb35\npush    rsi                                                            ; +0x6, 0x14039bb36\npush    rdi                                                            ; +0x7, 0x14039bb37\nsub     rsp, 60h                                                       ; +0x8, 0x14039bb38\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x14039bb3c\nxor     rax, rsp                                                       ; +0x13, 0x14039bb43\nmov     [rsp+78h+var_28], rax                                          ; +0x16, 0x14039bb46\nmov     ebp, edx                                                       ; +0x1b, 0x14039bb4b\nmov     rsi, rcx                                                       ; +0x1d, 0x14039bb4d\nlea     rcx, aLayerI; \"layer_%i\"                                       ; +0x20, 0x14039bb50\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x27, 0x14039bb57\nmov     rcx, rax                                                       ; +0x2d, 0x14039bb5d\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x30, 0x14039bb60\nxorps   xmm0, xmm0                                                     ; +0x36, 0x14039bb66\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x39, 0x14039bb69\nxorps   xmm1, xmm1                                                     ; +0x3e, 0x14039bb6e\nmovdqu  [rsp+78h+var_38], xmm1                                         ; +0x41, 0x14039bb71\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0x47, 0x14039bb77\nmov     r8, rbx                                                        ; +0x4e, 0x14039bb7e\ninc     r8                                                             ; +0x51, 0x14039bb81\ncmp     byte ptr [rax+r8], 0                                           ; +0x54, 0x14039bb84\njnz     short loc_14039BB81                                            ; +0x59, 0x14039bb89\nmov     rdx, rax                                                       ; +0x5b, 0x14039bb8b\nlea     rcx, [rsp+78h+Block]                                           ; +0x5e, 0x14039bb8e\ncall    sub_14003D230                                                  ; +0x63, 0x14039bb93\nnop                                                                    ; +0x68, 0x14039bb98\nlea     rdx, [rsp+78h+Block]                                           ; +0x69, 0x14039bb99\nmov     rcx, [rsi+408h]                                                ; +0x6e, 0x14039bb9e\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 &) ; +0x75, 0x14039bba5\nmov     rdi, rax                                                       ; +0x7b, 0x14039bbab\nmov     rdx, qword ptr [rsp+78h+var_38+8]                              ; +0x7e, 0x14039bbae\ncmp     rdx, 0Fh                                                       ; +0x83, 0x14039bbb3\njbe     short loc_14039BC04                                            ; +0x87, 0x14039bbb7\ninc     rdx                                                            ; +0x89, 0x14039bbb9\nmov     r8, [rsp+78h+Block]                                            ; +0x8c, 0x14039bbbc\nmov     rcx, r8                                                        ; +0x91, 0x14039bbc1\ncmp     rdx, 1000h                                                     ; +0x94, 0x14039bbc4\njb      short loc_14039BBFC                                            ; +0x9b, 0x14039bbcb\nadd     rdx, 27h ; '''                                                 ; +0x9d, 0x14039bbcd\nmov     r8, [r8-8]                                                     ; +0xa1, 0x14039bbd1\nsub     rcx, r8                                                        ; +0xa5, 0x14039bbd5\nsub     rcx, 8                                                         ; +0xa8, 0x14039bbd8\ncmp     rcx, 1Fh                                                       ; +0xac, 0x14039bbdc\njbe     short loc_14039BBFC                                            ; +0xb0, 0x14039bbe0\nmov     [rsp+78h+Reserved], 0; Reserved                                ; +0xb2, 0x14039bbe2\nxor     r9d, r9d; LineNo                                               ; +0xbb, 0x14039bbeb\nxor     r8d, r8d; FileName                                             ; +0xbe, 0x14039bbee\nxor     edx, edx; FunctionName                                         ; +0xc1, 0x14039bbf1\nxor     ecx, ecx; Expression                                           ; +0xc3, 0x14039bbf3\ncall    cs:_invoke_watson                                              ; +0xc5, 0x14039bbf5\nalign 4                                                                ; +0xcb, 0x14039bbfb\nmov     rcx, r8; Block                                                 ; +0xcc, 0x14039bbfc\ncall    j_j_free                                                       ; +0xcf, 0x14039bbff\ntest    rdi, rdi                                                       ; +0xd4, 0x14039bc04\njnz     loc_14039BCD5                                                  ; +0xd7, 0x14039bc07\ncall    cs:?create@CCLayer@cocos2d@@SAPEAV12@XZ; cocos2d::CCLayer::create(void) ; +0xdd, 0x14039bc0d\nmov     rdi, rax                                                       ; +0xe3, 0x14039bc13\nmov     rcx, [rsi+248h]                                                ; +0xe6, 0x14039bc16\nmov     rax, [rcx]                                                     ; +0xed, 0x14039bc1d\nmov     rdx, rdi                                                       ; +0xf0, 0x14039bc20\ncall    qword ptr [rax+1D0h]                                           ; +0xf3, 0x14039bc23\nmov     edx, ebp                                                       ; +0xf9, 0x14039bc29\nlea     rcx, aLayerI; \"layer_%i\"                                       ; +0xfb, 0x14039bc2b\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x102, 0x14039bc32\nmov     rcx, rax                                                       ; +0x108, 0x14039bc38\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x10b, 0x14039bc3b\nxorps   xmm0, xmm0                                                     ; +0x111, 0x14039bc41\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x114, 0x14039bc44\nxorps   xmm1, xmm1                                                     ; +0x119, 0x14039bc49\nmovdqu  [rsp+78h+var_38], xmm1                                         ; +0x11c, 0x14039bc4c\ninc     rbx                                                            ; +0x122, 0x14039bc52\ncmp     byte ptr [rax+rbx], 0                                          ; +0x125, 0x14039bc55\njnz     short loc_14039BC52                                            ; +0x129, 0x14039bc59\nmov     r8, rbx                                                        ; +0x12b, 0x14039bc5b\nmov     rdx, rax                                                       ; +0x12e, 0x14039bc5e\nlea     rcx, [rsp+78h+Block]                                           ; +0x131, 0x14039bc61\ncall    sub_14003D230                                                  ; +0x136, 0x14039bc66\nnop                                                                    ; +0x13b, 0x14039bc6b\nlea     r8, [rsp+78h+Block]                                            ; +0x13c, 0x14039bc6c\nmov     rdx, rdi                                                       ; +0x141, 0x14039bc71\nmov     rcx, [rsi+408h]                                                ; +0x144, 0x14039bc74\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 &) ; +0x14b, 0x14039bc7b\nnop                                                                    ; +0x151, 0x14039bc81\nmov     rdx, qword ptr [rsp+78h+var_38+8]                              ; +0x152, 0x14039bc82\ncmp     rdx, 0Fh                                                       ; +0x157, 0x14039bc87\njbe     short loc_14039BCD5                                            ; +0x15b, 0x14039bc8b\ninc     rdx                                                            ; +0x15d, 0x14039bc8d\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x160, 0x14039bc90\nmov     rax, rcx                                                       ; +0x165, 0x14039bc95\ncmp     rdx, 1000h                                                     ; +0x168, 0x14039bc98\njb      short loc_14039BCD0                                            ; +0x16f, 0x14039bc9f\nadd     rdx, 27h ; '''                                                 ; +0x171, 0x14039bca1\nmov     rcx, [rcx-8]                                                   ; +0x175, 0x14039bca5\nsub     rax, rcx                                                       ; +0x179, 0x14039bca9\nsub     rax, 8                                                         ; +0x17c, 0x14039bcac\ncmp     rax, 1Fh                                                       ; +0x180, 0x14039bcb0\njbe     short loc_14039BCD0                                            ; +0x184, 0x14039bcb4\nmov     [rsp+78h+Reserved], 0; Reserved                                ; +0x186, 0x14039bcb6\nxor     r9d, r9d; LineNo                                               ; +0x18f, 0x14039bcbf\nxor     r8d, r8d; FileName                                             ; +0x192, 0x14039bcc2\nxor     edx, edx; FunctionName                                         ; +0x195, 0x14039bcc5\nxor     ecx, ecx; Expression                                           ; +0x197, 0x14039bcc7\ncall    cs:_invoke_watson                                              ; +0x199, 0x14039bcc9\nalign 10h                                                              ; +0x19f, 0x14039bccf\ncall    j_j_free                                                       ; +0x1a0, 0x14039bcd0\nmov     rax, rdi                                                       ; +0x1a5, 0x14039bcd5\nmov     rcx, [rsp+78h+var_28]                                          ; +0x1a8, 0x14039bcd8\nxor     rcx, rsp; StackCookie                                          ; +0x1ad, 0x14039bcdd\ncall    __security_check_cookie                                        ; +0x1b0, 0x14039bce0\nmov     rbx, [rsp+78h+arg_10]                                          ; +0x1b5, 0x14039bce5\nadd     rsp, 60h                                                       ; +0x1bd, 0x14039bced\npop     rdi                                                            ; +0x1c1, 0x14039bcf1\npop     rsi                                                            ; +0x1c2, 0x14039bcf2\npop     rbp                                                            ; +0x1c3, 0x14039bcf3\nretn                                                                   ; +0x1c4, 0x14039bcf4", "xrefs": ["GJOptionsLayer::addToggleInternal @ 0x14039b240", "<???> @ 0x140923354"], "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"}