{"type": "func", "start": 5373362832, "end": 5373363568, "name": "MenuGameLayer::getBGColor", "pseudocode": "// \n// MenuGameLayer::getBGColor from 0x140470290 to 0x140470570 (736 bytes)\n// \n// 3 xrefs:\n// > MenuGameLayer::updateColor @ 0x14047015a\n// > MenuGameLayer::getBGColor @ 0x140470540\n// > <???> @ 0x14092816c\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:32:38 +0000\n// \n\n// Hidden C++ exception states: #wind=7\nchar *__fastcall MenuGameLayer::getBGColor(__int64 a1, char *a2, int a3)\n{\n  char *result; // rax\n  __int64 v5; // rcx\n  __int64 v6; // rcx\n  __int64 v7; // rcx\n  __int64 v8; // rcx\n  __int64 v9; // rcx\n  __int64 v10; // rcx\n  __int64 v11; // rcx\n  __int64 v12; // r8\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  void *v19; // [rsp+48h] [rbp+20h]\n\n  switch ( a3 )\n  {\n    case 0:\n      *(_WORD *)a2 = 26112;\n      a2[2] = -1;\n      result = a2;\n      break;\n    case 1:\n      v5 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v13 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v13);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v5 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v5, a2, 7);\n      result = a2;\n      break;\n    case 2:\n      v6 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v14 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v14);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v6 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v6, a2, 8);\n      result = a2;\n      break;\n    case 3:\n      v7 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v15 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v15);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v7 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v7, a2, 9);\n      result = a2;\n      break;\n    case 4:\n      v8 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v16 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v16);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v8 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v8, a2, 10);\n      result = a2;\n      break;\n    case 5:\n      v9 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v17 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v17);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v9 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v9, a2, 11);\n      result = a2;\n      break;\n    case 6:\n      v10 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v18 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v18);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v10 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v10, a2, 1);\n      result = a2;\n      break;\n    case 7:\n      v11 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v19 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v19);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v11 = qword_14090BFD0;\n      }\n      GameManager::colorForIdx(v11, a2, 3);\n      result = a2;\n      break;\n    default:\n      v12 = a3 & 0x80000007;\n      if ( (int)v12 < 0 )\n        v12 = ((unsigned __int8)(v12 - 1) | 0xFFFFFFF8) + 1;\n      MenuGameLayer::getBGColor(a1, a2, v12);\n      result = a2;\n      break;\n  }\n  return result;\n}", "assembly": "; \n; MenuGameLayer::getBGColor from 0x140470290 to 0x140470570 (736 bytes)\n; \n; 3 xrefs:\n; > MenuGameLayer::updateColor @ 0x14047015a\n; > MenuGameLayer::getBGColor @ 0x140470540\n; > <???> @ 0x14092816c\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:32:38 +0000\n; \npush    rbx                                                            ; +0x0, 0x140470290\nsub     rsp, 20h                                                       ; +0x2, 0x140470292\nmov     rbx, rdx                                                       ; +0x6, 0x140470296\ncmp     r8d, 7; switch 8 cases                                         ; +0x9, 0x140470299\nja      def_1404702B8; jumptable 00000001404702B8 default case         ; +0xd, 0x14047029d\nmovsxd  rax, r8d                                                       ; +0x13, 0x1404702a3\nlea     rdx, cs:140000000h                                             ; +0x16, 0x1404702a6\nmov     r9d, ds:(jpt_1404702B8 - 140000000h)[rdx+rax*4]                ; +0x1d, 0x1404702ad\nadd     r9, rdx                                                        ; +0x25, 0x1404702b5\njmp     r9; switch jump                                                ; +0x28, 0x1404702b8\nmov     [rsp+28h+arg_10], 6600h; jumptable 00000001404702B8 case 0     ; +0x2b, 0x1404702bb\nmovzx   eax, [rsp+28h+arg_10]                                          ; +0x32, 0x1404702c2\nmov     [rbx], ax                                                      ; +0x37, 0x1404702c7\nmov     byte ptr [rbx+2], 0FFh                                         ; +0x3a, 0x1404702ca\nmov     rax, rbx                                                       ; +0x3e, 0x1404702ce\nadd     rsp, 20h                                                       ; +0x41, 0x1404702d1\npop     rbx                                                            ; +0x45, 0x1404702d5\nretn                                                                   ; +0x46, 0x1404702d6\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 1     ; +0x47, 0x1404702d7\ntest    rcx, rcx                                                       ; +0x4e, 0x1404702de\njnz     short loc_140470315                                            ; +0x51, 0x1404702e1\nmov     ecx, 6E8h; Size                                                ; +0x53, 0x1404702e3\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x58, 0x1404702e8\nmov     [rsp+28h+arg_18], rax                                          ; +0x5d, 0x1404702ed\nmov     rcx, rax                                                       ; +0x62, 0x1404702f2\ncall    GameManager__GameManager                                       ; +0x65, 0x1404702f5\nnop                                                                    ; +0x6a, 0x1404702fa\nmov     cs:qword_14090BFD0, rax                                        ; +0x6b, 0x1404702fb\nmov     rcx, [rax]                                                     ; +0x72, 0x140470302\nmov     rdx, [rcx+48h]                                                 ; +0x75, 0x140470305\nmov     rcx, rax                                                       ; +0x79, 0x140470309\ncall    rdx                                                            ; +0x7c, 0x14047030c\nmov     rcx, cs:qword_14090BFD0                                        ; +0x7e, 0x14047030e\nmov     r8d, 7                                                         ; +0x85, 0x140470315\nmov     rdx, rbx                                                       ; +0x8b, 0x14047031b\ncall    GameManager__colorForIdx                                       ; +0x8e, 0x14047031e\nmov     rax, rbx                                                       ; +0x93, 0x140470323\nadd     rsp, 20h                                                       ; +0x96, 0x140470326\npop     rbx                                                            ; +0x9a, 0x14047032a\nretn                                                                   ; +0x9b, 0x14047032b\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 2     ; +0x9c, 0x14047032c\ntest    rcx, rcx                                                       ; +0xa3, 0x140470333\njnz     short loc_14047036A                                            ; +0xa6, 0x140470336\nmov     ecx, 6E8h; Size                                                ; +0xa8, 0x140470338\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xad, 0x14047033d\nmov     [rsp+28h+arg_18], rax                                          ; +0xb2, 0x140470342\nmov     rcx, rax                                                       ; +0xb7, 0x140470347\ncall    GameManager__GameManager                                       ; +0xba, 0x14047034a\nnop                                                                    ; +0xbf, 0x14047034f\nmov     cs:qword_14090BFD0, rax                                        ; +0xc0, 0x140470350\nmov     rcx, [rax]                                                     ; +0xc7, 0x140470357\nmov     rdx, [rcx+48h]                                                 ; +0xca, 0x14047035a\nmov     rcx, rax                                                       ; +0xce, 0x14047035e\ncall    rdx                                                            ; +0xd1, 0x140470361\nmov     rcx, cs:qword_14090BFD0                                        ; +0xd3, 0x140470363\nmov     r8d, 8                                                         ; +0xda, 0x14047036a\nmov     rdx, rbx                                                       ; +0xe0, 0x140470370\ncall    GameManager__colorForIdx                                       ; +0xe3, 0x140470373\nmov     rax, rbx                                                       ; +0xe8, 0x140470378\nadd     rsp, 20h                                                       ; +0xeb, 0x14047037b\npop     rbx                                                            ; +0xef, 0x14047037f\nretn                                                                   ; +0xf0, 0x140470380\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 3     ; +0xf1, 0x140470381\ntest    rcx, rcx                                                       ; +0xf8, 0x140470388\njnz     short loc_1404703BF                                            ; +0xfb, 0x14047038b\nmov     ecx, 6E8h; Size                                                ; +0xfd, 0x14047038d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x102, 0x140470392\nmov     [rsp+28h+arg_18], rax                                          ; +0x107, 0x140470397\nmov     rcx, rax                                                       ; +0x10c, 0x14047039c\ncall    GameManager__GameManager                                       ; +0x10f, 0x14047039f\nnop                                                                    ; +0x114, 0x1404703a4\nmov     cs:qword_14090BFD0, rax                                        ; +0x115, 0x1404703a5\nmov     rcx, [rax]                                                     ; +0x11c, 0x1404703ac\nmov     rdx, [rcx+48h]                                                 ; +0x11f, 0x1404703af\nmov     rcx, rax                                                       ; +0x123, 0x1404703b3\ncall    rdx                                                            ; +0x126, 0x1404703b6\nmov     rcx, cs:qword_14090BFD0                                        ; +0x128, 0x1404703b8\nmov     r8d, 9                                                         ; +0x12f, 0x1404703bf\nmov     rdx, rbx                                                       ; +0x135, 0x1404703c5\ncall    GameManager__colorForIdx                                       ; +0x138, 0x1404703c8\nmov     rax, rbx                                                       ; +0x13d, 0x1404703cd\nadd     rsp, 20h                                                       ; +0x140, 0x1404703d0\npop     rbx                                                            ; +0x144, 0x1404703d4\nretn                                                                   ; +0x145, 0x1404703d5\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 4     ; +0x146, 0x1404703d6\ntest    rcx, rcx                                                       ; +0x14d, 0x1404703dd\njnz     short loc_140470414                                            ; +0x150, 0x1404703e0\nmov     ecx, 6E8h; Size                                                ; +0x152, 0x1404703e2\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x157, 0x1404703e7\nmov     [rsp+28h+arg_18], rax                                          ; +0x15c, 0x1404703ec\nmov     rcx, rax                                                       ; +0x161, 0x1404703f1\ncall    GameManager__GameManager                                       ; +0x164, 0x1404703f4\nnop                                                                    ; +0x169, 0x1404703f9\nmov     cs:qword_14090BFD0, rax                                        ; +0x16a, 0x1404703fa\nmov     rcx, [rax]                                                     ; +0x171, 0x140470401\nmov     rdx, [rcx+48h]                                                 ; +0x174, 0x140470404\nmov     rcx, rax                                                       ; +0x178, 0x140470408\ncall    rdx                                                            ; +0x17b, 0x14047040b\nmov     rcx, cs:qword_14090BFD0                                        ; +0x17d, 0x14047040d\nmov     r8d, 0Ah                                                       ; +0x184, 0x140470414\nmov     rdx, rbx                                                       ; +0x18a, 0x14047041a\ncall    GameManager__colorForIdx                                       ; +0x18d, 0x14047041d\nmov     rax, rbx                                                       ; +0x192, 0x140470422\nadd     rsp, 20h                                                       ; +0x195, 0x140470425\npop     rbx                                                            ; +0x199, 0x140470429\nretn                                                                   ; +0x19a, 0x14047042a\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 5     ; +0x19b, 0x14047042b\ntest    rcx, rcx                                                       ; +0x1a2, 0x140470432\njnz     short loc_140470469                                            ; +0x1a5, 0x140470435\nmov     ecx, 6E8h; Size                                                ; +0x1a7, 0x140470437\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1ac, 0x14047043c\nmov     [rsp+28h+arg_18], rax                                          ; +0x1b1, 0x140470441\nmov     rcx, rax                                                       ; +0x1b6, 0x140470446\ncall    GameManager__GameManager                                       ; +0x1b9, 0x140470449\nnop                                                                    ; +0x1be, 0x14047044e\nmov     cs:qword_14090BFD0, rax                                        ; +0x1bf, 0x14047044f\nmov     rcx, [rax]                                                     ; +0x1c6, 0x140470456\nmov     rdx, [rcx+48h]                                                 ; +0x1c9, 0x140470459\nmov     rcx, rax                                                       ; +0x1cd, 0x14047045d\ncall    rdx                                                            ; +0x1d0, 0x140470460\nmov     rcx, cs:qword_14090BFD0                                        ; +0x1d2, 0x140470462\nmov     r8d, 0Bh                                                       ; +0x1d9, 0x140470469\nmov     rdx, rbx                                                       ; +0x1df, 0x14047046f\ncall    GameManager__colorForIdx                                       ; +0x1e2, 0x140470472\nmov     rax, rbx                                                       ; +0x1e7, 0x140470477\nadd     rsp, 20h                                                       ; +0x1ea, 0x14047047a\npop     rbx                                                            ; +0x1ee, 0x14047047e\nretn                                                                   ; +0x1ef, 0x14047047f\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 6     ; +0x1f0, 0x140470480\ntest    rcx, rcx                                                       ; +0x1f7, 0x140470487\njnz     short loc_1404704BE                                            ; +0x1fa, 0x14047048a\nmov     ecx, 6E8h; Size                                                ; +0x1fc, 0x14047048c\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x201, 0x140470491\nmov     [rsp+28h+arg_18], rax                                          ; +0x206, 0x140470496\nmov     rcx, rax                                                       ; +0x20b, 0x14047049b\ncall    GameManager__GameManager                                       ; +0x20e, 0x14047049e\nnop                                                                    ; +0x213, 0x1404704a3\nmov     cs:qword_14090BFD0, rax                                        ; +0x214, 0x1404704a4\nmov     rcx, [rax]                                                     ; +0x21b, 0x1404704ab\nmov     rdx, [rcx+48h]                                                 ; +0x21e, 0x1404704ae\nmov     rcx, rax                                                       ; +0x222, 0x1404704b2\ncall    rdx                                                            ; +0x225, 0x1404704b5\nmov     rcx, cs:qword_14090BFD0                                        ; +0x227, 0x1404704b7\nmov     r8d, 1                                                         ; +0x22e, 0x1404704be\nmov     rdx, rbx                                                       ; +0x234, 0x1404704c4\ncall    GameManager__colorForIdx                                       ; +0x237, 0x1404704c7\nmov     rax, rbx                                                       ; +0x23c, 0x1404704cc\nadd     rsp, 20h                                                       ; +0x23f, 0x1404704cf\npop     rbx                                                            ; +0x243, 0x1404704d3\nretn                                                                   ; +0x244, 0x1404704d4\nmov     rcx, cs:qword_14090BFD0; jumptable 00000001404702B8 case 7     ; +0x245, 0x1404704d5\ntest    rcx, rcx                                                       ; +0x24c, 0x1404704dc\njnz     short loc_140470513                                            ; +0x24f, 0x1404704df\nmov     ecx, 6E8h; Size                                                ; +0x251, 0x1404704e1\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x256, 0x1404704e6\nmov     [rsp+28h+arg_18], rax                                          ; +0x25b, 0x1404704eb\nmov     rcx, rax                                                       ; +0x260, 0x1404704f0\ncall    GameManager__GameManager                                       ; +0x263, 0x1404704f3\nnop                                                                    ; +0x268, 0x1404704f8\nmov     cs:qword_14090BFD0, rax                                        ; +0x269, 0x1404704f9\nmov     rcx, [rax]                                                     ; +0x270, 0x140470500\nmov     rdx, [rcx+48h]                                                 ; +0x273, 0x140470503\nmov     rcx, rax                                                       ; +0x277, 0x140470507\ncall    rdx                                                            ; +0x27a, 0x14047050a\nmov     rcx, cs:qword_14090BFD0                                        ; +0x27c, 0x14047050c\nmov     r8d, 3                                                         ; +0x283, 0x140470513\nmov     rdx, rbx                                                       ; +0x289, 0x140470519\ncall    GameManager__colorForIdx                                       ; +0x28c, 0x14047051c\nmov     rax, rbx                                                       ; +0x291, 0x140470521\nadd     rsp, 20h                                                       ; +0x294, 0x140470524\npop     rbx                                                            ; +0x298, 0x140470528\nretn                                                                   ; +0x299, 0x140470529\nand     r8d, 80000007h; jumptable 00000001404702B8 default case        ; +0x29a, 0x14047052a\njge     short loc_14047053D                                            ; +0x2a1, 0x140470531\ndec     r8d                                                            ; +0x2a3, 0x140470533\nor      r8d, 0FFFFFFF8h                                                ; +0x2a6, 0x140470536\ninc     r8d                                                            ; +0x2aa, 0x14047053a\nmov     rdx, rbx                                                       ; +0x2ad, 0x14047053d\ncall    MenuGameLayer__getBGColor                                      ; +0x2b0, 0x140470540\nmov     rax, rbx                                                       ; +0x2b5, 0x140470545\nadd     rsp, 20h                                                       ; +0x2b8, 0x140470548\npop     rbx                                                            ; +0x2bc, 0x14047054c\nretn                                                                   ; +0x2bd, 0x14047054d\nalign 10h                                                              ; +0x2be, 0x14047054e\ndd offset loc_1404702BB - 140000000h; jump table for switch statement  ; +0x2c0, 0x140470550", "xrefs": ["MenuGameLayer::updateColor @ 0x14047015a", "MenuGameLayer::getBGColor @ 0x140470540", "<???> @ 0x14092816c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}