{"type": "func", "start": 5371929904, "end": 5371930333, "name": "LevelSearchLayer::toggleTime", "pseudocode": "// \n// LevelSearchLayer::toggleTime from 0x140312530 to 0x1403126dd (429 bytes)\n// \n// 2 xrefs:\n// > LevelSearchLayer::init @ 0x14030d9dd\n// > <???> @ 0x1406d4874\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=2\nvoid LevelSearchLayer::toggleTime(LevelSearchLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // edi\n  _BOOL8 v4; // rbx\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  int *p_m_uIndexInArray; // rcx\n  void (__fastcall *v11)(int *, __int16 *); // r8\n  __int16 *v12; // rdx\n  GameLevelManager *v13; // rcx\n  __int16 v14; // [rsp+20h] [rbp-48h] BYREF\n  char v15; // [rsp+22h] [rbp-46h]\n  _WORD v16[2]; // [rsp+24h] [rbp-44h] BYREF\n  void *v17; // [rsp+28h] [rbp-40h]\n  void *Block[2]; // [rsp+30h] [rbp-38h] BYREF\n  __int64 v19; // [rsp+40h] [rbp-28h]\n  unsigned __int64 v20; // [rsp+48h] [rbp-20h]\n\n  v3 = a2->getTag(a2);\n  v4 = !LevelSearchLayer::checkTime(a1, v3);\n  v5 = cocos2d::CCString::createWithFormat(\"T%i\", v3);\n  CString = cocos2d::CCString::getCString(v5);\n  *(_OWORD *)Block = 0;\n  v19 = 0;\n  v20 = 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);\n  cocos2d::CCDictionary::setObject(a1->m_difficultyDict, v8, Block);\n  if ( v20 > 0xF )\n  {\n    v9 = Block[0];\n    if ( v20 + 1 >= 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  p_m_uIndexInArray = &cocos2d::CCArray::objectAtIndex(a1->m_lengthSprites, v3)[6].m_uIndexInArray;\n  v11 = **(void (__fastcall ***)(int *, __int16 *))p_m_uIndexInArray;\n  if ( v4 )\n  {\n    v14 = -1;\n    v15 = -1;\n    v12 = &v14;\n  }\n  else\n  {\n    v14 = 32125;\n    memset(v16, 125, 3);\n    v12 = v16;\n  }\n  v11(p_m_uIndexInArray, v12);\n  v13 = (GameLevelManager *)qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v17 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v13 = (GameLevelManager *)qword_1406C2EC0;\n  }\n  GameLevelManager::setLenVal(v13, v3, v4);\n}", "assembly": "; \n; LevelSearchLayer::toggleTime from 0x140312530 to 0x1403126dd (429 bytes)\n; \n; 2 xrefs:\n; > LevelSearchLayer::init @ 0x14030d9dd\n; > <???> @ 0x1406d4874\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, 0x140312530\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x140312535\npush    rdi                                                            ; +0xa, 0x14031253a\nsub     rsp, 60h                                                       ; +0xb, 0x14031253b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x14031253f\nxor     rax, rsp                                                       ; +0x16, 0x140312546\nmov     [rsp+68h+var_18], rax                                          ; +0x19, 0x140312549\nmov     rsi, rcx                                                       ; +0x1e, 0x14031254e\nmov     rax, [rdx]                                                     ; +0x21, 0x140312551\nmov     rcx, rdx                                                       ; +0x24, 0x140312554\ncall    qword ptr [rax+38h]                                            ; +0x27, 0x140312557\nmov     edi, eax                                                       ; +0x2a, 0x14031255a\nmov     edx, eax                                                       ; +0x2c, 0x14031255c\nmov     rcx, rsi                                                       ; +0x2e, 0x14031255e\ncall    LevelSearchLayer__checkTime                                    ; +0x31, 0x140312561\nmovzx   ebx, al                                                        ; +0x36, 0x140312566\nxor     bl, 1                                                          ; +0x39, 0x140312569\nmov     edx, edi                                                       ; +0x3c, 0x14031256c\nlea     rcx, aTI; \"T%i\"                                                ; +0x3e, 0x14031256e\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x45, 0x140312575\nmov     rcx, rax                                                       ; +0x4b, 0x14031257b\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x4e, 0x14031257e\nxorps   xmm0, xmm0                                                     ; +0x54, 0x140312584\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x57, 0x140312587\nxor     ecx, ecx                                                       ; +0x5c, 0x14031258c\nmov     [rsp+68h+var_28], rcx                                          ; +0x5e, 0x14031258e\nmov     [rsp+68h+var_20], rcx                                          ; +0x63, 0x140312593\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x68, 0x140312598\nnop                                                                    ; +0x6f, 0x14031259f\ninc     r8                                                             ; +0x70, 0x1403125a0\ncmp     [rax+r8], cl                                                   ; +0x73, 0x1403125a3\njnz     short loc_1403125A0                                            ; +0x77, 0x1403125a7\nmov     rdx, rax                                                       ; +0x79, 0x1403125a9\nlea     rcx, [rsp+68h+Block]                                           ; +0x7c, 0x1403125ac\ncall    sub_14003A930                                                  ; +0x81, 0x1403125b1\nnop                                                                    ; +0x86, 0x1403125b6\nmovzx   edx, bl                                                        ; +0x87, 0x1403125b7\nlea     rcx, aI_11; \"%i\"                                               ; +0x8a, 0x1403125ba\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x91, 0x1403125c1\nmov     rdx, rax                                                       ; +0x97, 0x1403125c7\nlea     r8, [rsp+68h+Block]                                            ; +0x9a, 0x1403125ca\nmov     rcx, [rsi+1D8h]                                                ; +0x9f, 0x1403125cf\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 &) ; +0xa6, 0x1403125d6\nnop                                                                    ; +0xac, 0x1403125dc\nmov     rdx, [rsp+68h+var_20]                                          ; +0xad, 0x1403125dd\ncmp     rdx, 0Fh                                                       ; +0xb2, 0x1403125e2\njbe     short loc_14031261D                                            ; +0xb6, 0x1403125e6\ninc     rdx                                                            ; +0xb8, 0x1403125e8\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0xbb, 0x1403125eb\nmov     rax, rcx                                                       ; +0xc0, 0x1403125f0\ncmp     rdx, 1000h                                                     ; +0xc3, 0x1403125f3\njb      short loc_140312618                                            ; +0xca, 0x1403125fa\nadd     rdx, 27h ; '''                                                 ; +0xcc, 0x1403125fc\nmov     rcx, [rcx-8]                                                   ; +0xd0, 0x140312600\nsub     rax, rcx                                                       ; +0xd4, 0x140312604\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xd7, 0x140312607\ncmp     rax, 1Fh                                                       ; +0xdb, 0x14031260b\njbe     short loc_140312618                                            ; +0xdf, 0x14031260f\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xe1, 0x140312611\nalign 8                                                                ; +0xe7, 0x140312617\ncall    j_j_free                                                       ; +0xe8, 0x140312618\nmov     edx, edi                                                       ; +0xed, 0x14031261d\nmov     rcx, [rsi+1D0h]                                                ; +0xef, 0x14031261f\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0xf6, 0x140312626\nlea     rcx, [rax+170h]                                                ; +0xfc, 0x14031262c\nmov     rax, [rcx]                                                     ; +0x103, 0x140312633\nmov     r8, [rax]                                                      ; +0x106, 0x140312636\ntest    bl, bl                                                         ; +0x109, 0x140312639\njz      short loc_14031265A                                            ; +0x10b, 0x14031263b\nmov     [rsp+68h+var_48], 0FFFFh                                       ; +0x10d, 0x14031263d\nmovzx   eax, [rsp+68h+var_48]                                          ; +0x114, 0x140312644\nmov     [rsp+68h+var_48], ax                                           ; +0x119, 0x140312649\nmov     [rsp+68h+var_46], 0FFh                                         ; +0x11e, 0x14031264e\nlea     rdx, [rsp+68h+var_48]                                          ; +0x123, 0x140312653\njmp     short loc_140312675                                            ; +0x128, 0x140312658\nmov     [rsp+68h+var_48], 7D7Dh                                        ; +0x12a, 0x14031265a\nmovzx   eax, [rsp+68h+var_48]                                          ; +0x131, 0x140312661\nmov     [rsp+68h+var_44], ax                                           ; +0x136, 0x140312666\nmov     [rsp+68h+var_42], 7Dh ; '}'                                    ; +0x13b, 0x14031266b\nlea     rdx, [rsp+68h+var_44]                                          ; +0x140, 0x140312670\ncall    r8                                                             ; +0x145, 0x140312675\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x148, 0x140312678\ntest    rcx, rcx                                                       ; +0x14f, 0x14031267f\njnz     short loc_1403126B3                                            ; +0x152, 0x140312682\nmov     ecx, 3D0h; Size                                                ; +0x154, 0x140312684\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x159, 0x140312689\nmov     [rsp+68h+var_40], rax                                          ; +0x15e, 0x14031268e\nmov     rcx, rax                                                       ; +0x163, 0x140312693\ncall    sub_140141280                                                  ; +0x166, 0x140312696\nnop                                                                    ; +0x16b, 0x14031269b\nmov     cs:qword_1406C2EC0, rax                                        ; +0x16c, 0x14031269c\nmov     rdx, [rax]                                                     ; +0x173, 0x1403126a3\nmov     rcx, rax                                                       ; +0x176, 0x1403126a6\ncall    qword ptr [rdx+48h]                                            ; +0x179, 0x1403126a9\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x17c, 0x1403126ac\nmovzx   r8d, bl                                                        ; +0x183, 0x1403126b3\nmov     edx, edi                                                       ; +0x187, 0x1403126b7\ncall    GameLevelManager__setLenVal                                    ; +0x189, 0x1403126b9\nmov     rcx, [rsp+68h+var_18]                                          ; +0x18e, 0x1403126be\nxor     rcx, rsp; StackCookie                                          ; +0x193, 0x1403126c3\ncall    __security_check_cookie                                        ; +0x196, 0x1403126c6\nlea     r11, [rsp+68h+var_8]                                           ; +0x19b, 0x1403126cb\nmov     rbx, [r11+20h]                                                 ; +0x1a0, 0x1403126d0\nmov     rsi, [r11+28h]                                                 ; +0x1a4, 0x1403126d4\nmov     rsp, r11                                                       ; +0x1a8, 0x1403126d8\npop     rdi                                                            ; +0x1ab, 0x1403126db\nretn                                                                   ; +0x1ac, 0x1403126dc", "xrefs": ["LevelSearchLayer::init @ 0x14030d9dd", "<???> @ 0x1406d4874"], "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"}