{"type": "func", "start": 5369372208, "end": 5369372895, "name": "CharacterColorPage::onMode", "pseudocode": "// \n// CharacterColorPage::onMode from 0x1400a1e30 to 0x1400a20df (687 bytes)\n// \n// 2 xrefs:\n// > CharacterColorPage::init @ 0x1400a1154\n// > <???> @ 0x1409130d0\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:26:07 +0000\n// \n\n// Hidden C++ exception states: #wind=3\nvoid __fastcall CharacterColorPage::onMode(__int64 a1, __int64 a2)\n{\n  unsigned int v3; // ebx\n  __int64 v4; // rcx\n  char *v5; // r14\n  _QWORD *v6; // rax\n  int v7; // r9d\n  __int64 v8; // rax\n  __int64 DialogLayer; // rsi\n  __int64 v10; // rcx\n  __int64 v11; // rax\n  __int64 v12; // rdi\n  __int64 v13; // rbx\n  __int64 v14; // rax\n  __int16 v15; // [rsp+30h] [rbp-49h] BYREF\n  char v16; // [rsp+32h] [rbp-47h]\n  __int128 *v17; // [rsp+40h] [rbp-39h] BYREF\n  char v18[16]; // [rsp+48h] [rbp-31h] BYREF\n  __int64 v19; // [rsp+58h] [rbp-21h]\n  __int64 v20; // [rsp+60h] [rbp-19h]\n  __int128 v21; // [rsp+68h] [rbp-11h] BYREF\n  __int64 v22; // [rsp+78h] [rbp-1h]\n  __int64 v23; // [rsp+80h] [rbp+7h]\n  _BYTE v24[8]; // [rsp+88h] [rbp+Fh] BYREF\n  __int128 v25; // [rsp+90h] [rbp+17h]\n  __int64 v26; // [rsp+A0h] [rbp+27h]\n  __int64 v27; // [rsp+A8h] [rbp+2Fh]\n\n  v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);\n  if ( v3 != 2 )\n    goto LABEL_6;\n  v4 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v17 = (__int128 *)operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v4 = qword_14090BFD0;\n  }\n  if ( (unsigned __int8)GameManager::isIconUnlocked(v4, 2, 99) )\n  {\nLABEL_6:\n    CharacterColorPage::updateColorMode(a1, v3);\n  }\n  else\n  {\n    v25 = 0;\n    v5 = (char *)sub_14003D460(0x40u);\n    *(_QWORD *)&v25 = v5;\n    v26 = 61;\n    v27 = 63;\n    strcpy(v5, \"Complete <cy>10</c> <cg>Map Packs</c> to unlock <co>Glow</c>.\");\n    v17 = &v21;\n    v15 = -1;\n    v16 = -1;\n    v21 = 0;\n    v22 = 0;\n    v23 = 0;\n    v6 = sub_14003D460(0x40u);\n    *(_QWORD *)&v21 = v6;\n    v22 = 61;\n    v23 = 63;\n    *(_OWORD *)v6 = *(_OWORD *)v5;\n    *((_OWORD *)v6 + 1) = *((_OWORD *)v5 + 1);\n    *((_OWORD *)v6 + 2) = *((_OWORD *)v5 + 2);\n    v6[6] = *((_QWORD *)v5 + 6);\n    *((_DWORD *)v6 + 14) = *((_DWORD *)v5 + 14);\n    *((_WORD *)v6 + 30) = *((_WORD *)v5 + 30);\n    v18[15] = 0;\n    v19 = 14;\n    v20 = 15;\n    strcpy(v18, \"The Shopkeeper\");\n    v8 = DialogObject::create((unsigned int)v18, (unsigned int)&v21, 5, v7, 0, (__int64)&v15);\n    DialogLayer = DialogLayer::createDialogLayer(v8, 0, 2);\n    (*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(\n      *(_QWORD *)(a1 + 584),\n      DialogLayer,\n      100);\n    v11 = cocos2d::CCDirector::sharedDirector(v10);\n    cocos2d::CCDirector::getWinSize(v11, &v17);\n    v12 = **(_QWORD **)(DialogLayer + 560);\n    v13 = *(_QWORD *)(DialogLayer + 560);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, *(float *)&v17 * 0.5, *((float *)&v17 + 1) * 0.5);\n    (*(void (__fastcall **)(__int64, __int64))(v12 + 184))(v13, v14);\n    DialogLayer::animateInRandomSide(DialogLayer);\n    j_j_free(v5);\n  }\n}", "assembly": "; \n; CharacterColorPage::onMode from 0x1400a1e30 to 0x1400a20df (687 bytes)\n; \n; 2 xrefs:\n; > CharacterColorPage::init @ 0x1400a1154\n; > <???> @ 0x1409130d0\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:26:07 +0000\n; \nmov     [rsp-8+arg_10], rbx                                            ; +0x0, 0x1400a1e30\nmov     [rsp-8+arg_18], rsi                                            ; +0x5, 0x1400a1e35\npush    rbp                                                            ; +0xa, 0x1400a1e3a\npush    rdi                                                            ; +0xb, 0x1400a1e3b\npush    r14                                                            ; +0xc, 0x1400a1e3c\nlea     rbp, [rsp-47h]                                                 ; +0xe, 0x1400a1e3e\nsub     rsp, 0C0h                                                      ; +0x13, 0x1400a1e43\nmov     rax, cs:__security_cookie                                      ; +0x1a, 0x1400a1e4a\nxor     rax, rsp                                                       ; +0x21, 0x1400a1e51\nmov     [rbp+57h+var_20], rax                                          ; +0x24, 0x1400a1e54\nmov     rdi, rcx                                                       ; +0x28, 0x1400a1e58\nmov     rax, [rdx]                                                     ; +0x2b, 0x1400a1e5b\nmov     rcx, rdx                                                       ; +0x2e, 0x1400a1e5e\ncall    qword ptr [rax+38h]                                            ; +0x31, 0x1400a1e61\nmov     ebx, eax                                                       ; +0x34, 0x1400a1e64\ncmp     eax, 2                                                         ; +0x36, 0x1400a1e66\njnz     loc_1400A20B1                                                  ; +0x39, 0x1400a1e69\nmov     rcx, cs:qword_14090BFD0                                        ; +0x3f, 0x1400a1e6f\ntest    rcx, rcx                                                       ; +0x46, 0x1400a1e76\njnz     short loc_1400A1EAC                                            ; +0x49, 0x1400a1e79\nmov     ecx, 6E8h; Size                                                ; +0x4b, 0x1400a1e7b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x50, 0x1400a1e80\nmov     [rbp+57h+var_90], rax                                          ; +0x55, 0x1400a1e85\nmov     rcx, rax                                                       ; +0x59, 0x1400a1e89\ncall    GameManager__GameManager                                       ; +0x5c, 0x1400a1e8c\nnop                                                                    ; +0x61, 0x1400a1e91\nmov     cs:qword_14090BFD0, rax                                        ; +0x62, 0x1400a1e92\nmov     rcx, [rax]                                                     ; +0x69, 0x1400a1e99\nmov     rdx, [rcx+48h]                                                 ; +0x6c, 0x1400a1e9c\nmov     rcx, rax                                                       ; +0x70, 0x1400a1ea0\ncall    rdx                                                            ; +0x73, 0x1400a1ea3\nmov     rcx, cs:qword_14090BFD0                                        ; +0x75, 0x1400a1ea5\nmov     edx, 2                                                         ; +0x7c, 0x1400a1eac\nmov     r8d, 63h ; 'c'                                                 ; +0x81, 0x1400a1eb1\ncall    GameManager__isIconUnlocked                                    ; +0x87, 0x1400a1eb7\ntest    al, al                                                         ; +0x8c, 0x1400a1ebc\njnz     loc_1400A20B1                                                  ; +0x8e, 0x1400a1ebe\nxorps   xmm0, xmm0                                                     ; +0x94, 0x1400a1ec4\nmovups  [rbp+57h+var_40], xmm0                                         ; +0x97, 0x1400a1ec7\nmov     ecx, 40h ; '@'                                                 ; +0x9b, 0x1400a1ecb\ncall    sub_14003D460                                                  ; +0xa0, 0x1400a1ed0\nmov     r14, rax                                                       ; +0xa5, 0x1400a1ed5\nmov     qword ptr [rbp+57h+var_40], rax                                ; +0xa8, 0x1400a1ed8\nmov     [rbp+57h+var_30], 3Dh ; '='                                    ; +0xac, 0x1400a1edc\nmov     [rbp+57h+var_28], 3Fh ; '?'                                    ; +0xb4, 0x1400a1ee4\nmovups  xmm0, cs:xmmword_14071C8C0                                     ; +0xbc, 0x1400a1eec\nmovups  xmmword ptr [rax], xmm0                                        ; +0xc3, 0x1400a1ef3\nmovups  xmm1, cs:xmmword_14071C8D0                                     ; +0xc6, 0x1400a1ef6\nmovups  xmmword ptr [rax+10h], xmm1                                    ; +0xcd, 0x1400a1efd\nmovups  xmm0, cs:xmmword_14071C8E0                                     ; +0xd1, 0x1400a1f01\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0xd8, 0x1400a1f08\nmovsd   xmm0, cs:qword_14071C8F0                                       ; +0xdc, 0x1400a1f0c\nmovsd   qword ptr [rax+30h], xmm0                                      ; +0xe4, 0x1400a1f14\nmov     eax, cs:dword_14071C8F8                                        ; +0xe9, 0x1400a1f19\nmov     [r14+38h], eax                                                 ; +0xef, 0x1400a1f1f\nmovzx   eax, cs:byte_14071C8FC                                         ; +0xf3, 0x1400a1f23\nmov     [r14+3Ch], al                                                  ; +0xfa, 0x1400a1f2a\nmov     byte ptr [r14+3Dh], 0                                          ; +0xfe, 0x1400a1f2e\nlea     rax, [rbp+57h+var_68]                                          ; +0x103, 0x1400a1f33\nmov     [rbp+57h+var_90], rax                                          ; +0x107, 0x1400a1f37\nmovzx   eax, cs:word_140702D24                                         ; +0x10b, 0x1400a1f3b\nmov     [rbp+57h+var_A0], ax                                           ; +0x112, 0x1400a1f42\nmovzx   eax, cs:byte_140702D26                                         ; +0x116, 0x1400a1f46\nmov     [rbp+57h+var_9E], al                                           ; +0x11d, 0x1400a1f4d\nxorps   xmm0, xmm0                                                     ; +0x120, 0x1400a1f50\nmovups  [rbp+57h+var_68], xmm0                                         ; +0x123, 0x1400a1f53\nxor     eax, eax                                                       ; +0x127, 0x1400a1f57\nmov     [rbp+57h+var_58], rax                                          ; +0x129, 0x1400a1f59\nmov     [rbp+57h+var_50], rax                                          ; +0x12d, 0x1400a1f5d\nmov     ecx, 40h ; '@'                                                 ; +0x131, 0x1400a1f61\ncall    sub_14003D460                                                  ; +0x136, 0x1400a1f66\nmov     rdx, rax                                                       ; +0x13b, 0x1400a1f6b\nmov     qword ptr [rbp+57h+var_68], rax                                ; +0x13e, 0x1400a1f6e\nmov     [rbp+57h+var_58], 3Dh ; '='                                    ; +0x142, 0x1400a1f72\nmov     [rbp+57h+var_50], 3Fh ; '?'                                    ; +0x14a, 0x1400a1f7a\nmovups  xmm0, xmmword ptr [r14]                                        ; +0x152, 0x1400a1f82\nmovups  xmmword ptr [rax], xmm0                                        ; +0x156, 0x1400a1f86\nmovups  xmm1, xmmword ptr [r14+10h]                                    ; +0x159, 0x1400a1f89\nmovups  xmmword ptr [rax+10h], xmm1                                    ; +0x15e, 0x1400a1f8e\nmovups  xmm0, xmmword ptr [r14+20h]                                    ; +0x162, 0x1400a1f92\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0x167, 0x1400a1f97\nmovsd   xmm1, qword ptr [r14+30h]                                      ; +0x16b, 0x1400a1f9b\nmovsd   qword ptr [rax+30h], xmm1                                      ; +0x171, 0x1400a1fa1\nmov     ecx, [r14+38h]                                                 ; +0x176, 0x1400a1fa6\nmov     [rax+38h], ecx                                                 ; +0x17a, 0x1400a1faa\nmovzx   eax, word ptr [r14+3Ch]                                        ; +0x17d, 0x1400a1fad\nmov     [rdx+3Ch], ax                                                  ; +0x182, 0x1400a1fb2\nmov     word ptr [rbp+57h+var_88+0Eh], 0                               ; +0x186, 0x1400a1fb6\nmov     [rbp+57h+var_78], 0Eh                                          ; +0x18c, 0x1400a1fbc\nmov     [rbp+57h+var_70], 0Fh                                          ; +0x194, 0x1400a1fc4\nmovsd   xmm0, cs:qword_14071C900                                       ; +0x19c, 0x1400a1fcc\nmovsd   qword ptr [rbp+57h+var_88], xmm0                               ; +0x1a4, 0x1400a1fd4\nmov     eax, cs:dword_14071C908                                        ; +0x1a9, 0x1400a1fd9\nmov     dword ptr [rbp+57h+var_88+8], eax                              ; +0x1af, 0x1400a1fdf\nmovzx   eax, cs:word_14071C90C                                         ; +0x1b2, 0x1400a1fe2\nmov     word ptr [rbp+57h+var_88+0Ch], ax                              ; +0x1b9, 0x1400a1fe9\nlea     rax, [rbp+57h+var_A0]                                          ; +0x1bd, 0x1400a1fed\nmov     [rsp+0D0h+var_A8], rax                                         ; +0x1c1, 0x1400a1ff1\nmov     [rsp+0D0h+var_B0], 0                                           ; +0x1c6, 0x1400a1ff6\nmovss   xmm3, cs:flt_140835080                                         ; +0x1cb, 0x1400a1ffb\nmov     r8d, 5                                                         ; +0x1d3, 0x1400a2003\nlea     rdx, [rbp+57h+var_68]                                          ; +0x1d9, 0x1400a2009\nlea     rcx, [rbp+57h+var_88]                                          ; +0x1dd, 0x1400a200d\ncall    DialogObject__create                                           ; +0x1e1, 0x1400a2011\nxor     edx, edx                                                       ; +0x1e6, 0x1400a2016\nmov     r8d, 2                                                         ; +0x1e8, 0x1400a2018\nmov     rcx, rax                                                       ; +0x1ee, 0x1400a201e\ncall    DialogLayer__createDialogLayer                                 ; +0x1f1, 0x1400a2021\nmov     rsi, rax                                                       ; +0x1f6, 0x1400a2026\nmov     r10, [rdi+248h]                                                ; +0x1f9, 0x1400a2029\nmov     rcx, [r10]                                                     ; +0x200, 0x1400a2030\nmov     r9, [rcx+1C8h]                                                 ; +0x203, 0x1400a2033\nmov     r8d, 64h ; 'd'                                                 ; +0x20a, 0x1400a203a\nmov     rdx, rax                                                       ; +0x210, 0x1400a2040\nmov     rcx, r10                                                       ; +0x213, 0x1400a2043\ncall    r9                                                             ; +0x216, 0x1400a2046\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x219, 0x1400a2049\nmov     rcx, rax                                                       ; +0x21f, 0x1400a204f\nlea     rdx, [rbp+57h+var_90]                                          ; +0x222, 0x1400a2052\ncall    cs:?getWinSize@CCDirector@cocos2d@@QEAA?AVCCSize@2@XZ; cocos2d::CCDirector::getWinSize(void) ; +0x226, 0x1400a2056\nmov     rcx, [rsi+230h]                                                ; +0x22c, 0x1400a205c\nmov     rdi, [rcx]                                                     ; +0x233, 0x1400a2063\nmov     rbx, rcx                                                       ; +0x236, 0x1400a2066\nmovss   xmm2, dword ptr [rbp+57h+var_90+4]                             ; +0x239, 0x1400a2069\nmulss   xmm2, cs:dword_140834F20                                       ; +0x23e, 0x1400a206e\nmovss   xmm1, dword ptr [rbp+57h+var_90]                               ; +0x246, 0x1400a2076\nmulss   xmm1, cs:dword_140834F20                                       ; +0x24b, 0x1400a207b\nlea     rcx, [rbp+57h+var_48]                                          ; +0x253, 0x1400a2083\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x257, 0x1400a2087\nmov     rdx, rax                                                       ; +0x25d, 0x1400a208d\nmov     rcx, rbx                                                       ; +0x260, 0x1400a2090\ncall    qword ptr [rdi+0B8h]                                           ; +0x263, 0x1400a2093\nmov     rcx, rsi                                                       ; +0x269, 0x1400a2099\ncall    DialogLayer__animateInRandomSide                               ; +0x26c, 0x1400a209c\nnop                                                                    ; +0x271, 0x1400a20a1\nmov     edx, 40h ; '@'                                                 ; +0x272, 0x1400a20a2\nmov     rcx, r14; Block                                                ; +0x277, 0x1400a20a7\ncall    j_j_free                                                       ; +0x27a, 0x1400a20aa\njmp     short loc_1400A20BB                                            ; +0x27f, 0x1400a20af\nmov     edx, ebx                                                       ; +0x281, 0x1400a20b1\nmov     rcx, rdi                                                       ; +0x283, 0x1400a20b3\ncall    CharacterColorPage__updateColorMode                            ; +0x286, 0x1400a20b6\nmov     rcx, [rbp+57h+var_20]                                          ; +0x28b, 0x1400a20bb\nxor     rcx, rsp; StackCookie                                          ; +0x28f, 0x1400a20bf\ncall    __security_check_cookie                                        ; +0x292, 0x1400a20c2\nlea     r11, [rsp+0D0h+var_10]                                         ; +0x297, 0x1400a20c7\nmov     rbx, [r11+30h]                                                 ; +0x29f, 0x1400a20cf\nmov     rsi, [r11+38h]                                                 ; +0x2a3, 0x1400a20d3\nmov     rsp, r11                                                       ; +0x2a7, 0x1400a20d7\npop     r14                                                            ; +0x2aa, 0x1400a20da\npop     rdi                                                            ; +0x2ac, 0x1400a20dc\npop     rbp                                                            ; +0x2ad, 0x1400a20dd\nretn                                                                   ; +0x2ae, 0x1400a20de", "xrefs": ["CharacterColorPage::init @ 0x1400a1154", "<???> @ 0x1409130d0"], "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"}