{"type": "func", "start": 5372058784, "end": 5372059500, "name": "MenuGameLayer::getBGColor", "pseudocode": "// \n// MenuGameLayer::getBGColor from 0x140331ca0 to 0x140331f6c (716 bytes)\n// \n// 3 xrefs:\n// > MenuGameLayer::updateColor @ 0x140331b6a\n// > MenuGameLayer::getBGColor @ 0x140331f3b\n// > <???> @ 0x1406d5078\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=7\ncocos2d::ccColor3B *MenuGameLayer::getBGColor(cocos2d::ccColor3B *__return_ptr retstr, MenuGameLayer *a2, int a3)\n{\n  cocos2d::ccColor3B *result; // rax\n  cocos2d::ccColor3B *v5; // rcx\n  cocos2d::ccColor3B *v6; // rcx\n  cocos2d::ccColor3B *v7; // rcx\n  cocos2d::ccColor3B *v8; // rcx\n  cocos2d::ccColor3B *v9; // rcx\n  cocos2d::ccColor3B *v10; // rcx\n  cocos2d::ccColor3B *v11; // rcx\n  void *v12; // [rsp+48h] [rbp+20h]\n  void *v13; // [rsp+48h] [rbp+20h]\n  void *v14; // [rsp+48h] [rbp+20h]\n  void *v15; // [rsp+48h] [rbp+20h]\n  void *v16; // [rsp+48h] [rbp+20h]\n  void *v17; // [rsp+48h] [rbp+20h]\n  void *v18; // [rsp+48h] [rbp+20h]\n\n  switch ( a3 )\n  {\n    case 0:\n      LOWORD(a2->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable) = 26112;\n      BYTE2(a2->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable) = -1;\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 1:\n      v5 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v12 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v12);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v5 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v5, (GameManager *)a2, 7);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 2:\n      v6 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v13 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v13);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v6 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v6, (GameManager *)a2, 8);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 3:\n      v7 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v14 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v14);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v7 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v7, (GameManager *)a2, 9);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 4:\n      v8 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v15 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v15);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v8 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v8, (GameManager *)a2, 10);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 5:\n      v9 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v16 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v16);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v9 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v9, (GameManager *)a2, 11);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 6:\n      v10 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v17 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v17);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v10 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v10, (GameManager *)a2, 1);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    case 7:\n      v11 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v18 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v18);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v11 = (cocos2d::ccColor3B *)qword_1406C2ED8;\n      }\n      GameManager::colorForIdx(v11, (GameManager *)a2, 3);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n    default:\n      MenuGameLayer::getBGColor(retstr, a2, a3 % 8);\n      result = (cocos2d::ccColor3B *)a2;\n      break;\n  }\n  return result;\n}", "assembly": "; \n; MenuGameLayer::getBGColor from 0x140331ca0 to 0x140331f6c (716 bytes)\n; \n; 3 xrefs:\n; > MenuGameLayer::updateColor @ 0x140331b6a\n; > MenuGameLayer::getBGColor @ 0x140331f3b\n; > <???> @ 0x1406d5078\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\npush    rbx                                                            ; +0x0, 0x140331ca0\nsub     rsp, 20h                                                       ; +0x2, 0x140331ca2\nmov     rbx, rdx                                                       ; +0x6, 0x140331ca6\ncmp     r8d, 7; switch 8 cases                                         ; +0x9, 0x140331ca9\nja      def_140331CC8; jumptable 0000000140331CC8 default case         ; +0xd, 0x140331cad\nmovsxd  rax, r8d                                                       ; +0x13, 0x140331cb3\nlea     rdx, cs:140000000h                                             ; +0x16, 0x140331cb6\nmov     r9d, ds:(jpt_140331CC8 - 140000000h)[rdx+rax*4]                ; +0x1d, 0x140331cbd\nadd     r9, rdx                                                        ; +0x25, 0x140331cc5\njmp     r9; switch jump                                                ; +0x28, 0x140331cc8\nmov     [rsp+28h+arg_10], 6600h; jumptable 0000000140331CC8 case 0     ; +0x2b, 0x140331ccb\nmovzx   eax, [rsp+28h+arg_10]                                          ; +0x32, 0x140331cd2\nmov     [rbx], ax                                                      ; +0x37, 0x140331cd7\nmov     byte ptr [rbx+2], 0FFh                                         ; +0x3a, 0x140331cda\nmov     rax, rbx                                                       ; +0x3e, 0x140331cde\nadd     rsp, 20h                                                       ; +0x41, 0x140331ce1\npop     rbx                                                            ; +0x45, 0x140331ce5\nretn                                                                   ; +0x46, 0x140331ce6\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 1     ; +0x47, 0x140331ce7\ntest    rcx, rcx                                                       ; +0x4e, 0x140331cee\njnz     short loc_140331D22                                            ; +0x51, 0x140331cf1\nmov     ecx, 668h; Size                                                ; +0x53, 0x140331cf3\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x58, 0x140331cf8\nmov     [rsp+28h+arg_18], rax                                          ; +0x5d, 0x140331cfd\nmov     rcx, rax                                                       ; +0x62, 0x140331d02\ncall    sub_14017AB00                                                  ; +0x65, 0x140331d05\nnop                                                                    ; +0x6a, 0x140331d0a\nmov     cs:qword_1406C2ED8, rax                                        ; +0x6b, 0x140331d0b\nmov     rdx, [rax]                                                     ; +0x72, 0x140331d12\nmov     rcx, rax                                                       ; +0x75, 0x140331d15\ncall    qword ptr [rdx+48h]                                            ; +0x78, 0x140331d18\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x7b, 0x140331d1b\nmov     r8d, 7                                                         ; +0x82, 0x140331d22\nmov     rdx, rbx                                                       ; +0x88, 0x140331d28\ncall    GameManager__colorForIdx                                       ; +0x8b, 0x140331d2b\nmov     rax, rbx                                                       ; +0x90, 0x140331d30\nadd     rsp, 20h                                                       ; +0x93, 0x140331d33\npop     rbx                                                            ; +0x97, 0x140331d37\nretn                                                                   ; +0x98, 0x140331d38\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 2     ; +0x99, 0x140331d39\ntest    rcx, rcx                                                       ; +0xa0, 0x140331d40\njnz     short loc_140331D74                                            ; +0xa3, 0x140331d43\nmov     ecx, 668h; Size                                                ; +0xa5, 0x140331d45\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xaa, 0x140331d4a\nmov     [rsp+28h+arg_18], rax                                          ; +0xaf, 0x140331d4f\nmov     rcx, rax                                                       ; +0xb4, 0x140331d54\ncall    sub_14017AB00                                                  ; +0xb7, 0x140331d57\nnop                                                                    ; +0xbc, 0x140331d5c\nmov     cs:qword_1406C2ED8, rax                                        ; +0xbd, 0x140331d5d\nmov     rdx, [rax]                                                     ; +0xc4, 0x140331d64\nmov     rcx, rax                                                       ; +0xc7, 0x140331d67\ncall    qword ptr [rdx+48h]                                            ; +0xca, 0x140331d6a\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xcd, 0x140331d6d\nmov     r8d, 8                                                         ; +0xd4, 0x140331d74\nmov     rdx, rbx                                                       ; +0xda, 0x140331d7a\ncall    GameManager__colorForIdx                                       ; +0xdd, 0x140331d7d\nmov     rax, rbx                                                       ; +0xe2, 0x140331d82\nadd     rsp, 20h                                                       ; +0xe5, 0x140331d85\npop     rbx                                                            ; +0xe9, 0x140331d89\nretn                                                                   ; +0xea, 0x140331d8a\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 3     ; +0xeb, 0x140331d8b\ntest    rcx, rcx                                                       ; +0xf2, 0x140331d92\njnz     short loc_140331DC6                                            ; +0xf5, 0x140331d95\nmov     ecx, 668h; Size                                                ; +0xf7, 0x140331d97\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xfc, 0x140331d9c\nmov     [rsp+28h+arg_18], rax                                          ; +0x101, 0x140331da1\nmov     rcx, rax                                                       ; +0x106, 0x140331da6\ncall    sub_14017AB00                                                  ; +0x109, 0x140331da9\nnop                                                                    ; +0x10e, 0x140331dae\nmov     cs:qword_1406C2ED8, rax                                        ; +0x10f, 0x140331daf\nmov     rdx, [rax]                                                     ; +0x116, 0x140331db6\nmov     rcx, rax                                                       ; +0x119, 0x140331db9\ncall    qword ptr [rdx+48h]                                            ; +0x11c, 0x140331dbc\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x11f, 0x140331dbf\nmov     r8d, 9                                                         ; +0x126, 0x140331dc6\nmov     rdx, rbx                                                       ; +0x12c, 0x140331dcc\ncall    GameManager__colorForIdx                                       ; +0x12f, 0x140331dcf\nmov     rax, rbx                                                       ; +0x134, 0x140331dd4\nadd     rsp, 20h                                                       ; +0x137, 0x140331dd7\npop     rbx                                                            ; +0x13b, 0x140331ddb\nretn                                                                   ; +0x13c, 0x140331ddc\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 4     ; +0x13d, 0x140331ddd\ntest    rcx, rcx                                                       ; +0x144, 0x140331de4\njnz     short loc_140331E18                                            ; +0x147, 0x140331de7\nmov     ecx, 668h; Size                                                ; +0x149, 0x140331de9\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x14e, 0x140331dee\nmov     [rsp+28h+arg_18], rax                                          ; +0x153, 0x140331df3\nmov     rcx, rax                                                       ; +0x158, 0x140331df8\ncall    sub_14017AB00                                                  ; +0x15b, 0x140331dfb\nnop                                                                    ; +0x160, 0x140331e00\nmov     cs:qword_1406C2ED8, rax                                        ; +0x161, 0x140331e01\nmov     rdx, [rax]                                                     ; +0x168, 0x140331e08\nmov     rcx, rax                                                       ; +0x16b, 0x140331e0b\ncall    qword ptr [rdx+48h]                                            ; +0x16e, 0x140331e0e\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x171, 0x140331e11\nmov     r8d, 0Ah                                                       ; +0x178, 0x140331e18\nmov     rdx, rbx                                                       ; +0x17e, 0x140331e1e\ncall    GameManager__colorForIdx                                       ; +0x181, 0x140331e21\nmov     rax, rbx                                                       ; +0x186, 0x140331e26\nadd     rsp, 20h                                                       ; +0x189, 0x140331e29\npop     rbx                                                            ; +0x18d, 0x140331e2d\nretn                                                                   ; +0x18e, 0x140331e2e\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 5     ; +0x18f, 0x140331e2f\ntest    rcx, rcx                                                       ; +0x196, 0x140331e36\njnz     short loc_140331E6A                                            ; +0x199, 0x140331e39\nmov     ecx, 668h; Size                                                ; +0x19b, 0x140331e3b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1a0, 0x140331e40\nmov     [rsp+28h+arg_18], rax                                          ; +0x1a5, 0x140331e45\nmov     rcx, rax                                                       ; +0x1aa, 0x140331e4a\ncall    sub_14017AB00                                                  ; +0x1ad, 0x140331e4d\nnop                                                                    ; +0x1b2, 0x140331e52\nmov     cs:qword_1406C2ED8, rax                                        ; +0x1b3, 0x140331e53\nmov     rdx, [rax]                                                     ; +0x1ba, 0x140331e5a\nmov     rcx, rax                                                       ; +0x1bd, 0x140331e5d\ncall    qword ptr [rdx+48h]                                            ; +0x1c0, 0x140331e60\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1c3, 0x140331e63\nmov     r8d, 0Bh                                                       ; +0x1ca, 0x140331e6a\nmov     rdx, rbx                                                       ; +0x1d0, 0x140331e70\ncall    GameManager__colorForIdx                                       ; +0x1d3, 0x140331e73\nmov     rax, rbx                                                       ; +0x1d8, 0x140331e78\nadd     rsp, 20h                                                       ; +0x1db, 0x140331e7b\npop     rbx                                                            ; +0x1df, 0x140331e7f\nretn                                                                   ; +0x1e0, 0x140331e80\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 6     ; +0x1e1, 0x140331e81\ntest    rcx, rcx                                                       ; +0x1e8, 0x140331e88\njnz     short loc_140331EBC                                            ; +0x1eb, 0x140331e8b\nmov     ecx, 668h; Size                                                ; +0x1ed, 0x140331e8d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1f2, 0x140331e92\nmov     [rsp+28h+arg_18], rax                                          ; +0x1f7, 0x140331e97\nmov     rcx, rax                                                       ; +0x1fc, 0x140331e9c\ncall    sub_14017AB00                                                  ; +0x1ff, 0x140331e9f\nnop                                                                    ; +0x204, 0x140331ea4\nmov     cs:qword_1406C2ED8, rax                                        ; +0x205, 0x140331ea5\nmov     rdx, [rax]                                                     ; +0x20c, 0x140331eac\nmov     rcx, rax                                                       ; +0x20f, 0x140331eaf\ncall    qword ptr [rdx+48h]                                            ; +0x212, 0x140331eb2\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x215, 0x140331eb5\nmov     r8d, 1                                                         ; +0x21c, 0x140331ebc\nmov     rdx, rbx                                                       ; +0x222, 0x140331ec2\ncall    GameManager__colorForIdx                                       ; +0x225, 0x140331ec5\nmov     rax, rbx                                                       ; +0x22a, 0x140331eca\nadd     rsp, 20h                                                       ; +0x22d, 0x140331ecd\npop     rbx                                                            ; +0x231, 0x140331ed1\nretn                                                                   ; +0x232, 0x140331ed2\nmov     rcx, cs:qword_1406C2ED8; jumptable 0000000140331CC8 case 7     ; +0x233, 0x140331ed3\ntest    rcx, rcx                                                       ; +0x23a, 0x140331eda\njnz     short loc_140331F0E                                            ; +0x23d, 0x140331edd\nmov     ecx, 668h; Size                                                ; +0x23f, 0x140331edf\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x244, 0x140331ee4\nmov     [rsp+28h+arg_18], rax                                          ; +0x249, 0x140331ee9\nmov     rcx, rax                                                       ; +0x24e, 0x140331eee\ncall    sub_14017AB00                                                  ; +0x251, 0x140331ef1\nnop                                                                    ; +0x256, 0x140331ef6\nmov     cs:qword_1406C2ED8, rax                                        ; +0x257, 0x140331ef7\nmov     rdx, [rax]                                                     ; +0x25e, 0x140331efe\nmov     rcx, rax                                                       ; +0x261, 0x140331f01\ncall    qword ptr [rdx+48h]                                            ; +0x264, 0x140331f04\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x267, 0x140331f07\nmov     r8d, 3                                                         ; +0x26e, 0x140331f0e\nmov     rdx, rbx                                                       ; +0x274, 0x140331f14\ncall    GameManager__colorForIdx                                       ; +0x277, 0x140331f17\nmov     rax, rbx                                                       ; +0x27c, 0x140331f1c\nadd     rsp, 20h                                                       ; +0x27f, 0x140331f1f\npop     rbx                                                            ; +0x283, 0x140331f23\nretn                                                                   ; +0x284, 0x140331f24\nand     r8d, 80000007h; jumptable 0000000140331CC8 default case        ; +0x285, 0x140331f25\njge     short loc_140331F38                                            ; +0x28c, 0x140331f2c\ndec     r8d                                                            ; +0x28e, 0x140331f2e\nor      r8d, 0FFFFFFF8h                                                ; +0x291, 0x140331f31\ninc     r8d                                                            ; +0x295, 0x140331f35\nmov     rdx, rbx                                                       ; +0x298, 0x140331f38\ncall    MenuGameLayer__getBGColor                                      ; +0x29b, 0x140331f3b\nmov     rax, rbx                                                       ; +0x2a0, 0x140331f40\nadd     rsp, 20h                                                       ; +0x2a3, 0x140331f43\npop     rbx                                                            ; +0x2a7, 0x140331f47\nretn                                                                   ; +0x2a8, 0x140331f48\nalign 4                                                                ; +0x2a9, 0x140331f49\ndd offset loc_140331CCB - 140000000h; jump table for switch statement  ; +0x2ac, 0x140331f4c", "xrefs": ["MenuGameLayer::updateColor @ 0x140331b6a", "MenuGameLayer::getBGColor @ 0x140331f3b", "<???> @ 0x1406d5078"], "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"}