{"type": "func", "start": 5369271440, "end": 5369271702, "name": "CharacterColorPage::activeColorForMode", "pseudocode": "// \n// CharacterColorPage::activeColorForMode from 0x140089490 to 0x140089596 (262 bytes)\n// \n// 2 xrefs:\n// > CharacterColorPage::onPlayerColor @ 0x140089e2c\n// > <???> @ 0x1406c6cfc\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\nint CharacterColorPage::activeColorForMode(CharacterColorPage *a1, int a2)\n{\n  int v2; // edx\n  __int64 v4; // rcx\n  __int64 v5; // rcx\n  __int64 v6; // rcx\n  void *v7; // [rsp+30h] [rbp+8h]\n  void *v8; // [rsp+30h] [rbp+8h]\n  void *v9; // [rsp+30h] [rbp+8h]\n\n  if ( a2 )\n  {\n    v2 = a2 - 1;\n    if ( v2 )\n    {\n      if ( v2 == 1 )\n      {\n        v4 = qword_1406C2ED8;\n        if ( !qword_1406C2ED8 )\n        {\n          v7 = operator new(0x668u);\n          qword_1406C2ED8 = sub_14017AB00(v7);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n          v4 = qword_1406C2ED8;\n        }\n        return *(_DWORD *)(v4 + 828) - *(_DWORD *)(v4 + 832);\n      }\n      else\n      {\n        return 0;\n      }\n    }\n    else\n    {\n      v5 = qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v8 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00(v8);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v5 = qword_1406C2ED8;\n      }\n      return *(_DWORD *)(v5 + 816) - *(_DWORD *)(v5 + 820);\n    }\n  }\n  else\n  {\n    v6 = qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v9 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v9);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v6 = qword_1406C2ED8;\n    }\n    return *(_DWORD *)(v6 + 804) - *(_DWORD *)(v6 + 808);\n  }\n}", "assembly": "; \n; CharacterColorPage::activeColorForMode from 0x140089490 to 0x140089596 (262 bytes)\n; \n; 2 xrefs:\n; > CharacterColorPage::onPlayerColor @ 0x140089e2c\n; > <???> @ 0x1406c6cfc\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_0], rcx                                               ; +0x0, 0x140089490\nsub     rsp, 28h                                                       ; +0x5, 0x140089495\ntest    edx, edx                                                       ; +0x9, 0x140089499\njz      loc_14008954A                                                  ; +0xb, 0x14008949b\nsub     edx, 1                                                         ; +0x11, 0x1400894a1\njz      short loc_1400894FE                                            ; +0x14, 0x1400894a4\ncmp     edx, 1                                                         ; +0x16, 0x1400894a6\njz      short loc_1400894B2                                            ; +0x19, 0x1400894a9\nxor     eax, eax                                                       ; +0x1b, 0x1400894ab\nadd     rsp, 28h                                                       ; +0x1d, 0x1400894ad\nretn                                                                   ; +0x21, 0x1400894b1\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x22, 0x1400894b2\ntest    rcx, rcx                                                       ; +0x29, 0x1400894b9\njnz     short loc_1400894ED                                            ; +0x2c, 0x1400894bc\nmov     ecx, 668h; Size                                                ; +0x2e, 0x1400894be\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x33, 0x1400894c3\nmov     [rsp+28h+arg_0], rax                                           ; +0x38, 0x1400894c8\nmov     rcx, rax                                                       ; +0x3d, 0x1400894cd\ncall    sub_14017AB00                                                  ; +0x40, 0x1400894d0\nnop                                                                    ; +0x45, 0x1400894d5\nmov     cs:qword_1406C2ED8, rax                                        ; +0x46, 0x1400894d6\nmov     rdx, [rax]                                                     ; +0x4d, 0x1400894dd\nmov     rcx, rax                                                       ; +0x50, 0x1400894e0\ncall    qword ptr [rdx+48h]                                            ; +0x53, 0x1400894e3\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x56, 0x1400894e6\nmov     eax, [rcx+33Ch]                                                ; +0x5d, 0x1400894ed\nsub     eax, [rcx+340h]                                                ; +0x63, 0x1400894f3\nadd     rsp, 28h                                                       ; +0x69, 0x1400894f9\nretn                                                                   ; +0x6d, 0x1400894fd\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x6e, 0x1400894fe\ntest    rcx, rcx                                                       ; +0x75, 0x140089505\njnz     short loc_140089539                                            ; +0x78, 0x140089508\nmov     ecx, 668h; Size                                                ; +0x7a, 0x14008950a\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x7f, 0x14008950f\nmov     [rsp+28h+arg_0], rax                                           ; +0x84, 0x140089514\nmov     rcx, rax                                                       ; +0x89, 0x140089519\ncall    sub_14017AB00                                                  ; +0x8c, 0x14008951c\nnop                                                                    ; +0x91, 0x140089521\nmov     cs:qword_1406C2ED8, rax                                        ; +0x92, 0x140089522\nmov     rdx, [rax]                                                     ; +0x99, 0x140089529\nmov     rcx, rax                                                       ; +0x9c, 0x14008952c\ncall    qword ptr [rdx+48h]                                            ; +0x9f, 0x14008952f\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xa2, 0x140089532\nmov     eax, [rcx+330h]                                                ; +0xa9, 0x140089539\nsub     eax, [rcx+334h]                                                ; +0xaf, 0x14008953f\nadd     rsp, 28h                                                       ; +0xb5, 0x140089545\nretn                                                                   ; +0xb9, 0x140089549\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xba, 0x14008954a\ntest    rcx, rcx                                                       ; +0xc1, 0x140089551\njnz     short loc_140089585                                            ; +0xc4, 0x140089554\nmov     ecx, 668h; Size                                                ; +0xc6, 0x140089556\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xcb, 0x14008955b\nmov     [rsp+28h+arg_0], rax                                           ; +0xd0, 0x140089560\nmov     rcx, rax                                                       ; +0xd5, 0x140089565\ncall    sub_14017AB00                                                  ; +0xd8, 0x140089568\nnop                                                                    ; +0xdd, 0x14008956d\nmov     cs:qword_1406C2ED8, rax                                        ; +0xde, 0x14008956e\nmov     rdx, [rax]                                                     ; +0xe5, 0x140089575\nmov     rcx, rax                                                       ; +0xe8, 0x140089578\ncall    qword ptr [rdx+48h]                                            ; +0xeb, 0x14008957b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xee, 0x14008957e\nmov     eax, [rcx+324h]                                                ; +0xf5, 0x140089585\nsub     eax, [rcx+328h]                                                ; +0xfb, 0x14008958b\nadd     rsp, 28h                                                       ; +0x101, 0x140089591\nretn                                                                   ; +0x105, 0x140089595", "xrefs": ["CharacterColorPage::onPlayerColor @ 0x140089e2c", "<???> @ 0x1406c6cfc"], "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"}