{"type": "func", "start": 5369022448, "end": 5369022955, "name": "CCSpriteWithHue::initShader", "pseudocode": "// \n// CCSpriteWithHue::initShader from 0x14004c7f0 to 0x14004c9eb (507 bytes)\n// \n// 2 xrefs:\n// > CCSpriteWithHue::initWithTexture @ 0x14004c6f5\n// > <???> @ 0x1409100a0\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:25:33 +0000\n// \n\n// Hidden C++ exception states: #wind=3\n__int64 __fastcall CCSpriteWithHue::initShader(_DWORD *a1)\n{\n  __int64 v2; // rax\n  const char *v3; // rbx\n  cocos2d::CCShaderCache *v4; // rax\n  cocos2d::CCGLProgram *v5; // rdi\n  const char *v6; // rax\n  __int64 v7; // rax\n  __int64 v8; // rcx\n  const char *v9; // rbx\n  cocos2d::CCShaderCache *v10; // rax\n  __int64 v11; // rax\n  __int64 v12; // rax\n  __int64 v13; // rax\n  _BYTE v15[32]; // [rsp+28h] [rbp-50h] BYREF\n  _BYTE v16[32]; // [rsp+48h] [rbp-30h] BYREF\n\n  v2 = (*(__int64 (__fastcall **)(_DWORD *, _BYTE *))(*(_QWORD *)a1 + 1088LL))(a1, v15);\n  v3 = (const char *)v2;\n  if ( *(_QWORD *)(v2 + 24) > 0xFu )\n    v3 = *(const char **)v2;\n  v4 = (cocos2d::CCShaderCache *)((__int64 (*)(void))cocos2d::CCShaderCache::sharedShaderCache)();\n  v5 = cocos2d::CCShaderCache::programForKey(v4, v3);\n  sub_14003D310((__int64)v15);\n  if ( !v5 )\n  {\n    v5 = (cocos2d::CCGLProgram *)operator new(0x78u);\n    cocos2d::CCGLProgram::CCGLProgram(v5);\n    *(_QWORD *)v5 = &cocos2d::CCGLProgram::`vftable';\n    v6 = (const char *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 1096LL))(a1);\n    cocos2d::CCGLProgram::initWithVertexShaderByteArray(v5, cocos2d::ccPositionTextureColor_vert, v6);\n    cocos2d::CCGLProgram::addAttribute(v5, \"a_position\", 0);\n    cocos2d::CCGLProgram::addAttribute(v5, \"a_color\", 1u);\n    cocos2d::CCGLProgram::addAttribute(v5, \"a_texCoord\", 2u);\n    cocos2d::CCGLProgram::link(v5);\n    cocos2d::CCGLProgram::updateUniforms(v5);\n    v7 = (*(__int64 (__fastcall **)(_DWORD *, _BYTE *))(*(_QWORD *)a1 + 1088LL))(a1, v16);\n    v9 = (const char *)v7;\n    if ( *(_QWORD *)(v7 + 24) > 0xFu )\n      v9 = *(const char **)v7;\n    v10 = (cocos2d::CCShaderCache *)cocos2d::CCShaderCache::sharedShaderCache(v8);\n    cocos2d::CCShaderCache::addProgram(v10, v5, v9);\n    sub_14003D310((__int64)v16);\n    cocos2d::CCObject::release(v5);\n  }\n  (*(void (__fastcall **)(_DWORD *, cocos2d::CCGLProgram *))(*(_QWORD *)a1 + 656LL))(a1, v5);\n  v11 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 648LL))(a1);\n  a1[163] = _glewGetUniformLocation(*(unsigned int *)(v11 + 56), \"u_hue\");\n  v12 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 648LL))(a1);\n  a1[164] = _glewGetUniformLocation(*(unsigned int *)(v12 + 56), \"u_alpha\");\n  v13 = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 648LL))(a1);\n  a1[165] = _glewGetUniformLocation(*(unsigned int *)(v13 + 56), \"u_lum\");\n  return (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 1104LL))(a1);\n}", "assembly": "; \n; CCSpriteWithHue::initShader from 0x14004c7f0 to 0x14004c9eb (507 bytes)\n; \n; 2 xrefs:\n; > CCSpriteWithHue::initWithTexture @ 0x14004c6f5\n; > <???> @ 0x1409100a0\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:25:33 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x14004c7f0\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x14004c7f5\npush    rdi                                                            ; +0xa, 0x14004c7fa\nsub     rsp, 70h                                                       ; +0xb, 0x14004c7fb\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x14004c7ff\nxor     rax, rsp                                                       ; +0x16, 0x14004c806\nmov     [rsp+78h+var_10], rax                                          ; +0x19, 0x14004c809\nmov     rsi, rcx                                                       ; +0x1e, 0x14004c80e\nmov     rax, [rcx]                                                     ; +0x21, 0x14004c811\nlea     rdx, [rsp+78h+var_50]                                          ; +0x24, 0x14004c814\ncall    qword ptr [rax+440h]                                           ; +0x29, 0x14004c819\nmov     rbx, rax                                                       ; +0x2f, 0x14004c81f\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x32, 0x14004c822\njbe     short loc_14004C82C                                            ; +0x37, 0x14004c827\nmov     rbx, [rax]                                                     ; +0x39, 0x14004c829\ncall    cs:?sharedShaderCache@CCShaderCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x3c, 0x14004c82c\nmov     rcx, rax                                                       ; +0x42, 0x14004c832\nmov     rdx, rbx                                                       ; +0x45, 0x14004c835\ncall    cs:?programForKey@CCShaderCache@cocos2d@@QEAAPEAVCCGLProgram@2@PEBD@Z; cocos2d::CCShaderCache::programForKey(char const *) ; +0x48, 0x14004c838\nmov     rdi, rax                                                       ; +0x4e, 0x14004c83e\nlea     rcx, [rsp+78h+var_50]                                          ; +0x51, 0x14004c841\ncall    sub_14003D310                                                  ; +0x56, 0x14004c846\ntest    rdi, rdi                                                       ; +0x5b, 0x14004c84b\njnz     loc_14004C936                                                  ; +0x5e, 0x14004c84e\nmov     ecx, 78h ; 'x'; Size                                           ; +0x64, 0x14004c854\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x69, 0x14004c859\nmov     rdi, rax                                                       ; +0x6e, 0x14004c85e\nmov     [rsp+78h+var_58], rax                                          ; +0x71, 0x14004c861\nmov     rcx, rax                                                       ; +0x76, 0x14004c866\ncall    cs:??0CCGLProgram@cocos2d@@QEAA@XZ; cocos2d::CCGLProgram::CCGLProgram(void) ; +0x79, 0x14004c869\nlea     rax, ??_7CCGLProgram@cocos2d@@6B@; const cocos2d::CCGLProgram::`vftable' ; +0x7f, 0x14004c86f\nmov     [rdi], rax                                                     ; +0x86, 0x14004c876\nmov     rax, cs:?ccPositionTextureColor_vert@cocos2d@@3PEBDEB; char const * const cocos2d::ccPositionTextureColor_vert ; +0x89, 0x14004c879\nmov     rbx, [rax]                                                     ; +0x90, 0x14004c880\nmov     rax, [rsi]                                                     ; +0x93, 0x14004c883\nmov     rcx, rsi                                                       ; +0x96, 0x14004c886\ncall    qword ptr [rax+448h]                                           ; +0x99, 0x14004c889\nmov     r8, rax                                                        ; +0x9f, 0x14004c88f\nmov     rdx, rbx                                                       ; +0xa2, 0x14004c892\nmov     rcx, rdi                                                       ; +0xa5, 0x14004c895\ncall    cs:?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0xa8, 0x14004c898\nxor     r8d, r8d                                                       ; +0xae, 0x14004c89e\nlea     rdx, aAPosition; \"a_position\"                                  ; +0xb1, 0x14004c8a1\nmov     rcx, rdi                                                       ; +0xb8, 0x14004c8a8\ncall    cs:?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0xbb, 0x14004c8ab\nmov     r8d, 1                                                         ; +0xc1, 0x14004c8b1\nlea     rdx, aAColor; \"a_color\"                                        ; +0xc7, 0x14004c8b7\nmov     rcx, rdi                                                       ; +0xce, 0x14004c8be\ncall    cs:?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0xd1, 0x14004c8c1\nmov     r8d, 2                                                         ; +0xd7, 0x14004c8c7\nlea     rdx, aATexcoord; \"a_texCoord\"                                  ; +0xdd, 0x14004c8cd\nmov     rcx, rdi                                                       ; +0xe4, 0x14004c8d4\ncall    cs:?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0xe7, 0x14004c8d7\nmov     rcx, rdi                                                       ; +0xed, 0x14004c8dd\ncall    cs:?link@CCGLProgram@cocos2d@@QEAA_NXZ; cocos2d::CCGLProgram::link(void) ; +0xf0, 0x14004c8e0\nmov     rcx, rdi                                                       ; +0xf6, 0x14004c8e6\ncall    cs:?updateUniforms@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::updateUniforms(void) ; +0xf9, 0x14004c8e9\nmov     rax, [rsi]                                                     ; +0xff, 0x14004c8ef\nlea     rdx, [rsp+78h+var_30]                                          ; +0x102, 0x14004c8f2\nmov     rcx, rsi                                                       ; +0x107, 0x14004c8f7\ncall    qword ptr [rax+440h]                                           ; +0x10a, 0x14004c8fa\nmov     rbx, rax                                                       ; +0x110, 0x14004c900\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x113, 0x14004c903\njbe     short loc_14004C90D                                            ; +0x118, 0x14004c908\nmov     rbx, [rax]                                                     ; +0x11a, 0x14004c90a\ncall    cs:?sharedShaderCache@CCShaderCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x11d, 0x14004c90d\nmov     rcx, rax                                                       ; +0x123, 0x14004c913\nmov     r8, rbx                                                        ; +0x126, 0x14004c916\nmov     rdx, rdi                                                       ; +0x129, 0x14004c919\ncall    cs:?addProgram@CCShaderCache@cocos2d@@QEAAXPEAVCCGLProgram@2@PEBD@Z; cocos2d::CCShaderCache::addProgram(cocos2d::CCGLProgram *,char const *) ; +0x12c, 0x14004c91c\nnop                                                                    ; +0x132, 0x14004c922\nlea     rcx, [rsp+78h+var_30]                                          ; +0x133, 0x14004c923\ncall    sub_14003D310                                                  ; +0x138, 0x14004c928\nmov     rcx, rdi                                                       ; +0x13d, 0x14004c92d\ncall    cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x140, 0x14004c930\nmov     rax, [rsi]                                                     ; +0x146, 0x14004c936\nmov     rdx, rdi                                                       ; +0x149, 0x14004c939\nmov     rcx, rsi                                                       ; +0x14c, 0x14004c93c\ncall    qword ptr [rax+290h]                                           ; +0x14f, 0x14004c93f\nmov     rax, [rsi]                                                     ; +0x155, 0x14004c945\nmov     rcx, rsi                                                       ; +0x158, 0x14004c948\ncall    qword ptr [rax+288h]                                           ; +0x15b, 0x14004c94b\nmov     rcx, cs:__glewGetUniformLocation                               ; +0x161, 0x14004c951\nmov     r8, [rcx]                                                      ; +0x168, 0x14004c958\nlea     rdx, aUHue; \"u_hue\"                                            ; +0x16b, 0x14004c95b\nmov     ecx, [rax+38h]                                                 ; +0x172, 0x14004c962\ncall    r8                                                             ; +0x175, 0x14004c965\nmov     [rsi+28Ch], eax                                                ; +0x178, 0x14004c968\nmov     rax, [rsi]                                                     ; +0x17e, 0x14004c96e\nmov     rcx, rsi                                                       ; +0x181, 0x14004c971\ncall    qword ptr [rax+288h]                                           ; +0x184, 0x14004c974\nmov     rcx, cs:__glewGetUniformLocation                               ; +0x18a, 0x14004c97a\nmov     r8, [rcx]                                                      ; +0x191, 0x14004c981\nlea     rdx, aUAlpha; \"u_alpha\"                                        ; +0x194, 0x14004c984\nmov     ecx, [rax+38h]                                                 ; +0x19b, 0x14004c98b\ncall    r8                                                             ; +0x19e, 0x14004c98e\nmov     [rsi+290h], eax                                                ; +0x1a1, 0x14004c991\nmov     rax, [rsi]                                                     ; +0x1a7, 0x14004c997\nmov     rcx, rsi                                                       ; +0x1aa, 0x14004c99a\ncall    qword ptr [rax+288h]                                           ; +0x1ad, 0x14004c99d\nmov     rdx, cs:__glewGetUniformLocation                               ; +0x1b3, 0x14004c9a3\nmov     r8, [rdx]                                                      ; +0x1ba, 0x14004c9aa\nlea     rdx, aULum; \"u_lum\"                                            ; +0x1bd, 0x14004c9ad\nmov     ecx, [rax+38h]                                                 ; +0x1c4, 0x14004c9b4\ncall    r8                                                             ; +0x1c7, 0x14004c9b7\nmov     [rsi+294h], eax                                                ; +0x1ca, 0x14004c9ba\nmov     rax, [rsi]                                                     ; +0x1d0, 0x14004c9c0\nmov     rcx, rsi                                                       ; +0x1d3, 0x14004c9c3\ncall    qword ptr [rax+450h]                                           ; +0x1d6, 0x14004c9c6\nmov     rcx, [rsp+78h+var_10]                                          ; +0x1dc, 0x14004c9cc\nxor     rcx, rsp; StackCookie                                          ; +0x1e1, 0x14004c9d1\ncall    __security_check_cookie                                        ; +0x1e4, 0x14004c9d4\nlea     r11, [rsp+78h+var_8]                                           ; +0x1e9, 0x14004c9d9\nmov     rbx, [r11+18h]                                                 ; +0x1ee, 0x14004c9de\nmov     rsi, [r11+20h]                                                 ; +0x1f2, 0x14004c9e2\nmov     rsp, r11                                                       ; +0x1f6, 0x14004c9e6\npop     rdi                                                            ; +0x1f9, 0x14004c9e9\nretn                                                                   ; +0x1fa, 0x14004c9ea", "xrefs": ["CCSpriteWithHue::initWithTexture @ 0x14004c6f5", "<???> @ 0x1409100a0"], "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"}