// // ShaderLayer::setupShader from 0x1003b3c20 to 0x1003b44e4 (2244 bytes) // // 2 xrefs: // > ShaderLayer::init @ 0x1003b3b85 // > ShaderLayer::update @ 0x1003b541c // // This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:29:27 +0000 // __int64 __fastcall ShaderLayer::setupShader(__int64 a1, char a2) { __int64 v4; // rdi __int64 v5; // rdi const char *v6; // rsi __int64 v7; // rdi __int64 v8; // rax void *v9; // r14 __int64 v10; // rax __int64 v11; // r15 _BYTE *v12; // r14 __int64 v13; // rax _QWORD *v14; // rsi __int64 v15; // rax __int64 v16; // rsi __m128 v17; // xmm1 __int64 v18; // rdi __int64 v19; // rax __int64 v20; // rdi __int64 v21; // rsi __int64 v22; // rdi __int64 v23; // rax char *v24; // r14 __int64 v25; // rax __int64 v26; // rax __int64 v27; // rax __int64 v28; // r14 __m128 v29; // xmm3 __m128 v30; // xmm2 __int64 v31; // rax unsigned __int8 GameVariable; // r14 __int64 v33; // rax __int64 v34; // rdi __int64 v35; // rax __int64 v36; // rax __int64 v37; // rax __int64 v38; // rax __int64 v39; // rax __int64 v40; // rax __int64 v41; // rax __int64 v42; // rax __int64 v43; // rax __int64 v44; // rax __int64 v45; // rax __int64 v46; // rax __int64 v47; // rax __int64 v48; // rax __int64 v49; // rax __int64 v50; // rax __int64 v51; // rax __int64 v52; // rax __int64 v53; // rax __int64 v54; // rax __int64 v55; // rax __int64 v56; // rax __int64 v57; // rax __int64 v58; // rax __int64 v59; // rax __int64 v60; // rax __int64 v61; // rax __int64 v62; // rax __int64 v63; // rax __m128 v65; // [rsp+0h] [rbp-40h] _QWORD v66[2]; // [rsp+10h] [rbp-30h] BYREF double v67[4]; // [rsp+20h] [rbp-20h] BYREF v4 = *(_QWORD *)(a1 + 1104); if ( v4 ) { (*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 536LL))(v4); *(_QWORD *)(a1 + 1104) = 0; } v5 = *(_QWORD *)(a1 + 1096); if ( v5 ) { cocos2d::CCObject::release(v5); *(_QWORD *)(a1 + 1096) = 0; } v6 = "custom_program"; v7 = cocos2d::CCShaderCache::sharedShaderCache(); v8 = cocos2d::CCShaderCache::programForKey(v7, "custom_program"); *(_QWORD *)(a1 + 1088) = v8; if ( v8 ) { if ( !a2 ) goto LABEL_10; cocos2d::CCGLProgram::reset(v8); } else { v9 = operator new(0x78u); cocos2d::CCGLProgram::CCGLProgram(v9); *(_QWORD *)(a1 + 1088) = v9; v10 = cocos2d::CCShaderCache::sharedShaderCache(); cocos2d::CCShaderCache::addProgram(v10, *(_QWORD *)(a1 + 1088), "custom_program"); cocos2d::CCObject::release(*(_QWORD *)(a1 + 1088)); } v11 = *(_QWORD *)(a1 + 1088); v12 = operator new(0x37C8u); memcpy(v12, aIfdefGlEsPreci_6, 0x37C4u); v12[14276] = 0; cocos2d::CCGLProgram::initWithVertexShaderByteArray( v11, "\t\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\tattribute vec4 a_position;\t\t\t\t\t\t\t\n" "\t\tattribute vec2 a_texCoord;\t\t\t\t\t\t\t\n" "\t\tattribute vec4 a_color;\t\t\t\t\t\t\t\t\n" "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\t#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\n" "\t\t\tvarying lowp vec4 v_fragmentColor;\t\t\t\t\n" "\t\t\tvarying mediump vec2 v_texCoord;\t\t\t\t\n" "\t\t#else\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\t\tvarying vec4 v_fragmentColor;\t\t\t\t\t\n" "\t\t\tvarying vec2 v_texCoord;\t\t\t\t\t\t\n" "\t\t#endif\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\tvoid main()\t\t\t\t\t\t\t\t\t\t\t\n" "\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\t\tgl_Position = CC_MVPMatrix * a_position;\t\t\n" "\t\t\tv_fragmentColor = a_color;\t\t\t\t\t\t\n" "\t\t\tv_texCoord = a_texCoord;\t\t\t\t\t\t\n" "\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n" "\t\t", v12); operator delete(v12); cocos2d::CCGLProgram::addAttribute(*(_QWORD *)(a1 + 1088), "a_position", 0); cocos2d::CCGLProgram::addAttribute(*(_QWORD *)(a1 + 1088), "a_color", 1); v6 = "a_texCoord"; cocos2d::CCGLProgram::addAttribute(*(_QWORD *)(a1 + 1088), "a_texCoord", 2); cocos2d::CCGLProgram::link(*(_QWORD *)(a1 + 1088)); v7 = *(_QWORD *)(a1 + 1088); cocos2d::CCGLProgram::updateUniforms(v7); *(_BYTE *)(GameManager::sharedState() + 1700) = 0; LABEL_10: v13 = cocos2d::CCDirector::sharedDirector(v7, v6); v14 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v13 + 192) + 48LL))(*(_QWORD *)(v13 + 192)); sub_100278630(v67, v14); v15 = cocos2d::CCDirector::sharedDirector(v67, v14); _mm_storel_ps( v67, _mm_mul_ps( _mm_moveldup_ps((__m128)*(unsigned int *)(*(_QWORD *)(v15 + 192) + 112LL)), (__m128)*(unsigned __int64 *)&v67[0])); sub_100278660((_QWORD *)(a1 + 1160), v67); v65 = (__m128)HIDWORD(v67[0]); v16 = cocos2d::CCDirector::sharedDirector(a1 + 1160, v67); cocos2d::CCDirector::getWinSize(v66, v16); v17 = (__m128)*(unsigned int *)(a1 + 1164); v17.f32[0] = v17.f32[0] / *(float *)(a1 + 1160); _mm_storel_ps( (double *)(a1 + 1152), _mm_div_ps(_mm_blend_ps(v65, (__m128)xmmword_100A03610, 14), _mm_insert_ps((__m128)HIDWORD(v66[0]), v17, 16))); v18 = cocos2d::CCDirector::sharedDirector(v66, v16); v65.i32[0] = sub_100479350(v18); v19 = cocos2d::CCDirector::sharedDirector(v18, v16); cocos2d::CCDirector::setContentScaleFactor(v19, 1.0); v20 = (unsigned int)(int)*(float *)v67; v21 = (unsigned int)(int)*((float *)v67 + 1); *(_QWORD *)(a1 + 1096) = cocos2d::CCRenderTexture::create_1(v20, v21, 0); v22 = cocos2d::CCDirector::sharedDirector(v20, v21); cocos2d::CCDirector::setContentScaleFactor(v22, v65.f32[0]); v23 = cocos2d::CCDirector::sharedDirector(v22, v21); *(float *)(a1 + 1148) = (float)(1.0 / sub_100479730(v23)) * *(float *)&dword_100BE35D8; sub_100278260((float *)v66, 0.0, 0.0); sub_100278660((_QWORD *)(a1 + 1184), v66); cocos2d::CCObject::retain(*(_QWORD *)(a1 + 1096)); v24 = cocos2d::CCSprite::create_2(); *(_QWORD *)(a1 + 1104) = v24; v25 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1096) + 896LL))(*(_QWORD *)(a1 + 1096)); v26 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v25 + 1072LL))(v25); (*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v24 + 1064LL))(v24, v26); v27 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 1072LL))(*(_QWORD *)(a1 + 1104)); (*(void (__fastcall **)(_QWORD *, __int64))(*(_QWORD *)v27 + 144LL))(v66, v27); sub_100278660((_QWORD *)(a1 + 1168), v66); sub_100278260((float *)v66, *(float *)v67, *((float *)v67 + 1)); sub_100278660((_QWORD *)(a1 + 1176), v66); v28 = *(_QWORD *)(a1 + 1104); v29 = (__m128)0x40000000u; v30 = (__m128)*(unsigned int *)(a1 + 1176); v30.f32[0] = v30.f32[0] + 2.0; v29.f32[0] = *(float *)(a1 + 1180) + 2.0; sub_100278270((__int64)v66, -1.0, -1.0, v30, v29); (*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v28 + 1136LL))(v28, v66); (*(void (__fastcall **)(_QWORD, _QWORD *))(**(_QWORD **)(a1 + 1104) + 184LL))( *(_QWORD *)(a1 + 1104), &qword_100BE35A8); (*(void (__fastcall **)(_QWORD, _QWORD *))(**(_QWORD **)(a1 + 1104) + 296LL))( *(_QWORD *)(a1 + 1104), &qword_100BE35A8); cocos2d::CCSprite::setFlipY(*(unsigned __int8 **)(a1 + 1104), 1u); (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 456LL))(a1, *(_QWORD *)(a1 + 1104)); v31 = GameManager::sharedState(); GameVariable = GameManager::getGameVariable(v31, "0155"); *(_BYTE *)(a1 + 1113) = GameVariable ^ 1; if ( *(_BYTE *)(a1 + 1112) != (GameVariable ^ 1) ) { *(_BYTE *)(a1 + 1112) = GameVariable ^ 1; v33 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1096) + 896LL))(*(_QWORD *)(a1 + 1096)); v34 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v33 + 1072LL))(v33); if ( GameVariable ) cocos2d::CCTexture2D::setAliasTexParameters(v34); else cocos2d::CCTexture2D::setAntiAliasTexParameters(v34); } (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 1104) + 664LL))( *(_QWORD *)(a1 + 1104), *(_QWORD *)(a1 + 1088)); sub_1003B45D0(a1); sub_1003B4760(a1); sub_1003B4930(a1); v35 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1388) = glGetUniformLocation(*(_DWORD *)(v35 + 56), "_glitchBot"); v36 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1392) = glGetUniformLocation(*(_DWORD *)(v36 + 56), "_glitchTop"); v37 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1396) = glGetUniformLocation(*(_DWORD *)(v37 + 56), "_glitchXOffset"); v38 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1400) = glGetUniformLocation(*(_DWORD *)(v38 + 56), "_glitchColOffset"); v39 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1404) = glGetUniformLocation(*(_DWORD *)(v39 + 56), "_glitchRnd"); v40 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1408) = glGetUniformLocation(*(_DWORD *)(v40 + 56), "_chromaticXOff"); v41 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1412) = glGetUniformLocation(*(_DWORD *)(v41 + 56), "_chromaticYOff"); sub_1003B4C30(a1); ShaderLayer::setupLensCircleShader(a1); v42 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1468) = glGetUniformLocation(*(_DWORD *)(v42 + 56), "_radialBlurCenter"); v43 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1472) = glGetUniformLocation(*(_DWORD *)(v43 + 56), "_radialBlurValue"); v44 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1492) = glGetUniformLocation(*(_DWORD *)(v44 + 56), "_bulgeValue"); v45 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1496) = glGetUniformLocation(*(_DWORD *)(v45 + 56), "_bulgeValue2"); v46 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1500) = glGetUniformLocation(*(_DWORD *)(v46 + 56), "_bulgeOrigin"); v47 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1504) = glGetUniformLocation(*(_DWORD *)(v47 + 56), "_bulgeRadius"); v48 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1508) = glGetUniformLocation(*(_DWORD *)(v48 + 56), "_pinchValue"); v49 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1512) = glGetUniformLocation(*(_DWORD *)(v49 + 56), "_pinchCenterPos"); v50 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1516) = glGetUniformLocation(*(_DWORD *)(v50 + 56), "_pinchCalc1"); v51 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1520) = glGetUniformLocation(*(_DWORD *)(v51 + 56), "_pinchRadius"); v52 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1480) = glGetUniformLocation(*(_DWORD *)(v52 + 56), "_motionBlurValue"); v53 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1484) = glGetUniformLocation(*(_DWORD *)(v53 + 56), "_motionBlurMult"); v54 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1488) = glGetUniformLocation(*(_DWORD *)(v54 + 56), "_motionBlurDual"); v55 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1524) = glGetUniformLocation(*(_DWORD *)(v55 + 56), "_grayscaleValue"); v56 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1528) = glGetUniformLocation(*(_DWORD *)(v56 + 56), "_grayscaleTint"); v57 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1532) = glGetUniformLocation(*(_DWORD *)(v57 + 56), "_grayscaleUseLum"); v58 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1536) = glGetUniformLocation(*(_DWORD *)(v58 + 56), "_sepiaValue"); v59 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1540) = glGetUniformLocation(*(_DWORD *)(v59 + 56), "_invertColorValue"); v60 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1544) = glGetUniformLocation(*(_DWORD *)(v60 + 56), "_hueShiftCosA"); v61 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1548) = glGetUniformLocation(*(_DWORD *)(v61 + 56), "_hueShiftSinA"); v62 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1552) = glGetUniformLocation(*(_DWORD *)(v62 + 56), "_colorChangeC"); v63 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1104) + 656LL))(*(_QWORD *)(a1 + 1104)); *(_DWORD *)(a1 + 1556) = glGetUniformLocation(*(_DWORD *)(v63 + 56), "_colorChangeB"); return sub_1003B5240(a1); }
GD Web Decomp Icon

GD Web Decomp

Raw Source