{"type": "func", "start": 4140864, "end": 4141140, "name": "CCSpriteWithHue::initShader", "pseudocode": "// \n// CCSpriteWithHue::initShader from 0x3f2f40 to 0x3f3054 (276 bytes)\n// \n// 1 xrefs:\n// > CCSpriteWithHue::initWithTexture @ 0x3f30bc\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:47:15 +0000\n// \n\nint __fastcall CCSpriteWithHue::initShader(CCSpriteWithHue *this, int a2, char *a3, int a4)\n{\n  cocos2d::CCShaderCache *v5; // r4\n  char *v6; // r1\n  cocos2d::CCGLProgram *v7; // r4\n  const char *v8; // r8\n  const char *v9; // r0\n  cocos2d::CCShaderCache *updated; // r0\n  cocos2d::CCShaderCache *v11; // r8\n  char *v12; // r2\n  _DWORD v14[2]; // [sp+0h] [bp-10h] BYREF\n  char *v15; // [sp+8h] [bp-8h]\n  int v16; // [sp+Ch] [bp-4h]\n\n  v14[0] = this;\n  v14[1] = a2;\n  v15 = a3;\n  v16 = a4;\n  v5 = (cocos2d::CCShaderCache *)cocos2d::CCShaderCache::sharedShaderCache(this);\n  (*(void (__fastcall **)(_DWORD *, CCSpriteWithHue *))(*(_DWORD *)this + 620))(v14, this);\n  if ( (v14[0] & 1) != 0 )\n    v6 = v15;\n  else\n    v6 = (char *)v14 + 1;\n  v7 = (cocos2d::CCGLProgram *)cocos2d::CCShaderCache::programForKey(v5, v6);\n  std::string::~string((int)v14);\n  if ( !v7 )\n  {\n    v7 = (cocos2d::CCGLProgram *)operator new(0x68u);\n    cocos2d::CCGLProgram::CCGLProgram(v7);\n    v8 = cocos2d::ccPositionTextureColor_vert[0];\n    v9 = (const char *)(*(int (__fastcall **)(CCSpriteWithHue *))(*(_DWORD *)this + 624))(this);\n    cocos2d::CCGLProgram::initWithVertexShaderByteArray(v7, v8, v9);\n    cocos2d::CCGLProgram::addAttribute(v7, \"a_position\", 0);\n    cocos2d::CCGLProgram::addAttribute(v7, \"a_color\", 1u);\n    cocos2d::CCGLProgram::addAttribute(v7, \"a_texCoord\", 2u);\n    cocos2d::CCGLProgram::link(v7);\n    updated = (cocos2d::CCShaderCache *)cocos2d::CCGLProgram::updateUniforms(v7);\n    v11 = (cocos2d::CCShaderCache *)cocos2d::CCShaderCache::sharedShaderCache(updated);\n    (*(void (__fastcall **)(_DWORD *, CCSpriteWithHue *))(*(_DWORD *)this + 620))(v14, this);\n    if ( (v14[0] & 1) != 0 )\n      v12 = v15;\n    else\n      v12 = (char *)v14 + 1;\n    cocos2d::CCShaderCache::addProgram(v11, v7, v12);\n    std::string::~string((int)v14);\n    cocos2d::CCObject::release(v7);\n  }\n  (*(void (__fastcall **)(CCSpriteWithHue *, cocos2d::CCGLProgram *))(*(_DWORD *)this + 332))(this, v7);\n  CCSpriteWithHue::getUniformLocations(this);\n  return (*(int (__fastcall **)(CCSpriteWithHue *))(*(_DWORD *)this + 628))(this);\n}", "assembly": "; \n; CCSpriteWithHue::initShader from 0x3f2f40 to 0x3f3054 (276 bytes)\n; \n; 1 xrefs:\n; > CCSpriteWithHue::initWithTexture @ 0x3f30bc\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:47:15 +0000\n; \nPUSH.W          {R0-R8,LR}                                             ; +0x0, 0x3f2f40\nMOV             R5, R0                                                 ; +0x4, 0x3f2f44\nLDR             R7, =(__stack_chk_guard_ptr - 0x3F2F4E)                ; +0x6, 0x3f2f46\nMOV             R6, SP                                                 ; +0x8, 0x3f2f48\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xa, 0x3f2f4a\nLDR             R7, [R7]; __stack_chk_guard                            ; +0xc, 0x3f2f4c\nLDR             R3, [R7]                                               ; +0xe, 0x3f2f4e\nSTR             R3, [SP,#0x10+var_4]                                   ; +0x10, 0x3f2f50\nBL              _ZN7cocos2d13CCShaderCache17sharedShaderCacheEv; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x12, 0x3f2f52\nLDR             R3, [R5]                                               ; +0x16, 0x3f2f56\nMOV             R1, R5                                                 ; +0x18, 0x3f2f58\nLDR.W           R3, [R3,#0x26C]                                        ; +0x1a, 0x3f2f5a\nMOV             R4, R0                                                 ; +0x1e, 0x3f2f5e\nMOV             R0, SP                                                 ; +0x20, 0x3f2f60\nBLX             R3                                                     ; +0x22, 0x3f2f62\nLDRB.W          R3, [SP,#0x10+var_10]                                  ; +0x24, 0x3f2f64\nMOV             R0, R4; this                                           ; +0x28, 0x3f2f68\nLSLS            R2, R3, #0x1F                                          ; +0x2a, 0x3f2f6a\nITE PL                                                                 ; +0x2c, 0x3f2f6c\nADDPL.W         R1, SP, #0x10+var_F                                    ; +0x2e, 0x3f2f6e\nLDRMI           R1, [SP,#0x10+var_8]; char *                           ; +0x32, 0x3f2f72\nBL              _ZN7cocos2d13CCShaderCache13programForKeyEPKc; cocos2d::CCShaderCache::programForKey(char const*) ; +0x34, 0x3f2f74\nMOV             R4, R0                                                 ; +0x38, 0x3f2f78\nMOV             R0, SP                                                 ; +0x3a, 0x3f2f7a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x3c, 0x3f2f7c\nCMP             R4, #0                                                 ; +0x40, 0x3f2f80\nBNE             loc_3F3012                                             ; +0x42, 0x3f2f82\nMOVS            R0, #0x68 ; 'h'; unsigned int                          ; +0x44, 0x3f2f84\nBL              _Znwj; operator new(uint)                              ; +0x46, 0x3f2f86\nMOV             R4, R0                                                 ; +0x4a, 0x3f2f8a\nBL              _ZN7cocos2d11CCGLProgramC1Ev; cocos2d::CCGLProgram::CCGLProgram(void) ; +0x4c, 0x3f2f8c\nLDR             R3, =(_ZN7cocos2d27ccPositionTextureColor_vertE_ptr - 0x3F2F98) ; +0x50, 0x3f2f90\nMOV             R0, R5                                                 ; +0x52, 0x3f2f92\nADD             R3, PC; _ZN7cocos2d27ccPositionTextureColor_vertE_ptr  ; +0x54, 0x3f2f94\nLDR             R3, [R3]; cocos2d::ccPositionTextureColor_vert ...     ; +0x56, 0x3f2f96\nLDR.W           R8, [R3]; \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\nattribute v\"... ; +0x58, 0x3f2f98\nLDR             R3, [R5]                                               ; +0x5c, 0x3f2f9c\nLDR.W           R3, [R3,#0x270]                                        ; +0x5e, 0x3f2f9e\nBLX             R3                                                     ; +0x62, 0x3f2fa2\nMOV             R1, R8; char *                                         ; +0x64, 0x3f2fa4\nMOV             R2, R0; char *                                         ; +0x66, 0x3f2fa6\nMOV             R0, R4; this                                           ; +0x68, 0x3f2fa8\nBL              _ZN7cocos2d11CCGLProgram29initWithVertexShaderByteArrayEPKcS2_; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const*,char const*) ; +0x6a, 0x3f2faa\nLDR             R1, =(aAPosition - 0x3F2FB8); \"a_position\"             ; +0x6e, 0x3f2fae\nMOV             R0, R4; this                                           ; +0x70, 0x3f2fb0\nMOVS            R2, #0; unsigned int                                   ; +0x72, 0x3f2fb2\nADD             R1, PC; \"a_position\"                                   ; +0x74, 0x3f2fb4\nBL              _ZN7cocos2d11CCGLProgram12addAttributeEPKcj; cocos2d::CCGLProgram::addAttribute(char const*,uint) ; +0x76, 0x3f2fb6\nLDR             R1, =(aAColor - 0x3F2FC4); \"a_color\"                   ; +0x7a, 0x3f2fba\nMOV             R0, R4; this                                           ; +0x7c, 0x3f2fbc\nMOVS            R2, #1; unsigned int                                   ; +0x7e, 0x3f2fbe\nADD             R1, PC; \"a_color\"                                      ; +0x80, 0x3f2fc0\nBL              _ZN7cocos2d11CCGLProgram12addAttributeEPKcj; cocos2d::CCGLProgram::addAttribute(char const*,uint) ; +0x82, 0x3f2fc2\nLDR             R1, =(aATexcoord - 0x3F2FD0); \"a_texCoord\"             ; +0x86, 0x3f2fc6\nMOVS            R2, #2; unsigned int                                   ; +0x88, 0x3f2fc8\nMOV             R0, R4; this                                           ; +0x8a, 0x3f2fca\nADD             R1, PC; \"a_texCoord\"                                   ; +0x8c, 0x3f2fcc\nBL              _ZN7cocos2d11CCGLProgram12addAttributeEPKcj; cocos2d::CCGLProgram::addAttribute(char const*,uint) ; +0x8e, 0x3f2fce\nMOV             R0, R4; this                                           ; +0x92, 0x3f2fd2\nBL              _ZN7cocos2d11CCGLProgram4linkEv; cocos2d::CCGLProgram::link(void) ; +0x94, 0x3f2fd4\nMOV             R0, R4; this                                           ; +0x98, 0x3f2fd8\nBL              _ZN7cocos2d11CCGLProgram14updateUniformsEv; cocos2d::CCGLProgram::updateUniforms(void) ; +0x9a, 0x3f2fda\nBL              _ZN7cocos2d13CCShaderCache17sharedShaderCacheEv; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x9e, 0x3f2fde\nLDR             R3, [R5]                                               ; +0xa2, 0x3f2fe2\nMOV             R1, R5                                                 ; +0xa4, 0x3f2fe4\nLDR.W           R3, [R3,#0x26C]                                        ; +0xa6, 0x3f2fe6\nMOV             R8, R0                                                 ; +0xaa, 0x3f2fea\nMOV             R0, SP                                                 ; +0xac, 0x3f2fec\nBLX             R3                                                     ; +0xae, 0x3f2fee\nLDRB.W          R3, [SP,#0x10+var_10]                                  ; +0xb0, 0x3f2ff0\nMOV             R0, R8; this                                           ; +0xb4, 0x3f2ff4\nMOV             R1, R4; cocos2d::CCGLProgram *                         ; +0xb6, 0x3f2ff6\nLSLS            R3, R3, #0x1F                                          ; +0xb8, 0x3f2ff8\nITE PL                                                                 ; +0xba, 0x3f2ffa\nADDPL.W         R2, SP, #0x10+var_F                                    ; +0xbc, 0x3f2ffc\nLDRMI           R2, [SP,#0x10+var_8]; char *                           ; +0xc0, 0x3f3000\nBL              _ZN7cocos2d13CCShaderCache10addProgramEPNS_11CCGLProgramEPKc; cocos2d::CCShaderCache::addProgram(cocos2d::CCGLProgram *,char const*) ; +0xc2, 0x3f3002\nMOV             R0, SP                                                 ; +0xc6, 0x3f3006\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xc8, 0x3f3008\nMOV             R0, R4; this                                           ; +0xcc, 0x3f300c\nBL              _ZN7cocos2d8CCObject7releaseEv; cocos2d::CCObject::release(void) ; +0xce, 0x3f300e\nLDR             R3, [R5]                                               ; +0xd2, 0x3f3012\nMOV             R1, R4                                                 ; +0xd4, 0x3f3014\nMOV             R0, R5                                                 ; +0xd6, 0x3f3016\nLDR.W           R3, [R3,#0x14C]                                        ; +0xd8, 0x3f3018\nBLX             R3                                                     ; +0xdc, 0x3f301c\nMOV             R0, R5; this                                           ; +0xde, 0x3f301e\nBL              _ZN15CCSpriteWithHue19getUniformLocationsEv; CCSpriteWithHue::getUniformLocations(void) ; +0xe0, 0x3f3020\nLDR             R3, [R5]                                               ; +0xe4, 0x3f3024\nMOV             R0, R5                                                 ; +0xe6, 0x3f3026\nLDR.W           R3, [R3,#0x274]                                        ; +0xe8, 0x3f3028\nBLX             R3                                                     ; +0xec, 0x3f302c\nLDR             R2, [SP,#0x10+var_4]                                   ; +0xee, 0x3f302e\nLDR             R3, [R7]                                               ; +0xf0, 0x3f3030\nCMP             R2, R3                                                 ; +0xf2, 0x3f3032\nBEQ             loc_3F304E                                             ; +0xf4, 0x3f3034\nBLX             __stack_chk_fail                                       ; +0xf6, 0x3f3036\nB               loc_3F3046                                             ; +0xfa, 0x3f303a\nMOV             R0, R4; void *                                         ; +0xfc, 0x3f303c\nBL              _ZdlPv; operator delete(void *)                        ; +0xfe, 0x3f303e\nBL              __cxa_end_cleanup                                      ; +0x102, 0x3f3042\nMOV             R0, R6                                                 ; +0x106, 0x3f3046\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x108, 0x3f3048\nB               loc_3F3042                                             ; +0x10c, 0x3f304c\nADD             SP, SP, #0x10                                          ; +0x10e, 0x3f304e\nPOP.W           {R4-R8,PC}                                             ; +0x110, 0x3f3050", "xrefs": ["CCSpriteWithHue::initWithTexture @ 0x3f30bc"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}