{"type": "func", "start": 6443022128, "end": 6443022556, "name": "cocos2d::CCShaderCache::loadDefaultShader", "pseudocode": "// \n// cocos2d::CCShaderCache::loadDefaultShader from 0x18008b730 to 0x18008b8dc (428 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801bfbe0\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:22:06 +0000\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 0x18008b730 to 0x18008b8dc (428 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801bfbe0\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:22:06 +0000\n; \ncmp     r8d, 8; switch 9 cases                                         ; +0x0, 0x18008b730\nja      def_18008B756; jumptable 000000018008B756 default case         ; +0x4, 0x18008b734\npush    rbx                                                            ; +0xa, 0x18008b73a\nsub     rsp, 20h                                                       ; +0xb, 0x18008b73b\nmovsxd  rax, r8d                                                       ; +0xf, 0x18008b73f\nmov     rbx, rdx                                                       ; +0x12, 0x18008b742\nlea     rdx, cs:180000000h                                             ; +0x15, 0x18008b745\nmov     ecx, ds:(jpt_18008B756 - 180000000h)[rdx+rax*4]                ; +0x1c, 0x18008b74c\nadd     rcx, rdx                                                       ; +0x23, 0x18008b753\njmp     rcx; switch jump                                               ; +0x26, 0x18008b756\nmov     r8, cs:?ccPositionTextureColor_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 0 ; +0x28, 0x18008b758\njmp     loc_18008B855                                                  ; +0x2f, 0x18008b75f\nmov     r8, cs:?ccPositionTextureColorAlphaTest_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 1 ; +0x34, 0x18008b764\njmp     loc_18008B855                                                  ; +0x3b, 0x18008b76b\nmov     r8, cs:?ccPositionColor_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 2 ; +0x40, 0x18008b770\nmov     rcx, rbx; this                                                 ; +0x47, 0x18008b777\nmov     rdx, cs:?ccPositionColor_vert@cocos2d@@3PEBDEB; char *         ; +0x4a, 0x18008b77a\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0x51, 0x18008b781\nxor     r8d, r8d; unsigned int                                         ; +0x56, 0x18008b786\nlea     rdx, aAPosition; \"a_position\"                                  ; +0x59, 0x18008b789\nmov     rcx, rbx; this                                                 ; +0x60, 0x18008b790\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x63, 0x18008b793\nlea     rdx, aAColor; \"a_color\"                                        ; +0x68, 0x18008b798\nmov     r8d, 1                                                         ; +0x6f, 0x18008b79f\njmp     loc_18008B898                                                  ; +0x75, 0x18008b7a5\nmov     r8, cs:?ccPositionTexture_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 3 ; +0x7a, 0x18008b7aa\nmov     rdx, cs:?ccPositionTexture_vert@cocos2d@@3PEBDEB; char *       ; +0x81, 0x18008b7b1\nmov     rcx, rbx; this                                                 ; +0x88, 0x18008b7b8\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0x8b, 0x18008b7bb\nxor     r8d, r8d                                                       ; +0x90, 0x18008b7c0\nlea     rdx, aAPosition; \"a_position\"                                  ; +0x93, 0x18008b7c3\njmp     loc_18008B883                                                  ; +0x9a, 0x18008b7ca\nmov     r8, cs:?ccPositionTexture_uColor_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 4 ; +0x9f, 0x18008b7cf\nmov     rdx, cs:?ccPositionTexture_uColor_vert@cocos2d@@3PEBDEB; char const * const cocos2d::ccPositionTexture_uColor_vert ; +0xa6, 0x18008b7d6\njmp     short loc_18008B7B8                                            ; +0xad, 0x18008b7dd\nmov     r8, cs:?ccPositionTextureA8Color_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 5 ; +0xaf, 0x18008b7df\nmov     rdx, cs:?ccPositionTextureA8Color_vert@cocos2d@@3PEBDEB; char const * const cocos2d::ccPositionTextureA8Color_vert ; +0xb6, 0x18008b7e6\njmp     short loc_18008B85C                                            ; +0xbd, 0x18008b7ed\nmov     r8, cs:?ccPosition_uColor_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 6 ; +0xbf, 0x18008b7ef\nmov     rcx, rbx; this                                                 ; +0xc6, 0x18008b7f6\nmov     rdx, cs:?ccPosition_uColor_vert@cocos2d@@3PEBDEB; char *       ; +0xc9, 0x18008b7f9\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0xd0, 0x18008b800\nlea     rdx, aAvertex; \"aVertex\"                                       ; +0xd5, 0x18008b805\nxor     r8d, r8d                                                       ; +0xdc, 0x18008b80c\njmp     loc_18008B898                                                  ; +0xdf, 0x18008b80f\nmov     r8, cs:?ccPositionColorLengthTexture_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 7 ; +0xe4, 0x18008b814\nmov     rcx, rbx; this                                                 ; +0xeb, 0x18008b81b\nmov     rdx, cs:?ccPositionColorLengthTexture_vert@cocos2d@@3PEBDEB; char * ; +0xee, 0x18008b81e\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0xf5, 0x18008b825\nxor     r8d, r8d; unsigned int                                         ; +0xfa, 0x18008b82a\nlea     rdx, aAPosition; \"a_position\"                                  ; +0xfd, 0x18008b82d\nmov     rcx, rbx; this                                                 ; +0x104, 0x18008b834\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x107, 0x18008b837\nmov     r8d, 2                                                         ; +0x10c, 0x18008b83c\nlea     rdx, aATexcoord; \"a_texCoord\"                                  ; +0x112, 0x18008b842\njmp     loc_18008B790                                                  ; +0x119, 0x18008b849\nmov     r8, cs:?ccExSwitchMask_frag@cocos2d@@3PEBDEB; jumptable 000000018008B756 case 8 ; +0x11e, 0x18008b84e\nmov     rdx, cs:?ccPositionTextureColor_vert@cocos2d@@3PEBDEB; char *  ; +0x125, 0x18008b855\nmov     rcx, rbx; this                                                 ; +0x12c, 0x18008b85c\ncall    ?initWithVertexShaderByteArray@CCGLProgram@cocos2d@@QEAA_NPEBD0@Z; cocos2d::CCGLProgram::initWithVertexShaderByteArray(char const *,char const *) ; +0x12f, 0x18008b85f\nxor     r8d, r8d; unsigned int                                         ; +0x134, 0x18008b864\nlea     rdx, aAPosition; \"a_position\"                                  ; +0x137, 0x18008b867\nmov     rcx, rbx; this                                                 ; +0x13e, 0x18008b86e\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x141, 0x18008b871\nlea     rdx, aAColor; \"a_color\"                                        ; +0x146, 0x18008b876\nmov     r8d, 1; unsigned int                                           ; +0x14d, 0x18008b87d\nmov     rcx, rbx; this                                                 ; +0x153, 0x18008b883\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x156, 0x18008b886\nmov     r8d, 2; unsigned int                                           ; +0x15b, 0x18008b88b\nlea     rdx, aATexcoord; \"a_texCoord\"                                  ; +0x161, 0x18008b891\nmov     rcx, rbx; this                                                 ; +0x168, 0x18008b898\ncall    ?addAttribute@CCGLProgram@cocos2d@@QEAAXPEBDI@Z; cocos2d::CCGLProgram::addAttribute(char const *,uint) ; +0x16b, 0x18008b89b\nmov     rcx, rbx; this                                                 ; +0x170, 0x18008b8a0\ncall    ?link@CCGLProgram@cocos2d@@QEAA_NXZ; cocos2d::CCGLProgram::link(void) ; +0x173, 0x18008b8a3\nmov     rcx, rbx; this                                                 ; +0x178, 0x18008b8a8\ncall    ?updateUniforms@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::updateUniforms(void) ; +0x17b, 0x18008b8ab\nadd     rsp, 20h                                                       ; +0x180, 0x18008b8b0\npop     rbx                                                            ; +0x184, 0x18008b8b4\nretn; jumptable 000000018008B756 default case                          ; +0x185, 0x18008b8b5\nalign 8                                                                ; +0x186, 0x18008b8b6\ndd offset loc_18008B758 - 180000000h; jump table for switch statement  ; +0x188, 0x18008b8b8", "xrefs": ["<???> @ 0x18014cf68", "<???> @ 0x1801bfbe0"], "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"}