{"type": "func", "start": 4302060064, "end": 4302060485, "name": "CCSpriteWithHue::draw", "pseudocode": "// \n// CCSpriteWithHue::draw from 0x1006c3a20 to 0x1006c3bc5 (421 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x100b8d8d8\n// > <???> @ 0x100b8dea0\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 12:35:33 +0000\n// \n\nint *__fastcall CCSpriteWithHue::draw(__int64 a1, __m128 a2)\n{\n  __int64 v3; // rax\n  __int64 v4; // rax\n  GLuint v5; // eax\n  __int64 v6; // rax\n  __int64 v7; // rax\n  __int64 v8; // rax\n  int *result; // rax\n\n  if ( !*(_BYTE *)(a1 + 559) )\n  {\n    if ( *(_BYTE *)(a1 + 329) )\n    {\n      cocos2d::ccGLEnable();\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 656LL))(a1);\n      v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 656LL))(a1);\n      cocos2d::CCGLProgram::use(v3);\n      v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 656LL))(a1);\n      cocos2d::CCGLProgram::setUniformsForBuiltins(v4, a2);\n      cocos2d::ccGLBlendFunc(*(_DWORD *)(a1 + 404), *(_DWORD *)(a1 + 408));\n      v5 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 104LL))(*(_QWORD *)(a1 + 416));\n      cocos2d::ccGLBindTexture2D(v5);\n      cocos2d::ccGLEnableVertexAttribs(7);\n      v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 656LL))(a1);\n      cocos2d::CCGLProgram::setUniformLocationWithMatrix3fv(v6, *(_DWORD *)(a1 + 648), (const GLfloat *)(a1 + 612), 1);\n      v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 656LL))(a1);\n      cocos2d::CCGLProgram::setUniformLocationWith1f(\n        v7,\n        *(_DWORD *)(a1 + 652),\n        (float)*(unsigned __int8 *)(a1 + 328) / 255.0);\n      v8 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 656LL))(a1);\n      cocos2d::CCGLProgram::setUniformLocationWith3f(\n        v8,\n        *(_DWORD *)(a1 + 656),\n        *(GLfloat *)(a1 + 600),\n        *(GLfloat *)(a1 + 604),\n        *(GLfloat *)(a1 + 608));\n      glVertexAttribPointer(0, 3, 0x1406u, 0, 24, (const GLvoid *)(a1 + 460));\n      glVertexAttribPointer(2u, 2, 0x1406u, 0, 24, (const GLvoid *)(a1 + 476));\n      glVertexAttribPointer(1u, 4, 0x1401u, 1u, 24, (const GLvoid *)(a1 + 472));\n      glDrawArrays(5u, 0, 4);\n      ++dword_100BE8BE8;\n      return &dword_100BE8BE8;\n    }\n  }\n  return result;\n}", "assembly": "; \n; CCSpriteWithHue::draw from 0x1006c3a20 to 0x1006c3bc5 (421 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x100b8d8d8\n; > <???> @ 0x100b8dea0\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 12:35:33 +0000\n; \ncmp     byte ptr [rdi+22Fh], 0                                         ; +0x0, 0x1006c3a20\njnz     locret_1006C3BC4                                               ; +0x7, 0x1006c3a27\ncmp     byte ptr [rdi+149h], 0                                         ; +0xd, 0x1006c3a2d\njz      locret_1006C3BC4                                               ; +0x14, 0x1006c3a34\npush    rbp                                                            ; +0x1a, 0x1006c3a3a\nmov     rbp, rsp                                                       ; +0x1b, 0x1006c3a3b\npush    rbx                                                            ; +0x1e, 0x1006c3a3e\npush    rax                                                            ; +0x1f, 0x1006c3a3f\nmov     eax, [rdi+0F8h]                                                ; +0x20, 0x1006c3a40\nmov     rbx, rdi                                                       ; +0x26, 0x1006c3a46\nmov     edi, eax                                                       ; +0x29, 0x1006c3a49\ncall    cocos2d__ccGLEnable                                            ; +0x2b, 0x1006c3a4b\nmov     rax, [rbx]                                                     ; +0x30, 0x1006c3a50\nmov     rdi, rbx                                                       ; +0x33, 0x1006c3a53\ncall    qword ptr [rax+290h]                                           ; +0x36, 0x1006c3a56\nmov     rax, [rbx]                                                     ; +0x3c, 0x1006c3a5c\nmov     rdi, rbx                                                       ; +0x3f, 0x1006c3a5f\ncall    qword ptr [rax+290h]                                           ; +0x42, 0x1006c3a62\nmov     rdi, rax                                                       ; +0x48, 0x1006c3a68\ncall    cocos2d__CCGLProgram__use                                      ; +0x4b, 0x1006c3a6b\nmov     rax, [rbx]                                                     ; +0x50, 0x1006c3a70\nmov     rdi, rbx                                                       ; +0x53, 0x1006c3a73\ncall    qword ptr [rax+290h]                                           ; +0x56, 0x1006c3a76\nmov     rdi, rax                                                       ; +0x5c, 0x1006c3a7c\ncall    cocos2d__CCGLProgram__setUniformsForBuiltins                   ; +0x5f, 0x1006c3a7f\nmov     edi, [rbx+194h]; sfactor                                       ; +0x64, 0x1006c3a84\nmov     esi, [rbx+198h]; dfactor                                       ; +0x6a, 0x1006c3a8a\ncall    cocos2d__ccGLBlendFunc                                         ; +0x70, 0x1006c3a90\nmov     rdi, [rbx+1A0h]                                                ; +0x75, 0x1006c3a95\nmov     rax, [rdi]                                                     ; +0x7c, 0x1006c3a9c\ncall    qword ptr [rax+68h]                                            ; +0x7f, 0x1006c3a9f\nmov     edi, eax; texture                                              ; +0x82, 0x1006c3aa2\ncall    cocos2d__ccGLBindTexture2D                                     ; +0x84, 0x1006c3aa4\nmov     edi, 7                                                         ; +0x89, 0x1006c3aa9\ncall    cocos2d__ccGLEnableVertexAttribs                               ; +0x8e, 0x1006c3aae\nmov     rax, [rbx]                                                     ; +0x93, 0x1006c3ab3\nmov     rdi, rbx                                                       ; +0x96, 0x1006c3ab6\ncall    qword ptr [rax+290h]                                           ; +0x99, 0x1006c3ab9\nmov     esi, [rbx+288h]                                                ; +0x9f, 0x1006c3abf\nlea     rdx, [rbx+264h]                                                ; +0xa5, 0x1006c3ac5\nmov     rdi, rax                                                       ; +0xac, 0x1006c3acc\nmov     ecx, 1                                                         ; +0xaf, 0x1006c3acf\ncall    cocos2d__CCGLProgram__setUniformLocationWithMatrix3fv          ; +0xb4, 0x1006c3ad4\nmov     rax, [rbx]                                                     ; +0xb9, 0x1006c3ad9\nmov     rdi, rbx                                                       ; +0xbc, 0x1006c3adc\ncall    qword ptr [rax+290h]                                           ; +0xbf, 0x1006c3adf\nmovzx   ecx, byte ptr [rbx+148h]                                       ; +0xc5, 0x1006c3ae5\ncvtsi2ss xmm0, ecx                                                     ; +0xcc, 0x1006c3aec\nmov     esi, [rbx+28Ch]                                                ; +0xd0, 0x1006c3af0\ndivss   xmm0, cs:dword_100A03F80                                       ; +0xd6, 0x1006c3af6\nmov     rdi, rax                                                       ; +0xde, 0x1006c3afe\ncall    cocos2d__CCGLProgram__setUniformLocationWith1f                 ; +0xe1, 0x1006c3b01\nmov     rax, [rbx]                                                     ; +0xe6, 0x1006c3b06\nmov     rdi, rbx                                                       ; +0xe9, 0x1006c3b09\ncall    qword ptr [rax+290h]                                           ; +0xec, 0x1006c3b0c\nmov     esi, [rbx+290h]                                                ; +0xf2, 0x1006c3b12\nmovss   xmm0, dword ptr [rbx+258h]                                     ; +0xf8, 0x1006c3b18\nmovss   xmm1, dword ptr [rbx+25Ch]                                     ; +0x100, 0x1006c3b20\nmovss   xmm2, dword ptr [rbx+260h]                                     ; +0x108, 0x1006c3b28\nmov     rdi, rax                                                       ; +0x110, 0x1006c3b30\ncall    cocos2d__CCGLProgram__setUniformLocationWith3f                 ; +0x113, 0x1006c3b33\nlea     r9, [rbx+1CCh]; pointer                                        ; +0x118, 0x1006c3b38\nxor     edi, edi; index                                                ; +0x11f, 0x1006c3b3f\nmov     esi, 3; size                                                   ; +0x121, 0x1006c3b41\nmov     edx, 1406h; type                                               ; +0x126, 0x1006c3b46\nxor     ecx, ecx; normalized                                           ; +0x12b, 0x1006c3b4b\nmov     r8d, 18h; stride                                               ; +0x12d, 0x1006c3b4d\ncall    _glVertexAttribPointer                                         ; +0x133, 0x1006c3b53\nlea     r9, [rbx+1DCh]; pointer                                        ; +0x138, 0x1006c3b58\nmov     edi, 2; index                                                  ; +0x13f, 0x1006c3b5f\nmov     esi, 2; size                                                   ; +0x144, 0x1006c3b64\nmov     edx, 1406h; type                                               ; +0x149, 0x1006c3b69\nxor     ecx, ecx; normalized                                           ; +0x14e, 0x1006c3b6e\nmov     r8d, 18h; stride                                               ; +0x150, 0x1006c3b70\ncall    _glVertexAttribPointer                                         ; +0x156, 0x1006c3b76\nadd     rbx, 1D8h                                                      ; +0x15b, 0x1006c3b7b\nmov     edi, 1; index                                                  ; +0x162, 0x1006c3b82\nmov     esi, 4; size                                                   ; +0x167, 0x1006c3b87\nmov     edx, 1401h; type                                               ; +0x16c, 0x1006c3b8c\nmov     ecx, 1; normalized                                             ; +0x171, 0x1006c3b91\nmov     r8d, 18h; stride                                               ; +0x176, 0x1006c3b96\nmov     r9, rbx; pointer                                               ; +0x17c, 0x1006c3b9c\ncall    _glVertexAttribPointer                                         ; +0x17f, 0x1006c3b9f\nmov     edi, 5; mode                                                   ; +0x184, 0x1006c3ba4\nxor     esi, esi; first                                                ; +0x189, 0x1006c3ba9\nmov     edx, 4; count                                                  ; +0x18b, 0x1006c3bab\ncall    _glDrawArrays                                                  ; +0x190, 0x1006c3bb0\nlea     rax, dword_100BE8BE8                                           ; +0x195, 0x1006c3bb5\ninc     dword ptr [rax]                                                ; +0x19c, 0x1006c3bbc\nadd     rsp, 8                                                         ; +0x19e, 0x1006c3bbe\npop     rbx                                                            ; +0x1a2, 0x1006c3bc2\npop     rbp                                                            ; +0x1a3, 0x1006c3bc3\nretn                                                                   ; +0x1a4, 0x1006c3bc4", "xrefs": ["<???> @ 0x100b8d8d8", "<???> @ 0x100b8dea0"], "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"}