{"type": "func", "start": 5371927648, "end": 5371928202, "name": "LevelSearchLayer::toggleStar", "pseudocode": "// \n// LevelSearchLayer::toggleStar from 0x140311c60 to 0x140311e8a (554 bytes)\n// \n// 4 xrefs:\n// > LevelSearchLayer::clearFilters @ 0x14030e8aa\n// > LevelSearchLayer::init @ 0x14030da89\n// > <???> @ 0x1406d482c\n// > <???> @ 0x1406d4838\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=3\nvoid LevelSearchLayer::toggleStar(LevelSearchLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v3; // rcx\n  cocos2d::CCString *v4; // rax\n  bool v5; // di\n  void *v6; // rcx\n  cocos2d::CCRGBAProtocol *v7; // rcx\n  bool v8; // di\n  __int64 v9; // rbx\n  struct cocos2d::CCString *v10; // rax\n  void *v11; // rcx\n  _WORD v12[4]; // [rsp+20h] [rbp-40h] BYREF\n  void *v13; // [rsp+28h] [rbp-38h]\n  void *Block[2]; // [rsp+30h] [rbp-30h] BYREF\n  __int64 v15; // [rsp+40h] [rbp-20h]\n  unsigned __int64 v16; // [rsp+48h] [rbp-18h]\n\n  v3 = qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v13 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v13);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v3 = qword_1406C2EC0;\n  }\n  v15 = 11;\n  v16 = 15;\n  Block[0] = (void *)0x6C69665F72617473LL;\n  Block[1] = (void *)7497076;\n  v4 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v3 + 344), Block);\n  v5 = cocos2d::CCString::boolValue(v4);\n  if ( v16 > 0xF )\n  {\n    v6 = Block[0];\n    if ( v16 + 1 >= 0x1000 )\n    {\n      v6 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v6);\n  }\n  v7 = &a1->m_starsSprite->cocos2d::CCRGBAProtocol;\n  v8 = !v5;\n  if ( v8 )\n  {\n    v12[0] = -1;\n    LOBYTE(v12[1]) = -1;\n  }\n  else\n  {\n    memset(v12, 125, 3);\n  }\n  v7->setColor(v7, (const cocos2d::ccColor3B *)v12);\n  v9 = qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v13 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v13);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v9 = qword_1406C2EC0;\n  }\n  v15 = 11;\n  v16 = 15;\n  Block[0] = (void *)0x6C69665F72617473LL;\n  Block[1] = (void *)7497076;\n  v10 = cocos2d::CCString::createWithFormat(\"%i\", v8);\n  cocos2d::CCDictionary::setObject(*(_QWORD *)(v9 + 344), v10, Block);\n  if ( v16 > 0xF )\n  {\n    v11 = Block[0];\n    if ( v16 + 1 >= 0x1000 )\n    {\n      v11 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v11);\n  }\n}", "assembly": "; \n; LevelSearchLayer::toggleStar from 0x140311c60 to 0x140311e8a (554 bytes)\n; \n; 4 xrefs:\n; > LevelSearchLayer::clearFilters @ 0x14030e8aa\n; > LevelSearchLayer::init @ 0x14030da89\n; > <???> @ 0x1406d482c\n; > <???> @ 0x1406d4838\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-8+arg_8], rbx                                             ; +0x0, 0x140311c60\nmov     [rsp-8+arg_10], rdi                                            ; +0x5, 0x140311c65\npush    rbp                                                            ; +0xa, 0x140311c6a\nmov     rbp, rsp                                                       ; +0xb, 0x140311c6b\nsub     rsp, 60h                                                       ; +0xe, 0x140311c6e\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x140311c72\nxor     rax, rsp                                                       ; +0x19, 0x140311c79\nmov     [rbp+var_10], rax                                              ; +0x1c, 0x140311c7c\nmov     rbx, rcx                                                       ; +0x20, 0x140311c80\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x23, 0x140311c83\ntest    rcx, rcx                                                       ; +0x2a, 0x140311c8a\njnz     short loc_140311CBD                                            ; +0x2d, 0x140311c8d\nmov     ecx, 3D0h; Size                                                ; +0x2f, 0x140311c8f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x34, 0x140311c94\nmov     [rbp+var_38], rax                                              ; +0x39, 0x140311c99\nmov     rcx, rax                                                       ; +0x3d, 0x140311c9d\ncall    sub_140141280                                                  ; +0x40, 0x140311ca0\nnop                                                                    ; +0x45, 0x140311ca5\nmov     cs:qword_1406C2EC0, rax                                        ; +0x46, 0x140311ca6\nmov     rdx, [rax]                                                     ; +0x4d, 0x140311cad\nmov     rcx, rax                                                       ; +0x50, 0x140311cb0\ncall    qword ptr [rdx+48h]                                            ; +0x53, 0x140311cb3\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x56, 0x140311cb6\nxorps   xmm0, xmm0                                                     ; +0x5d, 0x140311cbd\nmovups  xmmword ptr [rbp+Block], xmm0                                  ; +0x60, 0x140311cc0\nmov     [rbp+var_20], 0Bh                                              ; +0x64, 0x140311cc4\nmov     [rbp+var_18], 0Fh                                              ; +0x6c, 0x140311ccc\nmovsd   xmm0, cs:qword_14058AB58                                       ; +0x74, 0x140311cd4\nmovsd   [rbp+Block], xmm0                                              ; +0x7c, 0x140311cdc\nmovzx   eax, cs:word_14058AB60                                         ; +0x81, 0x140311ce1\nmov     word ptr [rbp+Block+8], ax                                     ; +0x88, 0x140311ce8\nmovzx   eax, cs:byte_14058AB62                                         ; +0x8c, 0x140311cec\nmov     byte ptr [rbp+Block+0Ah], al                                   ; +0x93, 0x140311cf3\nmov     byte ptr [rbp+Block+0Bh], 0                                    ; +0x96, 0x140311cf6\nlea     rdx, [rbp+Block]                                               ; +0x9a, 0x140311cfa\nmov     rcx, [rcx+158h]                                                ; +0x9e, 0x140311cfe\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0xa5, 0x140311d05\nmov     rcx, rax                                                       ; +0xab, 0x140311d0b\ncall    cs:?boolValue@CCString@cocos2d@@QEBA_NXZ; cocos2d::CCString::boolValue(void) ; +0xae, 0x140311d0e\nmovzx   edi, al                                                        ; +0xb4, 0x140311d14\nmov     rdx, [rbp+var_18]                                              ; +0xb7, 0x140311d17\ncmp     rdx, 0Fh                                                       ; +0xbb, 0x140311d1b\njbe     short loc_140311D55                                            ; +0xbf, 0x140311d1f\ninc     rdx                                                            ; +0xc1, 0x140311d21\nmov     rcx, [rbp+Block]; Block                                        ; +0xc4, 0x140311d24\nmov     rax, rcx                                                       ; +0xc8, 0x140311d28\ncmp     rdx, 1000h                                                     ; +0xcb, 0x140311d2b\njb      short loc_140311D50                                            ; +0xd2, 0x140311d32\nadd     rdx, 27h ; '''                                                 ; +0xd4, 0x140311d34\nmov     rcx, [rcx-8]                                                   ; +0xd8, 0x140311d38\nsub     rax, rcx                                                       ; +0xdc, 0x140311d3c\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xdf, 0x140311d3f\ncmp     rax, 1Fh                                                       ; +0xe3, 0x140311d43\njbe     short loc_140311D50                                            ; +0xe7, 0x140311d47\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xe9, 0x140311d49\nalign 10h                                                              ; +0xef, 0x140311d4f\ncall    j_j_free                                                       ; +0xf0, 0x140311d50\nmov     rcx, [rbx+1C0h]                                                ; +0xf5, 0x140311d55\nadd     rcx, 140h                                                      ; +0xfc, 0x140311d5c\nxor     dil, 1                                                         ; +0x103, 0x140311d63\nlea     rdx, [rbp+var_40]                                              ; +0x107, 0x140311d67\njz      short loc_140311D79                                            ; +0x10b, 0x140311d6b\nmov     [rbp+var_40], 0FFFFh                                           ; +0x10d, 0x140311d6d\nmov     [rbp+var_3E], 0FFh                                             ; +0x113, 0x140311d73\njmp     short loc_140311D83                                            ; +0x117, 0x140311d77\nmov     [rbp+var_40], 7D7Dh                                            ; +0x119, 0x140311d79\nmov     [rbp+var_3E], 7Dh ; '}'                                        ; +0x11f, 0x140311d7f\nmovzx   eax, [rbp+var_40]                                              ; +0x123, 0x140311d83\nmov     [rbp+var_40], ax                                               ; +0x127, 0x140311d87\nmov     rax, [rcx]                                                     ; +0x12b, 0x140311d8b\ncall    qword ptr [rax]                                                ; +0x12e, 0x140311d8e\nmov     rbx, cs:qword_1406C2EC0                                        ; +0x130, 0x140311d90\ntest    rbx, rbx                                                       ; +0x137, 0x140311d97\njnz     short loc_140311DCA                                            ; +0x13a, 0x140311d9a\nmov     ecx, 3D0h; Size                                                ; +0x13c, 0x140311d9c\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x141, 0x140311da1\nmov     [rbp+var_38], rax                                              ; +0x146, 0x140311da6\nmov     rcx, rax                                                       ; +0x14a, 0x140311daa\ncall    sub_140141280                                                  ; +0x14d, 0x140311dad\nnop                                                                    ; +0x152, 0x140311db2\nmov     cs:qword_1406C2EC0, rax                                        ; +0x153, 0x140311db3\nmov     rdx, [rax]                                                     ; +0x15a, 0x140311dba\nmov     rcx, rax                                                       ; +0x15d, 0x140311dbd\ncall    qword ptr [rdx+48h]                                            ; +0x160, 0x140311dc0\nmov     rbx, cs:qword_1406C2EC0                                        ; +0x163, 0x140311dc3\nxorps   xmm0, xmm0                                                     ; +0x16a, 0x140311dca\nmovups  xmmword ptr [rbp+Block], xmm0                                  ; +0x16d, 0x140311dcd\nmov     [rbp+var_20], 0Bh                                              ; +0x171, 0x140311dd1\nmov     [rbp+var_18], 0Fh                                              ; +0x179, 0x140311dd9\nmovsd   xmm0, cs:qword_14058AB58                                       ; +0x181, 0x140311de1\nmovsd   [rbp+Block], xmm0                                              ; +0x189, 0x140311de9\nmovzx   eax, cs:word_14058AB60                                         ; +0x18e, 0x140311dee\nmov     word ptr [rbp+Block+8], ax                                     ; +0x195, 0x140311df5\nmovzx   eax, cs:byte_14058AB62                                         ; +0x199, 0x140311df9\nmov     byte ptr [rbp+Block+0Ah], al                                   ; +0x1a0, 0x140311e00\nmov     byte ptr [rbp+Block+0Bh], 0                                    ; +0x1a3, 0x140311e03\nmovzx   edx, dil                                                       ; +0x1a7, 0x140311e07\nlea     rcx, aI_11; \"%i\"                                               ; +0x1ab, 0x140311e0b\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1b2, 0x140311e12\nmov     rdx, rax                                                       ; +0x1b8, 0x140311e18\nlea     r8, [rbp+Block]                                                ; +0x1bb, 0x140311e1b\nmov     rcx, [rbx+158h]                                                ; +0x1bf, 0x140311e1f\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 &) ; +0x1c6, 0x140311e26\nnop                                                                    ; +0x1cc, 0x140311e2c\nmov     rdx, [rbp+var_18]                                              ; +0x1cd, 0x140311e2d\ncmp     rdx, 0Fh                                                       ; +0x1d1, 0x140311e31\njbe     short loc_140311E6B                                            ; +0x1d5, 0x140311e35\ninc     rdx                                                            ; +0x1d7, 0x140311e37\nmov     rcx, [rbp+Block]; Block                                        ; +0x1da, 0x140311e3a\nmov     rax, rcx                                                       ; +0x1de, 0x140311e3e\ncmp     rdx, 1000h                                                     ; +0x1e1, 0x140311e41\njb      short loc_140311E66                                            ; +0x1e8, 0x140311e48\nadd     rdx, 27h ; '''                                                 ; +0x1ea, 0x140311e4a\nmov     rcx, [rcx-8]                                                   ; +0x1ee, 0x140311e4e\nsub     rax, rcx                                                       ; +0x1f2, 0x140311e52\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x1f5, 0x140311e55\ncmp     rax, 1Fh                                                       ; +0x1f9, 0x140311e59\njbe     short loc_140311E66                                            ; +0x1fd, 0x140311e5d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x1ff, 0x140311e5f\nalign 2                                                                ; +0x205, 0x140311e65\ncall    j_j_free                                                       ; +0x206, 0x140311e66\nmov     rcx, [rbp+var_10]                                              ; +0x20b, 0x140311e6b\nxor     rcx, rsp; StackCookie                                          ; +0x20f, 0x140311e6f\ncall    __security_check_cookie                                        ; +0x212, 0x140311e72\nmov     rbx, [rsp+60h+arg_8]                                           ; +0x217, 0x140311e77\nmov     rdi, [rsp+60h+arg_10]                                          ; +0x21c, 0x140311e7c\nadd     rsp, 60h                                                       ; +0x224, 0x140311e84\npop     rbp                                                            ; +0x228, 0x140311e88\nretn                                                                   ; +0x229, 0x140311e89", "xrefs": ["LevelSearchLayer::clearFilters @ 0x14030e8aa", "LevelSearchLayer::init @ 0x14030da89", "<???> @ 0x1406d482c", "<???> @ 0x1406d4838"], "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"}