{"type": "func", "start": 6443009360, "end": 6443009788, "name": "cocos2d::CCShaderCache::loadDefaultShader", "pseudocode": "// \n// cocos2d::CCShaderCache::loadDefaultShader from 0x180088550 to 0x1800886fc (428 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b5910\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\nvoid __fastcall cocos2d::CCShaderCache::loadDefaultShader(\n        cocos2d::CCShaderCache *this,\n        struct cocos2d::CCGLProgram *a2,\n        int a3)\n{\n  const char *v4; // r8\n  unsigned int v5; // r8d\n  const char *v6; // rdx\n  const char *v7; // rdx\n  unsigned int v8; // r8d\n  const char *v9; // r8\n  const char *v10; // rdx\n  unsigned int v11; // r8d\n  const char *v12; // rdx\n  const char *v13; // rdx\n\n  switch ( a3 )\n  {\n    case 0:\n      v4 = cocos2d::ccPositionTextureColor_frag;\n      goto LABEL_13;\n    case 1:\n      v4 = cocos2d::ccPositionTextureColorAlphaTest_frag;\n      goto LABEL_13;\n    case 2:\n      cocos2d::CCGLProgram::initWithVertexShaderByteArray(\n        a2,\n        cocos2d::ccPositionColor_vert,\n        cocos2d::ccPositionColor_frag);\n      v5 = 0;\n      v6 = \"a_position\";\n      goto LABEL_5;\n    case 3:\n      v9 = cocos2d::ccPositionTexture_frag;\n      v10 = cocos2d::ccPositionTexture_vert;\n      goto LABEL_7;\n    case 4:\n      v9 = cocos2d::ccPositionTexture_uColor_frag;\n      v10 = cocos2d::ccPositionTexture_uColor_vert;\nLABEL_7:\n      cocos2d::CCGLProgram::initWithVertexShaderByteArray(a2, v10, v9);\n      v11 = 0;\n      v12 = \"a_position\";\n      goto LABEL_15;\n    case 5:\n      v4 = cocos2d::ccPositionTextureA8Color_frag;\n      v13 = cocos2d::ccPositionTextureA8Color_vert;\n      goto LABEL_14;\n    case 6:\n      cocos2d::CCGLProgram::initWithVertexShaderByteArray(\n        a2,\n        cocos2d::ccPosition_uColor_vert,\n        cocos2d::ccPosition_uColor_frag);\n      v7 = \"aVertex\";\n      v8 = 0;\n      goto LABEL_16;\n    case 7:\n      cocos2d::CCGLProgram::initWithVertexShaderByteArray(\n        a2,\n        cocos2d::ccPositionColorLengthTexture_vert,\n        cocos2d::ccPositionColorLengthTexture_frag);\n      cocos2d::CCGLProgram::addAttribute(a2, \"a_position\", 0);\n      v5 = 2;\n      v6 = \"a_texCoord\";\nLABEL_5:\n      cocos2d::CCGLProgram::addAttribute(a2, v6, v5);\n      v7 = \"a_color\";\n      v8 = 1;\n      goto LABEL_16;\n    case 8:\n      v4 = cocos2d::ccExSwitchMask_frag;\nLABEL_13:\n      v13 = cocos2d::ccPositionTextureColor_vert;\nLABEL_14:\n      cocos2d::CCGLProgram::initWithVertexShaderByteArray(a2, v13, v4);\n      cocos2d::CCGLProgram::addAttribute(a2, \"a_position\", 0);\n      v12 = \"a_color\";\n      v11 = 1;\nLABEL_15:\n      cocos2d::CCGLProgram::addAttribute(a2, v12, v11);\n      v8 = 2;\n      v7 = \"a_texCoord\";\nLABEL_16:\n      cocos2d::CCGLProgram::addAttribute(a2, v7, v8);\n      cocos2d::CCGLProgram::link(a2);\n      cocos2d::CCGLProgram::updateUniforms(a2);\n      break;\n    default:\n      return;\n  }\n}", "assembly": "; \n; cocos2d::CCShaderCache::loadDefaultShader from 0x180088550 to 0x1800886fc (428 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b5910\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\ncmp     r8d, 8; switch 9 cases                                         ; +0x0, 0x180088550\nja      def_180088576; jumptable 0000000180088576 default case         ; +0x4, 0x180088554\npush    rbx                                                            ; +0xa, 0x18008855a\nsub     rsp, 20h                                                       ; +0xb, 0x18008855b\nmovsxd  rax, r8d                                                       ; +0xf, 0x18008855f\nmov     rbx, rdx                                                       ; +0x12, 0x180088562\nlea     rdx, cs:180000000h                                             ; +0x15, 0x180088565\nmov     ecx, ds:(jpt_180088576 - 180000000h)[rdx+rax*4]                ; +0x1c, 0x18008856c\nadd     rcx, rdx                                                       ; +0x23, 0x180088573\njmp     rcx; switch jump                                               ; +0x26, 0x180088576\nmov     r8, cs:?ccPositionTextureColor_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 0 ; +0x28, 0x180088578\njmp     loc_180088675                                                  ; +0x2f, 0x18008857f\nmov     r8, cs:?ccPositionTextureColorAlphaTest_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 1 ; +0x34, 0x180088584\njmp     loc_180088675                                                  ; +0x3b, 0x18008858b\nmov     r8, cs:?ccPositionColor_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 2 ; +0x40, 0x180088590\nmov     rcx, rbx; this                                                 ; +0x47, 0x180088597\nmov     rdx, cs:?ccPositionColor_vert@cocos2d@@3PEBDEB; char *         ; +0x4a, 0x18008859a\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0x51, 0x1800885a1\nxor     r8d, r8d; unsigned int                                         ; +0x56, 0x1800885a6\nlea     rdx, aAPosition; \"a_position\"                                  ; +0x59, 0x1800885a9\nmov     rcx, rbx; this                                                 ; +0x60, 0x1800885b0\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x63, 0x1800885b3\nlea     rdx, aAColor; \"a_color\"                                        ; +0x68, 0x1800885b8\nmov     r8d, 1                                                         ; +0x6f, 0x1800885bf\njmp     loc_1800886B8                                                  ; +0x75, 0x1800885c5\nmov     r8, cs:?ccPositionTexture_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 3 ; +0x7a, 0x1800885ca\nmov     rdx, cs:?ccPositionTexture_vert@cocos2d@@3PEBDEB; char *       ; +0x81, 0x1800885d1\nmov     rcx, rbx; this                                                 ; +0x88, 0x1800885d8\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0x8b, 0x1800885db\nxor     r8d, r8d                                                       ; +0x90, 0x1800885e0\nlea     rdx, aAPosition; \"a_position\"                                  ; +0x93, 0x1800885e3\njmp     loc_1800886A3                                                  ; +0x9a, 0x1800885ea\nmov     r8, cs:?ccPositionTexture_uColor_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 4 ; +0x9f, 0x1800885ef\nmov     rdx, cs:?ccPositionTexture_uColor_vert@cocos2d@@3PEBDEB; char const * const cocos2d::ccPositionTexture_uColor_vert ; +0xa6, 0x1800885f6\njmp     short loc_1800885D8                                            ; +0xad, 0x1800885fd\nmov     r8, cs:?ccPositionTextureA8Color_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 5 ; +0xaf, 0x1800885ff\nmov     rdx, cs:?ccPositionTextureA8Color_vert@cocos2d@@3PEBDEB; char const * const cocos2d::ccPositionTextureA8Color_vert ; +0xb6, 0x180088606\njmp     short loc_18008867C                                            ; +0xbd, 0x18008860d\nmov     r8, cs:?ccPosition_uColor_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 6 ; +0xbf, 0x18008860f\nmov     rcx, rbx; this                                                 ; +0xc6, 0x180088616\nmov     rdx, cs:?ccPosition_uColor_vert@cocos2d@@3PEBDEB; char *       ; +0xc9, 0x180088619\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0xd0, 0x180088620\nlea     rdx, aAvertex; \"aVertex\"                                       ; +0xd5, 0x180088625\nxor     r8d, r8d                                                       ; +0xdc, 0x18008862c\njmp     loc_1800886B8                                                  ; +0xdf, 0x18008862f\nmov     r8, cs:?ccPositionColorLengthTexture_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 7 ; +0xe4, 0x180088634\nmov     rcx, rbx; this                                                 ; +0xeb, 0x18008863b\nmov     rdx, cs:?ccPositionColorLengthTexture_vert@cocos2d@@3PEBDEB; char * ; +0xee, 0x18008863e\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0xf5, 0x180088645\nxor     r8d, r8d; unsigned int                                         ; +0xfa, 0x18008864a\nlea     rdx, aAPosition; \"a_position\"                                  ; +0xfd, 0x18008864d\nmov     rcx, rbx; this                                                 ; +0x104, 0x180088654\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x107, 0x180088657\nmov     r8d, 2                                                         ; +0x10c, 0x18008865c\nlea     rdx, aATexcoord; \"a_texCoord\"                                  ; +0x112, 0x180088662\njmp     loc_1800885B0                                                  ; +0x119, 0x180088669\nmov     r8, cs:?ccExSwitchMask_frag@cocos2d@@3PEBDEB; jumptable 0000000180088576 case 8 ; +0x11e, 0x18008866e\nmov     rdx, cs:?ccPositionTextureColor_vert@cocos2d@@3PEBDEB; char *  ; +0x125, 0x180088675\nmov     rcx, rbx; this                                                 ; +0x12c, 0x18008867c\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0x12f, 0x18008867f\nxor     r8d, r8d; unsigned int                                         ; +0x134, 0x180088684\nlea     rdx, aAPosition; \"a_position\"                                  ; +0x137, 0x180088687\nmov     rcx, rbx; this                                                 ; +0x13e, 0x18008868e\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x141, 0x180088691\nlea     rdx, aAColor; \"a_color\"                                        ; +0x146, 0x180088696\nmov     r8d, 1; unsigned int                                           ; +0x14d, 0x18008869d\nmov     rcx, rbx; this                                                 ; +0x153, 0x1800886a3\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x156, 0x1800886a6\nmov     r8d, 2; unsigned int                                           ; +0x15b, 0x1800886ab\nlea     rdx, aATexcoord; \"a_texCoord\"                                  ; +0x161, 0x1800886b1\nmov     rcx, rbx; this                                                 ; +0x168, 0x1800886b8\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x16b, 0x1800886bb\nmov     rcx, rbx; this                                                 ; +0x170, 0x1800886c0\ncall    ?link@CCGLProgram@cocos2d@@QEAA_NXZ; cocos2d::CCGLProgram::link(void) ; +0x173, 0x1800886c3\nmov     rcx, rbx; this                                                 ; +0x178, 0x1800886c8\ncall    ?updateUniforms@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::updateUniforms(void) ; +0x17b, 0x1800886cb\nadd     rsp, 20h                                                       ; +0x180, 0x1800886d0\npop     rbx                                                            ; +0x184, 0x1800886d4\nretn; jumptable 0000000180088576 default case                          ; +0x185, 0x1800886d5\nalign 8                                                                ; +0x186, 0x1800886d6\ndd offset loc_180088578 - 180000000h; jump table for switch statement  ; +0x188, 0x1800886d8", "xrefs": ["<???> @ 0x1801438a8", "<???> @ 0x1801b5910"], "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"}