{"type": "func", "start": 5371885360, "end": 5371885652, "name": "LevelListLayer::onFavorite", "pseudocode": "// \n// LevelListLayer::onFavorite from 0x140307730 to 0x140307854 (292 bytes)\n// \n// 2 xrefs:\n// > LevelListLayer::init @ 0x1403047c1\n// > <???> @ 0x1406d44f0\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 LevelListLayer::onFavorite(LevelListLayer *a1, cocos2d::CCObject *a2)\n{\n  GJLevelList *m_levelList; // r8\n  bool m_favorite; // bp\n  __int64 v5; // rcx\n  __int64 *v6; // rdi\n  __int64 v7; // rsi\n  const char *v8; // rbx\n  cocos2d::CCSpriteFrameCache *v9; // rax\n  struct cocos2d::CCSpriteFrame *v10; // rax\n  GameLevelManager *v11; // rcx\n  void *v12; // [rsp+40h] [rbp+8h]\n  void *v13; // [rsp+40h] [rbp+8h]\n\n  if ( !a1->m_exiting )\n  {\n    m_levelList = a1->m_levelList;\n    m_favorite = m_levelList->m_favorite;\n    m_levelList->m_favorite = !m_favorite;\n    v6 = (__int64 *)((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[13].copyWithZone)(a2);\n    v7 = *v6;\n    v8 = \"gj_heartOff_001.png\";\n    if ( !m_favorite )\n      v8 = \"gj_heartOn_001.png\";\n    v9 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v5);\n    v10 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v9, v8);\n    (*(void (__fastcall **)(__int64 *, struct cocos2d::CCSpriteFrame *))(v7 + 992))(v6, v10);\n    v11 = (GameLevelManager *)qword_1406C2EC0;\n    if ( m_favorite )\n    {\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        v11 = (GameLevelManager *)qword_1406C2EC0;\n      }\n      GameLevelManager::deleteLevelList(v11, a1->m_levelList);\n    }\n    else\n    {\n      if ( !qword_1406C2EC0 )\n      {\n        v12 = operator new(0x3D0u);\n        qword_1406C2EC0 = sub_140141280((__int64)v12);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n        v11 = (GameLevelManager *)qword_1406C2EC0;\n      }\n      GameLevelManager::saveLevelList(v11, a1->m_levelList);\n    }\n  }\n}", "assembly": "; \n; LevelListLayer::onFavorite from 0x140307730 to 0x140307854 (292 bytes)\n; \n; 2 xrefs:\n; > LevelListLayer::init @ 0x1403047c1\n; > <???> @ 0x1406d44f0\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_8], rbx                                               ; +0x0, 0x140307730\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140307735\npush    rsi                                                            ; +0xa, 0x14030773a\npush    rdi                                                            ; +0xb, 0x14030773b\npush    r14                                                            ; +0xc, 0x14030773c\nsub     rsp, 20h                                                       ; +0xe, 0x14030773e\nmov     r14, rcx                                                       ; +0x12, 0x140307742\ncmp     byte ptr [rcx+398h], 0                                         ; +0x15, 0x140307745\njnz     loc_140307841                                                  ; +0x1c, 0x14030774c\nmov     r8, [rcx+368h]                                                 ; +0x22, 0x140307752\nmovzx   ebp, byte ptr [r8+18Ch]                                        ; +0x29, 0x140307759\ntest    bpl, bpl                                                       ; +0x31, 0x140307761\nsetz    al                                                             ; +0x34, 0x140307764\nmov     [r8+18Ch], al                                                  ; +0x37, 0x140307767\nmov     rax, [rdx]                                                     ; +0x3e, 0x14030776e\nmov     rcx, rdx                                                       ; +0x41, 0x140307771\ncall    qword ptr [rax+3A8h]                                           ; +0x44, 0x140307774\nmov     rdi, rax                                                       ; +0x4a, 0x14030777a\nmov     rsi, [rax]                                                     ; +0x4d, 0x14030777d\nlea     rax, aGjHearton001Pn; \"gj_heartOn_001.png\"                     ; +0x50, 0x140307780\nlea     rbx, aGjHeartoff001P; \"gj_heartOff_001.png\"                    ; +0x57, 0x140307787\ntest    bpl, bpl                                                       ; +0x5e, 0x14030778e\ncmovz   rbx, rax                                                       ; +0x61, 0x140307791\ncall    cs:?sharedSpriteFrameCache@CCSpriteFrameCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(void) ; +0x65, 0x140307795\nmov     rcx, rax                                                       ; +0x6b, 0x14030779b\nmov     rdx, rbx                                                       ; +0x6e, 0x14030779e\ncall    cs:?spriteFrameByName@CCSpriteFrameCache@cocos2d@@QEAAPEAVCCSpriteFrame@2@PEBD@Z; cocos2d::CCSpriteFrameCache::spriteFrameByName(char const *) ; +0x71, 0x1403077a1\nmov     rdx, rax                                                       ; +0x77, 0x1403077a7\nmov     rcx, rdi                                                       ; +0x7a, 0x1403077aa\ncall    qword ptr [rsi+3E0h]                                           ; +0x7d, 0x1403077ad\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x83, 0x1403077b3\ntest    bpl, bpl                                                       ; +0x8a, 0x1403077ba\njnz     short loc_140307801                                            ; +0x8d, 0x1403077bd\ntest    rcx, rcx                                                       ; +0x8f, 0x1403077bf\njnz     short loc_1403077F3                                            ; +0x92, 0x1403077c2\nmov     ecx, 3D0h; Size                                                ; +0x94, 0x1403077c4\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x99, 0x1403077c9\nmov     [rsp+38h+arg_0], rax                                           ; +0x9e, 0x1403077ce\nmov     rcx, rax                                                       ; +0xa3, 0x1403077d3\ncall    sub_140141280                                                  ; +0xa6, 0x1403077d6\nnop                                                                    ; +0xab, 0x1403077db\nmov     cs:qword_1406C2EC0, rax                                        ; +0xac, 0x1403077dc\nmov     rdx, [rax]                                                     ; +0xb3, 0x1403077e3\nmov     rcx, rax                                                       ; +0xb6, 0x1403077e6\ncall    qword ptr [rdx+48h]                                            ; +0xb9, 0x1403077e9\nmov     rcx, cs:qword_1406C2EC0                                        ; +0xbc, 0x1403077ec\nmov     rdx, [r14+368h]                                                ; +0xc3, 0x1403077f3\ncall    GameLevelManager__saveLevelList                                ; +0xca, 0x1403077fa\njmp     short loc_140307841                                            ; +0xcf, 0x1403077ff\ntest    rcx, rcx                                                       ; +0xd1, 0x140307801\njnz     short loc_140307835                                            ; +0xd4, 0x140307804\nmov     ecx, 3D0h; Size                                                ; +0xd6, 0x140307806\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xdb, 0x14030780b\nmov     [rsp+38h+arg_0], rax                                           ; +0xe0, 0x140307810\nmov     rcx, rax                                                       ; +0xe5, 0x140307815\ncall    sub_140141280                                                  ; +0xe8, 0x140307818\nnop                                                                    ; +0xed, 0x14030781d\nmov     cs:qword_1406C2EC0, rax                                        ; +0xee, 0x14030781e\nmov     rdx, [rax]                                                     ; +0xf5, 0x140307825\nmov     rcx, rax                                                       ; +0xf8, 0x140307828\ncall    qword ptr [rdx+48h]                                            ; +0xfb, 0x14030782b\nmov     rcx, cs:qword_1406C2EC0                                        ; +0xfe, 0x14030782e\nmov     rdx, [r14+368h]                                                ; +0x105, 0x140307835\ncall    GameLevelManager__deleteLevelList                              ; +0x10c, 0x14030783c\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x111, 0x140307841\nmov     rbp, [rsp+38h+arg_10]                                          ; +0x116, 0x140307846\nadd     rsp, 20h                                                       ; +0x11b, 0x14030784b\npop     r14                                                            ; +0x11f, 0x14030784f\npop     rdi                                                            ; +0x121, 0x140307851\npop     rsi                                                            ; +0x122, 0x140307852\nretn                                                                   ; +0x123, 0x140307853", "xrefs": ["LevelListLayer::init @ 0x1403047c1", "<???> @ 0x1406d44f0"], "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"}