{"type": "func", "start": 6442458112, "end": 6442458454, "name": "cocos2d::CCAtlasNode::initWithTexture", "pseudocode": "// \n// cocos2d::CCAtlasNode::initWithTexture from 0x180001c00 to 0x180001d56 (342 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCAtlasNode::create @ 0x180001a2b\n// > cocos2d::CCAtlasNode::initWithTileFile @ 0x180001db3\n// > cocos2d::CCLabelAtlas::initWithString @ 0x1800465ad\n// > cocos2d::CCLabelAtlas::initWithString @ 0x180046628\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801ad0e4\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\n// Hidden C++ exception states: #wind=1\nchar __fastcall cocos2d::CCAtlasNode::initWithTexture(\n        cocos2d::CCAtlasNode *this,\n        struct cocos2d::CCTexture2D *a2,\n        unsigned int a3,\n        unsigned int a4,\n        unsigned int a5)\n{\n  cocos2d::CCTextureAtlas *v7; // rax\n  cocos2d::CCTextureAtlas *m_pTextureAtlas; // rcx\n  cocos2d::CCCamera *v10; // rax\n  cocos2d::CCCamera *v11; // rax\n  cocos2d::CCAtlasNode_vtbl *v12; // rbx\n  cocos2d::CCShaderCache *v13; // rax\n  struct cocos2d::CCGLProgram *v14; // rax\n  __int64 v15; // rax\n\n  this->m_uItemWidth = a3;\n  this->m_uItemHeight = a4;\n  *(_WORD *)&this->m_tColorUnmodified.r = -1;\n  this->m_tColorUnmodified.b = -1;\n  this->m_bIsOpacityModifyRGB = 1;\n  this->m_tBlendFunc.src = 1;\n  this->m_tBlendFunc.dst = 771;\n  v7 = (cocos2d::CCTextureAtlas *)operator new(0x70u);\n  if ( v7 )\n    v7 = (cocos2d::CCTextureAtlas *)cocos2d::CCTextureAtlas::CCTextureAtlas(v7);\n  this->m_pTextureAtlas = v7;\n  cocos2d::CCTextureAtlas::initWithTexture(v7, a2, a5);\n  m_pTextureAtlas = this->m_pTextureAtlas;\n  if ( !m_pTextureAtlas )\n    return 0;\n  v10 = (cocos2d::CCCamera *)((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))m_pTextureAtlas->getTexture)(m_pTextureAtlas);\n  if ( !cocos2d::CCCamera::isDirty(v10) )\n  {\n    this->m_tBlendFunc.src = 770;\n    this->m_tBlendFunc.dst = 771;\n  }\n  v11 = (cocos2d::CCCamera *)((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getTexture)(this->m_pTextureAtlas);\n  this->m_bIsOpacityModifyRGB = cocos2d::CCCamera::isDirty(v11);\n  cocos2d::CCAtlasNode::calculateMaxItems(this);\n  this->m_uQuadsToDraw = a5;\n  v12 = this->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v13 = cocos2d::CCShaderCache::sharedShaderCache();\n  v14 = cocos2d::CCShaderCache::programForKey(v13, \"ShaderPositionTexture_uColor\");\n  ((void (__fastcall *)(cocos2d::CCAtlasNode *, struct cocos2d::CCGLProgram *))v12->setShaderProgram)(this, v14);\n  v15 = ((__int64 (__fastcall *)(cocos2d::CCAtlasNode *))this->getShaderProgram)(this);\n  this->m_nUniformColor = _glewGetUniformLocation(*(unsigned int *)(v15 + 56), \"u_color\");\n  return 1;\n}", "assembly": "; \n; cocos2d::CCAtlasNode::initWithTexture from 0x180001c00 to 0x180001d56 (342 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCAtlasNode::create @ 0x180001a2b\n; > cocos2d::CCAtlasNode::initWithTileFile @ 0x180001db3\n; > cocos2d::CCLabelAtlas::initWithString @ 0x1800465ad\n; > cocos2d::CCLabelAtlas::initWithString @ 0x180046628\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801ad0e4\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x180001c00\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x180001c05\npush    rdi                                                            ; +0xa, 0x180001c0a\nsub     rsp, 20h                                                       ; +0xb, 0x180001c0b\nmov     rsi, rdx                                                       ; +0xf, 0x180001c0f\nmov     rdi, rcx                                                       ; +0x12, 0x180001c12\nmov     [rcx+168h], r8d                                                ; +0x15, 0x180001c15\nmov     [rcx+16Ch], r9d                                                ; +0x1c, 0x180001c1c\nmovzx   eax, cs:word_1800E5390                                         ; +0x23, 0x180001c23\nmov     [rcx+170h], ax                                                 ; +0x2a, 0x180001c2a\nmovzx   eax, cs:byte_1800E5392                                         ; +0x31, 0x180001c31\nmov     [rcx+172h], al                                                 ; +0x38, 0x180001c38\nmov     byte ptr [rcx+180h], 1                                         ; +0x3e, 0x180001c3e\nmov     dword ptr [rcx+184h], 1                                        ; +0x45, 0x180001c45\nmov     dword ptr [rcx+188h], 303h                                     ; +0x4f, 0x180001c4f\nmov     ecx, 70h ; 'p'; Size                                           ; +0x59, 0x180001c59\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x5e, 0x180001c5e\nmov     [rsp+28h+arg_0], rax                                           ; +0x63, 0x180001c63\ntest    rax, rax                                                       ; +0x68, 0x180001c68\njz      short loc_180001C76                                            ; +0x6b, 0x180001c6b\nmov     rcx, rax; this                                                 ; +0x6d, 0x180001c6d\ncall    ??0CCTextureAtlas@cocos2d@@QEAA@XZ; cocos2d::CCTextureAtlas::CCTextureAtlas(void) ; +0x70, 0x180001c70\nnop                                                                    ; +0x75, 0x180001c75\nmov     [rdi+178h], rax                                                ; +0x76, 0x180001c76\nmov     ebx, [rsp+28h+arg_20]                                          ; +0x7d, 0x180001c7d\nmov     r8d, ebx; unsigned int                                         ; +0x81, 0x180001c81\nmov     rdx, rsi; struct cocos2d::CCTexture2D *                        ; +0x84, 0x180001c84\nmov     rcx, rax; this                                                 ; +0x87, 0x180001c87\ncall    ?initWithTexture@CCTextureAtlas@cocos2d@@QEAA_NPEAVCCTexture2D@2@I@Z; cocos2d::CCTextureAtlas::initWithTexture(cocos2d::CCTexture2D *,uint) ; +0x8a, 0x180001c8a\nmov     rcx, [rdi+178h]                                                ; +0x8f, 0x180001c8f\ntest    rcx, rcx                                                       ; +0x96, 0x180001c96\njnz     short loc_180001CAD                                            ; +0x99, 0x180001c99\nxor     al, al                                                         ; +0x9b, 0x180001c9b\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x9d, 0x180001c9d\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xa2, 0x180001ca2\nadd     rsp, 20h                                                       ; +0xa7, 0x180001ca7\npop     rdi                                                            ; +0xab, 0x180001cab\nretn                                                                   ; +0xac, 0x180001cac\nmov     rax, [rcx]                                                     ; +0xad, 0x180001cad\ncall    qword ptr [rax+58h]                                            ; +0xb0, 0x180001cb0\nmov     rcx, rax; this                                                 ; +0xb3, 0x180001cb3\ncall    ?isDirty@CCCamera@cocos2d@@QEAA_NXZ; cocos2d::CCCamera::isDirty(void) ; +0xb6, 0x180001cb6\ntest    al, al                                                         ; +0xbb, 0x180001cbb\njnz     short loc_180001CD3                                            ; +0xbd, 0x180001cbd\nmov     dword ptr [rdi+184h], 302h                                     ; +0xbf, 0x180001cbf\nmov     dword ptr [rdi+188h], 303h                                     ; +0xc9, 0x180001cc9\nmov     rcx, [rdi+178h]                                                ; +0xd3, 0x180001cd3\nmov     rax, [rcx]                                                     ; +0xda, 0x180001cda\ncall    qword ptr [rax+58h]                                            ; +0xdd, 0x180001cdd\nmov     rcx, rax; this                                                 ; +0xe0, 0x180001ce0\ncall    ?isDirty@CCCamera@cocos2d@@QEAA_NXZ; cocos2d::CCCamera::isDirty(void) ; +0xe3, 0x180001ce3\nmov     [rdi+180h], al                                                 ; +0xe8, 0x180001ce8\nmov     rcx, rdi; this                                                 ; +0xee, 0x180001cee\ncall    ?calculateMaxItems@CCAtlasNode@cocos2d@@AEAAXXZ; cocos2d::CCAtlasNode::calculateMaxItems(void) ; +0xf1, 0x180001cf1\nmov     [rdi+18Ch], ebx                                                ; +0xf6, 0x180001cf6\nmov     rbx, [rdi]                                                     ; +0xfc, 0x180001cfc\ncall    ?sharedShaderCache@CCShaderCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0xff, 0x180001cff\nmov     rcx, rax; this                                                 ; +0x104, 0x180001d04\nlea     rdx, aShaderposition; \"ShaderPositionTexture_uColor\"           ; +0x107, 0x180001d07\ncall    ?programForKey@CCShaderCache@cocos2d@@QEAAPEAVCCGLProgram@2@PEBD@Z; cocos2d::CCShaderCache::programForKey(char const *) ; +0x10e, 0x180001d0e\nmov     rdx, rax                                                       ; +0x113, 0x180001d13\nmov     rcx, rdi                                                       ; +0x116, 0x180001d16\ncall    qword ptr [rbx+280h]                                           ; +0x119, 0x180001d19\nmov     rax, [rdi]                                                     ; +0x11f, 0x180001d1f\nmov     rcx, rdi                                                       ; +0x122, 0x180001d22\ncall    qword ptr [rax+278h]                                           ; +0x125, 0x180001d25\nlea     rdx, aUColor; \"u_color\"                                        ; +0x12b, 0x180001d2b\nmov     ecx, [rax+38h]                                                 ; +0x132, 0x180001d32\nmov     rax, cs:__glewGetUniformLocation                               ; +0x135, 0x180001d35\ncall    qword ptr [rax]                                                ; +0x13c, 0x180001d3c\nmov     [rdi+190h], eax                                                ; +0x13e, 0x180001d3e\nmov     al, 1                                                          ; +0x144, 0x180001d44\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x146, 0x180001d46\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x14b, 0x180001d4b\nadd     rsp, 20h                                                       ; +0x150, 0x180001d50\npop     rdi                                                            ; +0x154, 0x180001d54\nretn                                                                   ; +0x155, 0x180001d55", "xrefs": ["cocos2d::CCAtlasNode::create @ 0x180001a2b", "cocos2d::CCAtlasNode::initWithTileFile @ 0x180001db3", "cocos2d::CCLabelAtlas::initWithString @ 0x1800465ad", "cocos2d::CCLabelAtlas::initWithString @ 0x180046628", "<???> @ 0x1801438a8", "<???> @ 0x1801ad0e4"], "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"}