{"type": "func", "start": 5373754800, "end": 5373755253, "name": "MoreVideoOptionsLayer::layerForPage", "pseudocode": "// \n// MoreVideoOptionsLayer::layerForPage from 0x1404cfdb0 to 0x1404cff75 (453 bytes)\n// \n// 4 xrefs:\n// > MoreVideoOptionsLayer::addToggle @ 0x1404cf6a2\n// > ParentalOptionsLayer::addMasterToggle @ 0x1404d1cbd\n// > ParentalOptionsLayer::addToggle @ 0x1404d2554\n// > <???> @ 0x140929714\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:33:00 +0000\n// \n\n// Merged with: MoreVideoOptionsLayer::layerForPage, ParentalOptionsLayer::layerForPage\n__int64 __fastcall MoreVideoOptionsLayer::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 + 680), 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 + 680), 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; MoreVideoOptionsLayer::layerForPage from 0x1404cfdb0 to 0x1404cff75 (453 bytes)\n; \n; 4 xrefs:\n; > MoreVideoOptionsLayer::addToggle @ 0x1404cf6a2\n; > ParentalOptionsLayer::addMasterToggle @ 0x1404d1cbd\n; > ParentalOptionsLayer::addToggle @ 0x1404d2554\n; > <???> @ 0x140929714\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:33:00 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1404cfdb0\npush    rbp                                                            ; +0x5, 0x1404cfdb5\npush    rsi                                                            ; +0x6, 0x1404cfdb6\npush    rdi                                                            ; +0x7, 0x1404cfdb7\nsub     rsp, 60h                                                       ; +0x8, 0x1404cfdb8\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x1404cfdbc\nxor     rax, rsp                                                       ; +0x13, 0x1404cfdc3\nmov     [rsp+78h+var_28], rax                                          ; +0x16, 0x1404cfdc6\nmov     ebp, edx                                                       ; +0x1b, 0x1404cfdcb\nmov     rsi, rcx                                                       ; +0x1d, 0x1404cfdcd\nlea     rcx, aLayerI; \"layer_%i\"                                       ; +0x20, 0x1404cfdd0\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x27, 0x1404cfdd7\nmov     rcx, rax                                                       ; +0x2d, 0x1404cfddd\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x30, 0x1404cfde0\nxorps   xmm0, xmm0                                                     ; +0x36, 0x1404cfde6\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x39, 0x1404cfde9\nxorps   xmm1, xmm1                                                     ; +0x3e, 0x1404cfdee\nmovdqu  [rsp+78h+var_38], xmm1                                         ; +0x41, 0x1404cfdf1\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0x47, 0x1404cfdf7\nmov     r8, rbx                                                        ; +0x4e, 0x1404cfdfe\ninc     r8                                                             ; +0x51, 0x1404cfe01\ncmp     byte ptr [rax+r8], 0                                           ; +0x54, 0x1404cfe04\njnz     short loc_1404CFE01                                            ; +0x59, 0x1404cfe09\nmov     rdx, rax                                                       ; +0x5b, 0x1404cfe0b\nlea     rcx, [rsp+78h+Block]                                           ; +0x5e, 0x1404cfe0e\ncall    sub_14003D230                                                  ; +0x63, 0x1404cfe13\nnop                                                                    ; +0x68, 0x1404cfe18\nlea     rdx, [rsp+78h+Block]                                           ; +0x69, 0x1404cfe19\nmov     rcx, [rsi+2A8h]                                                ; +0x6e, 0x1404cfe1e\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, 0x1404cfe25\nmov     rdi, rax                                                       ; +0x7b, 0x1404cfe2b\nmov     rdx, qword ptr [rsp+78h+var_38+8]                              ; +0x7e, 0x1404cfe2e\ncmp     rdx, 0Fh                                                       ; +0x83, 0x1404cfe33\njbe     short loc_1404CFE84                                            ; +0x87, 0x1404cfe37\ninc     rdx                                                            ; +0x89, 0x1404cfe39\nmov     r8, [rsp+78h+Block]                                            ; +0x8c, 0x1404cfe3c\nmov     rcx, r8                                                        ; +0x91, 0x1404cfe41\ncmp     rdx, 1000h                                                     ; +0x94, 0x1404cfe44\njb      short loc_1404CFE7C                                            ; +0x9b, 0x1404cfe4b\nadd     rdx, 27h ; '''                                                 ; +0x9d, 0x1404cfe4d\nmov     r8, [r8-8]                                                     ; +0xa1, 0x1404cfe51\nsub     rcx, r8                                                        ; +0xa5, 0x1404cfe55\nsub     rcx, 8                                                         ; +0xa8, 0x1404cfe58\ncmp     rcx, 1Fh                                                       ; +0xac, 0x1404cfe5c\njbe     short loc_1404CFE7C                                            ; +0xb0, 0x1404cfe60\nmov     [rsp+78h+Reserved], 0; Reserved                                ; +0xb2, 0x1404cfe62\nxor     r9d, r9d; LineNo                                               ; +0xbb, 0x1404cfe6b\nxor     r8d, r8d; FileName                                             ; +0xbe, 0x1404cfe6e\nxor     edx, edx; FunctionName                                         ; +0xc1, 0x1404cfe71\nxor     ecx, ecx; Expression                                           ; +0xc3, 0x1404cfe73\ncall    cs:_invoke_watson                                              ; +0xc5, 0x1404cfe75\nalign 4                                                                ; +0xcb, 0x1404cfe7b\nmov     rcx, r8; Block                                                 ; +0xcc, 0x1404cfe7c\ncall    j_j_free                                                       ; +0xcf, 0x1404cfe7f\ntest    rdi, rdi                                                       ; +0xd4, 0x1404cfe84\njnz     loc_1404CFF55                                                  ; +0xd7, 0x1404cfe87\ncall    cs:?create@CCLayer@cocos2d@@SAPEAV12@XZ; cocos2d::CCLayer::create(void) ; +0xdd, 0x1404cfe8d\nmov     rdi, rax                                                       ; +0xe3, 0x1404cfe93\nmov     rcx, [rsi+248h]                                                ; +0xe6, 0x1404cfe96\nmov     rax, [rcx]                                                     ; +0xed, 0x1404cfe9d\nmov     rdx, rdi                                                       ; +0xf0, 0x1404cfea0\ncall    qword ptr [rax+1D0h]                                           ; +0xf3, 0x1404cfea3\nmov     edx, ebp                                                       ; +0xf9, 0x1404cfea9\nlea     rcx, aLayerI; \"layer_%i\"                                       ; +0xfb, 0x1404cfeab\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x102, 0x1404cfeb2\nmov     rcx, rax                                                       ; +0x108, 0x1404cfeb8\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x10b, 0x1404cfebb\nxorps   xmm0, xmm0                                                     ; +0x111, 0x1404cfec1\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x114, 0x1404cfec4\nxorps   xmm1, xmm1                                                     ; +0x119, 0x1404cfec9\nmovdqu  [rsp+78h+var_38], xmm1                                         ; +0x11c, 0x1404cfecc\ninc     rbx                                                            ; +0x122, 0x1404cfed2\ncmp     byte ptr [rax+rbx], 0                                          ; +0x125, 0x1404cfed5\njnz     short loc_1404CFED2                                            ; +0x129, 0x1404cfed9\nmov     r8, rbx                                                        ; +0x12b, 0x1404cfedb\nmov     rdx, rax                                                       ; +0x12e, 0x1404cfede\nlea     rcx, [rsp+78h+Block]                                           ; +0x131, 0x1404cfee1\ncall    sub_14003D230                                                  ; +0x136, 0x1404cfee6\nnop                                                                    ; +0x13b, 0x1404cfeeb\nlea     r8, [rsp+78h+Block]                                            ; +0x13c, 0x1404cfeec\nmov     rdx, rdi                                                       ; +0x141, 0x1404cfef1\nmov     rcx, [rsi+2A8h]                                                ; +0x144, 0x1404cfef4\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, 0x1404cfefb\nnop                                                                    ; +0x151, 0x1404cff01\nmov     rdx, qword ptr [rsp+78h+var_38+8]                              ; +0x152, 0x1404cff02\ncmp     rdx, 0Fh                                                       ; +0x157, 0x1404cff07\njbe     short loc_1404CFF55                                            ; +0x15b, 0x1404cff0b\ninc     rdx                                                            ; +0x15d, 0x1404cff0d\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x160, 0x1404cff10\nmov     rax, rcx                                                       ; +0x165, 0x1404cff15\ncmp     rdx, 1000h                                                     ; +0x168, 0x1404cff18\njb      short loc_1404CFF50                                            ; +0x16f, 0x1404cff1f\nadd     rdx, 27h ; '''                                                 ; +0x171, 0x1404cff21\nmov     rcx, [rcx-8]                                                   ; +0x175, 0x1404cff25\nsub     rax, rcx                                                       ; +0x179, 0x1404cff29\nsub     rax, 8                                                         ; +0x17c, 0x1404cff2c\ncmp     rax, 1Fh                                                       ; +0x180, 0x1404cff30\njbe     short loc_1404CFF50                                            ; +0x184, 0x1404cff34\nmov     [rsp+78h+Reserved], 0; Reserved                                ; +0x186, 0x1404cff36\nxor     r9d, r9d; LineNo                                               ; +0x18f, 0x1404cff3f\nxor     r8d, r8d; FileName                                             ; +0x192, 0x1404cff42\nxor     edx, edx; FunctionName                                         ; +0x195, 0x1404cff45\nxor     ecx, ecx; Expression                                           ; +0x197, 0x1404cff47\ncall    cs:_invoke_watson                                              ; +0x199, 0x1404cff49\nalign 10h                                                              ; +0x19f, 0x1404cff4f\ncall    j_j_free                                                       ; +0x1a0, 0x1404cff50\nmov     rax, rdi                                                       ; +0x1a5, 0x1404cff55\nmov     rcx, [rsp+78h+var_28]                                          ; +0x1a8, 0x1404cff58\nxor     rcx, rsp; StackCookie                                          ; +0x1ad, 0x1404cff5d\ncall    __security_check_cookie                                        ; +0x1b0, 0x1404cff60\nmov     rbx, [rsp+78h+arg_10]                                          ; +0x1b5, 0x1404cff65\nadd     rsp, 60h                                                       ; +0x1bd, 0x1404cff6d\npop     rdi                                                            ; +0x1c1, 0x1404cff71\npop     rsi                                                            ; +0x1c2, 0x1404cff72\npop     rbp                                                            ; +0x1c3, 0x1404cff73\nretn                                                                   ; +0x1c4, 0x1404cff74", "xrefs": ["MoreVideoOptionsLayer::addToggle @ 0x1404cf6a2", "ParentalOptionsLayer::addMasterToggle @ 0x1404d1cbd", "ParentalOptionsLayer::addToggle @ 0x1404d2554", "<???> @ 0x140929714"], "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"}