{"type": "func", "start": 5372354528, "end": 5372354944, "name": "MoreVideoOptionsLayer::layerForPage", "pseudocode": "// \n// MoreVideoOptionsLayer::layerForPage from 0x140379fe0 to 0x14037a180 (416 bytes)\n// \n// 3 xrefs:\n// > MoreVideoOptionsLayer::addToggle @ 0x140379954\n// > <???> @ 0x1406d5c84\n// > <???> @ 0x1406d5c90\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\ncocos2d::CCLayer *MoreVideoOptionsLayer::layerForPage(MoreVideoOptionsLayer *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  cocos2d::CCLayer *v8; // rdi\n  void *v9; // rcx\n  cocos2d::CCString *v10; // rax\n  const char *v11; // rax\n  void *v12; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-48h] BYREF\n  __int128 v15; // [rsp+30h] [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_14003A930(Block, CString, v7);\n  v8 = (cocos2d::CCLayer *)cocos2d::CCDictionary::objectForKey(a1->m_values, 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        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v9);\n  }\n  if ( !v8 )\n  {\n    v8 = (cocos2d::CCLayer *)cocos2d::CCLayer::create();\n    a1->m_mainLayer->addChild_1(a1->m_mainLayer, 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_14003A930(Block, v11, v6);\n    cocos2d::CCDictionary::setObject(a1->m_values, 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          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v12);\n    }\n  }\n  return v8;\n}", "assembly": "; \n; MoreVideoOptionsLayer::layerForPage from 0x140379fe0 to 0x14037a180 (416 bytes)\n; \n; 3 xrefs:\n; > MoreVideoOptionsLayer::addToggle @ 0x140379954\n; > <???> @ 0x1406d5c84\n; > <???> @ 0x1406d5c90\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, 0x140379fe0\npush    rbp                                                            ; +0x5, 0x140379fe5\npush    rsi                                                            ; +0x6, 0x140379fe6\npush    rdi                                                            ; +0x7, 0x140379fe7\nsub     rsp, 50h                                                       ; +0x8, 0x140379fe8\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x140379fec\nxor     rax, rsp                                                       ; +0x13, 0x140379ff3\nmov     [rsp+68h+var_28], rax                                          ; +0x16, 0x140379ff6\nmov     ebp, edx                                                       ; +0x1b, 0x140379ffb\nmov     rsi, rcx                                                       ; +0x1d, 0x140379ffd\nlea     rcx, aLayerI; \"layer_%i\"                                       ; +0x20, 0x14037a000\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x27, 0x14037a007\nmov     rcx, rax                                                       ; +0x2d, 0x14037a00d\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x30, 0x14037a010\nxorps   xmm0, xmm0                                                     ; +0x36, 0x14037a016\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x39, 0x14037a019\nxorps   xmm1, xmm1                                                     ; +0x3e, 0x14037a01e\nmovdqu  [rsp+68h+var_38], xmm1                                         ; +0x41, 0x14037a021\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0x47, 0x14037a027\nmov     r8, rbx                                                        ; +0x4e, 0x14037a02e\ninc     r8                                                             ; +0x51, 0x14037a031\ncmp     byte ptr [rax+r8], 0                                           ; +0x54, 0x14037a034\njnz     short loc_14037A031                                            ; +0x59, 0x14037a039\nmov     rdx, rax                                                       ; +0x5b, 0x14037a03b\nlea     rcx, [rsp+68h+Block]                                           ; +0x5e, 0x14037a03e\ncall    sub_14003A930                                                  ; +0x63, 0x14037a043\nnop                                                                    ; +0x68, 0x14037a048\nlea     rdx, [rsp+68h+Block]                                           ; +0x69, 0x14037a049\nmov     rcx, [rsi+290h]                                                ; +0x6e, 0x14037a04e\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, 0x14037a055\nmov     rdi, rax                                                       ; +0x7b, 0x14037a05b\nmov     rdx, qword ptr [rsp+68h+var_38+8]                              ; +0x7e, 0x14037a05e\ncmp     rdx, 0Fh                                                       ; +0x83, 0x14037a063\njbe     short loc_14037A09E                                            ; +0x87, 0x14037a067\ninc     rdx                                                            ; +0x89, 0x14037a069\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0x8c, 0x14037a06c\nmov     rax, rcx                                                       ; +0x91, 0x14037a071\ncmp     rdx, 1000h                                                     ; +0x94, 0x14037a074\njb      short loc_14037A099                                            ; +0x9b, 0x14037a07b\nadd     rdx, 27h ; '''                                                 ; +0x9d, 0x14037a07d\nmov     rcx, [rcx-8]                                                   ; +0xa1, 0x14037a081\nsub     rax, rcx                                                       ; +0xa5, 0x14037a085\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa8, 0x14037a088\ncmp     rax, 1Fh                                                       ; +0xac, 0x14037a08c\njbe     short loc_14037A099                                            ; +0xb0, 0x14037a090\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xb2, 0x14037a092\ndb 0CCh                                                                ; +0xb8, 0x14037a098\ncall    j_j_free                                                       ; +0xb9, 0x14037a099\ntest    rdi, rdi                                                       ; +0xbe, 0x14037a09e\njnz     loc_14037A160                                                  ; +0xc1, 0x14037a0a1\ncall    cs:?create@CCLayer@cocos2d@@SAPEAV12@XZ; cocos2d::CCLayer::create(void) ; +0xc7, 0x14037a0a7\nmov     rdi, rax                                                       ; +0xcd, 0x14037a0ad\nmov     rcx, [rsi+240h]                                                ; +0xd0, 0x14037a0b0\nmov     rax, [rcx]                                                     ; +0xd7, 0x14037a0b7\nmov     rdx, rdi                                                       ; +0xda, 0x14037a0ba\ncall    qword ptr [rax+1C0h]                                           ; +0xdd, 0x14037a0bd\nmov     edx, ebp                                                       ; +0xe3, 0x14037a0c3\nlea     rcx, aLayerI; \"layer_%i\"                                       ; +0xe5, 0x14037a0c5\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xec, 0x14037a0cc\nmov     rcx, rax                                                       ; +0xf2, 0x14037a0d2\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xf5, 0x14037a0d5\nxorps   xmm0, xmm0                                                     ; +0xfb, 0x14037a0db\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0xfe, 0x14037a0de\nxorps   xmm1, xmm1                                                     ; +0x103, 0x14037a0e3\nmovdqu  [rsp+68h+var_38], xmm1                                         ; +0x106, 0x14037a0e6\nnop     dword ptr [rax+00h]                                            ; +0x10c, 0x14037a0ec\ninc     rbx                                                            ; +0x110, 0x14037a0f0\ncmp     byte ptr [rax+rbx], 0                                          ; +0x113, 0x14037a0f3\njnz     short loc_14037A0F0                                            ; +0x117, 0x14037a0f7\nmov     r8, rbx                                                        ; +0x119, 0x14037a0f9\nmov     rdx, rax                                                       ; +0x11c, 0x14037a0fc\nlea     rcx, [rsp+68h+Block]                                           ; +0x11f, 0x14037a0ff\ncall    sub_14003A930                                                  ; +0x124, 0x14037a104\nnop                                                                    ; +0x129, 0x14037a109\nlea     r8, [rsp+68h+Block]                                            ; +0x12a, 0x14037a10a\nmov     rdx, rdi                                                       ; +0x12f, 0x14037a10f\nmov     rcx, [rsi+290h]                                                ; +0x132, 0x14037a112\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 &) ; +0x139, 0x14037a119\nnop                                                                    ; +0x13f, 0x14037a11f\nmov     rdx, qword ptr [rsp+68h+var_38+8]                              ; +0x140, 0x14037a120\ncmp     rdx, 0Fh                                                       ; +0x145, 0x14037a125\njbe     short loc_14037A160                                            ; +0x149, 0x14037a129\ninc     rdx                                                            ; +0x14b, 0x14037a12b\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0x14e, 0x14037a12e\nmov     rax, rcx                                                       ; +0x153, 0x14037a133\ncmp     rdx, 1000h                                                     ; +0x156, 0x14037a136\njb      short loc_14037A15B                                            ; +0x15d, 0x14037a13d\nadd     rdx, 27h ; '''                                                 ; +0x15f, 0x14037a13f\nmov     rcx, [rcx-8]                                                   ; +0x163, 0x14037a143\nsub     rax, rcx                                                       ; +0x167, 0x14037a147\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x16a, 0x14037a14a\ncmp     rax, 1Fh                                                       ; +0x16e, 0x14037a14e\njbe     short loc_14037A15B                                            ; +0x172, 0x14037a152\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x174, 0x14037a154\ndb 0CCh                                                                ; +0x17a, 0x14037a15a\ncall    j_j_free                                                       ; +0x17b, 0x14037a15b\nmov     rax, rdi                                                       ; +0x180, 0x14037a160\nmov     rcx, [rsp+68h+var_28]                                          ; +0x183, 0x14037a163\nxor     rcx, rsp; StackCookie                                          ; +0x188, 0x14037a168\ncall    __security_check_cookie                                        ; +0x18b, 0x14037a16b\nmov     rbx, [rsp+68h+arg_10]                                          ; +0x190, 0x14037a170\nadd     rsp, 50h                                                       ; +0x198, 0x14037a178\npop     rdi                                                            ; +0x19c, 0x14037a17c\npop     rsi                                                            ; +0x19d, 0x14037a17d\npop     rbp                                                            ; +0x19e, 0x14037a17e\nretn                                                                   ; +0x19f, 0x14037a17f", "xrefs": ["MoreVideoOptionsLayer::addToggle @ 0x140379954", "<???> @ 0x1406d5c84", "<???> @ 0x1406d5c90"], "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"}