{"type": "func", "start": 6442843024, "end": 6442843544, "name": "cocos2d::CCRenderTexture::draw", "pseudocode": "// \n// cocos2d::CCRenderTexture::draw from 0x18005fb90 to 0x18005fd98 (520 bytes)\n// \n// 5 xrefs:\n// > <???> @ 0x1800f9f30\n// > <???> @ 0x180139504\n// > <???> @ 0x180139538\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b3408\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::CCRenderTexture::draw(cocos2d::CCRenderTexture *this)\n{\n  GLbitfield m_uClearFlags; // eax\n  cocos2d::CCArray *m_pChildren; // rax\n  cocos2d::ccArray *data; // rbx\n  __int64 num; // rax\n  cocos2d::CCSprite **arr; // rbx\n  cocos2d::CCSprite **i; // rsi\n  cocos2d::CCSprite *v8; // rcx\n  cocos2d::CCDirector *v9; // rbx\n  GLfloat v10; // [rsp+20h] [rbp-28h] BYREF\n  GLint s; // [rsp+24h] [rbp-24h] BYREF\n  GLfloat params[4]; // [rsp+28h] [rbp-20h] BYREF\n\n  if ( this->m_bAutoDraw )\n  {\n    cocos2d::CCRenderTexture::begin(this);\n    m_uClearFlags = this->m_uClearFlags;\n    if ( m_uClearFlags )\n    {\n      v10 = 0.0;\n      s = 0;\n      *(_OWORD *)params = 0;\n      if ( (m_uClearFlags & 0x4000) != 0 )\n      {\n        glGetFloatv(0xC22u, params);\n        glClearColor(this->m_sClearColor.r, this->m_sClearColor.g, this->m_sClearColor.b, this->m_sClearColor.a);\n      }\n      if ( (this->m_uClearFlags & 0x100) != 0 )\n      {\n        glGetFloatv(0xB73u, &v10);\n        glClearDepth(this->m_fClearDepth);\n      }\n      if ( (this->m_uClearFlags & 0x400) != 0 )\n      {\n        glGetIntegerv(0xB91u, &s);\n        glClearStencil(this->m_nClearStencil);\n      }\n      glClear(this->m_uClearFlags);\n      if ( (this->m_uClearFlags & 0x4000) != 0 )\n        glClearColor(params[0], params[1], params[2], params[3]);\n      if ( (this->m_uClearFlags & 0x100) != 0 )\n        glClearDepth(v10);\n      if ( (this->m_uClearFlags & 0x400) != 0 )\n        glClearStencil(s);\n    }\n    ((void (__fastcall *)(cocos2d::CCRenderTexture *))this->sortAllChildren)(this);\n    m_pChildren = this->m_pChildren;\n    if ( m_pChildren )\n    {\n      data = m_pChildren->data;\n      num = data->num;\n      if ( (_DWORD)num )\n      {\n        arr = (cocos2d::CCSprite **)data->arr;\n        for ( i = &arr[num - 1]; arr <= i; ++arr )\n        {\n          v8 = *arr;\n          if ( !*arr )\n            break;\n          if ( v8 != this->m_pSprite )\n            ((void (__fastcall *)(cocos2d::CCSprite *))v8->visit)(v8);\n        }\n      }\n    }\n    v9 = cocos2d::CCDirector::sharedDirector();\n    _glewBindFramebuffer(36160, (unsigned int)this->m_nOldFBO);\n    cocos2d::CCDirector::setViewport(v9);\n    kmGLMatrixMode(5889);\n    kmGLPopMatrix();\n    kmGLMatrixMode(5888);\n    kmGLPopMatrix();\n  }\n}", "assembly": "; \n; cocos2d::CCRenderTexture::draw from 0x18005fb90 to 0x18005fd98 (520 bytes)\n; \n; 5 xrefs:\n; > <???> @ 0x1800f9f30\n; > <???> @ 0x180139504\n; > <???> @ 0x180139538\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b3408\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\npush    rdi                                                            ; +0x0, 0x18005fb90\nsub     rsp, 40h                                                       ; +0x2, 0x18005fb92\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x18005fb96\nxor     rax, rsp                                                       ; +0xd, 0x18005fb9d\nmov     [rsp+48h+var_10], rax                                          ; +0x10, 0x18005fba0\ncmp     byte ptr [rcx+190h], 0                                         ; +0x15, 0x18005fba5\nmov     rdi, rcx                                                       ; +0x1c, 0x18005fbac\njz      loc_18005FD85                                                  ; +0x1f, 0x18005fbaf\nmov     [rsp+48h+arg_8], rbx                                           ; +0x25, 0x18005fbb5\ncall    ?begin@CCRenderTexture@cocos2d@@QEAAXXZ; cocos2d::CCRenderTexture::begin(void) ; +0x2a, 0x18005fbba\nmov     eax, [rdi+174h]                                                ; +0x2f, 0x18005fbbf\ntest    eax, eax                                                       ; +0x35, 0x18005fbc5\njz      loc_18005FCDD                                                  ; +0x37, 0x18005fbc7\nmov     [rsp+48h+var_28], 0                                            ; +0x3d, 0x18005fbcd\nxorps   xmm0, xmm0                                                     ; +0x45, 0x18005fbd5\nmov     [rsp+48h+s], 0                                                 ; +0x48, 0x18005fbd8\nmovups  xmmword ptr [rsp+48h+params], xmm0                             ; +0x50, 0x18005fbe0\nbt      eax, 0Eh                                                       ; +0x55, 0x18005fbe5\njnb     short loc_18005FC21                                            ; +0x59, 0x18005fbe9\nlea     rdx, [rsp+48h+params]; params                                  ; +0x5b, 0x18005fbeb\nmov     ecx, 0C22h; pname                                              ; +0x60, 0x18005fbf0\ncall    cs:glGetFloatv                                                 ; +0x65, 0x18005fbf5\nmovss   xmm3, dword ptr [rdi+184h]; alpha                              ; +0x6b, 0x18005fbfb\nmovss   xmm2, dword ptr [rdi+180h]; blue                               ; +0x73, 0x18005fc03\nmovss   xmm1, dword ptr [rdi+17Ch]; green                              ; +0x7b, 0x18005fc0b\nmovss   xmm0, dword ptr [rdi+178h]; red                                ; +0x83, 0x18005fc13\ncall    cs:glClearColor                                                ; +0x8b, 0x18005fc1b\ntest    dword ptr [rdi+174h], 100h                                     ; +0x91, 0x18005fc21\njz      short loc_18005FC4E                                            ; +0x9b, 0x18005fc2b\nlea     rdx, [rsp+48h+var_28]; params                                  ; +0x9d, 0x18005fc2d\nmov     ecx, 0B73h; pname                                              ; +0xa2, 0x18005fc32\ncall    cs:glGetFloatv                                                 ; +0xa7, 0x18005fc37\nmovss   xmm0, dword ptr [rdi+188h]                                     ; +0xad, 0x18005fc3d\ncvtps2pd xmm0, xmm0; depth                                             ; +0xb5, 0x18005fc45\ncall    cs:glClearDepth                                                ; +0xb8, 0x18005fc48\ntest    dword ptr [rdi+174h], 400h                                     ; +0xbe, 0x18005fc4e\njz      short loc_18005FC76                                            ; +0xc8, 0x18005fc58\nlea     rdx, [rsp+48h+s]; params                                       ; +0xca, 0x18005fc5a\nmov     ecx, 0B91h; pname                                              ; +0xcf, 0x18005fc5f\ncall    cs:glGetIntegerv                                               ; +0xd4, 0x18005fc64\nmov     ecx, [rdi+18Ch]; s                                             ; +0xda, 0x18005fc6a\ncall    cs:glClearStencil                                              ; +0xe0, 0x18005fc70\nmov     ecx, [rdi+174h]; mask                                          ; +0xe6, 0x18005fc76\ncall    cs:glClear                                                     ; +0xec, 0x18005fc7c\ntest    dword ptr [rdi+174h], 4000h                                    ; +0xf2, 0x18005fc82\njz      short loc_18005FCAC                                            ; +0xfc, 0x18005fc8c\nmovss   xmm3, [rsp+48h+params+0Ch]; alpha                              ; +0xfe, 0x18005fc8e\nmovss   xmm2, [rsp+48h+params+8]; blue                                 ; +0x104, 0x18005fc94\nmovss   xmm1, [rsp+48h+params+4]; green                                ; +0x10a, 0x18005fc9a\nmovss   xmm0, [rsp+48h+params]; red                                    ; +0x110, 0x18005fca0\ncall    cs:glClearColor                                                ; +0x116, 0x18005fca6\ntest    dword ptr [rdi+174h], 100h                                     ; +0x11c, 0x18005fcac\njz      short loc_18005FCC7                                            ; +0x126, 0x18005fcb6\nmovss   xmm0, [rsp+48h+var_28]                                         ; +0x128, 0x18005fcb8\ncvtps2pd xmm0, xmm0; depth                                             ; +0x12e, 0x18005fcbe\ncall    cs:glClearDepth                                                ; +0x131, 0x18005fcc1\ntest    dword ptr [rdi+174h], 400h                                     ; +0x137, 0x18005fcc7\njz      short loc_18005FCDD                                            ; +0x141, 0x18005fcd1\nmov     ecx, [rsp+48h+s]; s                                            ; +0x143, 0x18005fcd3\ncall    cs:glClearStencil                                              ; +0x147, 0x18005fcd7\nmov     rax, [rdi]                                                     ; +0x14d, 0x18005fcdd\nmov     rcx, rdi                                                       ; +0x150, 0x18005fce0\ncall    qword ptr [rax+240h]                                           ; +0x153, 0x18005fce3\nmov     rax, [rdi+0D0h]                                                ; +0x159, 0x18005fce9\ntest    rax, rax                                                       ; +0x160, 0x18005fcf0\njz      short loc_18005FD3D                                            ; +0x163, 0x18005fcf3\nmov     rbx, [rax+38h]                                                 ; +0x165, 0x18005fcf5\nmov     eax, [rbx]                                                     ; +0x169, 0x18005fcf9\ntest    eax, eax                                                       ; +0x16b, 0x18005fcfb\njz      short loc_18005FD3D                                            ; +0x16d, 0x18005fcfd\nmov     rbx, [rbx+10h]                                                 ; +0x16f, 0x18005fcff\nmov     [rsp+48h+arg_10], rsi                                          ; +0x173, 0x18005fd03\nlea     rsi, [rax-1]                                                   ; +0x178, 0x18005fd08\nlea     rsi, [rbx+rsi*8]                                               ; +0x17c, 0x18005fd0c\ncmp     rbx, rsi                                                       ; +0x180, 0x18005fd10\nja      short loc_18005FD38                                            ; +0x183, 0x18005fd13\nmov     rcx, [rbx]                                                     ; +0x185, 0x18005fd15\ntest    rcx, rcx                                                       ; +0x188, 0x18005fd18\njz      short loc_18005FD38                                            ; +0x18b, 0x18005fd1b\ncmp     rcx, [rdi+140h]                                                ; +0x18d, 0x18005fd1d\njz      short loc_18005FD2F                                            ; +0x194, 0x18005fd24\nmov     rax, [rcx]                                                     ; +0x196, 0x18005fd26\ncall    qword ptr [rax+2D8h]                                           ; +0x199, 0x18005fd29\nadd     rbx, 8                                                         ; +0x19f, 0x18005fd2f\ncmp     rbx, rsi                                                       ; +0x1a3, 0x18005fd33\njbe     short loc_18005FD15                                            ; +0x1a6, 0x18005fd36\nmov     rsi, [rsp+48h+arg_10]                                          ; +0x1a8, 0x18005fd38\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1ad, 0x18005fd3d\nmov     r8, cs:__glewBindFramebuffer                                   ; +0x1b2, 0x18005fd42\nmov     ecx, 8D40h                                                     ; +0x1b9, 0x18005fd49\nmov     edx, [rdi+150h]                                                ; +0x1be, 0x18005fd4e\nmov     rbx, rax                                                       ; +0x1c4, 0x18005fd54\ncall    qword ptr [r8]                                                 ; +0x1c7, 0x18005fd57\nmov     rcx, rbx; this                                                 ; +0x1ca, 0x18005fd5a\ncall    ?setViewport@CCDirector@cocos2d@@QEAAXXZ; cocos2d::CCDirector::setViewport(void) ; +0x1cd, 0x18005fd5d\nmov     ecx, 1701h                                                     ; +0x1d2, 0x18005fd62\ncall    kmGLMatrixMode                                                 ; +0x1d7, 0x18005fd67\ncall    kmGLPopMatrix                                                  ; +0x1dc, 0x18005fd6c\nmov     ecx, 1700h                                                     ; +0x1e1, 0x18005fd71\ncall    kmGLMatrixMode                                                 ; +0x1e6, 0x18005fd76\ncall    kmGLPopMatrix                                                  ; +0x1eb, 0x18005fd7b\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x1f0, 0x18005fd80\nmov     rcx, [rsp+48h+var_10]                                          ; +0x1f5, 0x18005fd85\nxor     rcx, rsp; StackCookie                                          ; +0x1fa, 0x18005fd8a\ncall    __security_check_cookie                                        ; +0x1fd, 0x18005fd8d\nadd     rsp, 40h                                                       ; +0x202, 0x18005fd92\npop     rdi                                                            ; +0x206, 0x18005fd96\nretn                                                                   ; +0x207, 0x18005fd97", "xrefs": ["<???> @ 0x1800f9f30", "<???> @ 0x180139504", "<???> @ 0x180139538", "<???> @ 0x1801438a8", "<???> @ 0x1801b3408"], "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"}