{"type": "func", "start": 6443147536, "end": 6443147801, "name": "cocos2d::CCTextureAtlas::initWithTexture", "pseudocode": "// \n// cocos2d::CCTextureAtlas::initWithTexture from 0x1800aa110 to 0x1800aa219 (265 bytes)\n// \n// 8 xrefs:\n// > cocos2d::CCAtlasNode::initWithTexture @ 0x180001c4a\n// > cocos2d::CCParticleBatchNode::initWithTexture @ 0x180063b50\n// > cocos2d::CCSpriteBatchNode::initWithTexture @ 0x1800918f5\n// > cocos2d::CCTextureAtlas::create @ 0x1800a9cfc\n// > cocos2d::CCTextureAtlas::createWithTexture @ 0x1800a9dd4\n// > cocos2d::CCTextureAtlas::initWithFile @ 0x1800aa0f8\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c1fd4\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:17 +0000\n// \n\nchar __fastcall cocos2d::CCTextureAtlas::initWithTexture(\n        cocos2d::CCTextureAtlas *this,\n        struct cocos2d::CCTexture2D *a2,\n        int a3)\n{\n  void *v4; // rax\n  void *v5; // rcx\n  void *v6; // rcx\n  cocos2d::CCObject *v7; // rcx\n\n  *((_DWORD *)this + 20) = a3;\n  *((_DWORD *)this + 19) = 0;\n  *((_DWORD *)this + 26) = 0;\n  *((_QWORD *)this + 11) = a2;\n  if ( a2 )\n    cocos2d::CCObject::retain(a2);\n  *((_QWORD *)this + 12) = malloc(96LL * *((unsigned int *)this + 20));\n  v4 = malloc(2LL * (unsigned int)(6 * *((_DWORD *)this + 20)));\n  v5 = *((void **)this + 12);\n  *((_QWORD *)this + 7) = v4;\n  if ( v5 && v4 || !*((_DWORD *)this + 20) )\n  {\n    memset(v5, 0, 96LL * *((unsigned int *)this + 20));\n    memset(*((void **)this + 7), 0, 2LL * (unsigned int)(6 * *((_DWORD *)this + 20)));\n    cocos2d::CCTextureAtlas::setupIndices(this);\n    _glewGenBuffers(2, (char *)this + 64);\n    cocos2d::CCTextureAtlas::mapBuffers(this);\n    *((_BYTE *)this + 72) = 1;\n    return 1;\n  }\n  else\n  {\n    if ( v5 )\n    {\n      free(v5);\n      *((_QWORD *)this + 12) = 0;\n    }\n    v6 = *((void **)this + 7);\n    if ( v6 )\n    {\n      free(v6);\n      *((_QWORD *)this + 7) = 0;\n    }\n    v7 = *((cocos2d::CCObject **)this + 11);\n    if ( v7 )\n    {\n      cocos2d::CCObject::release(v7);\n      *((_QWORD *)this + 11) = 0;\n    }\n    return 0;\n  }\n}", "assembly": "; \n; cocos2d::CCTextureAtlas::initWithTexture from 0x1800aa110 to 0x1800aa219 (265 bytes)\n; \n; 8 xrefs:\n; > cocos2d::CCAtlasNode::initWithTexture @ 0x180001c4a\n; > cocos2d::CCParticleBatchNode::initWithTexture @ 0x180063b50\n; > cocos2d::CCSpriteBatchNode::initWithTexture @ 0x1800918f5\n; > cocos2d::CCTextureAtlas::create @ 0x1800a9cfc\n; > cocos2d::CCTextureAtlas::createWithTexture @ 0x1800a9dd4\n; > cocos2d::CCTextureAtlas::initWithFile @ 0x1800aa0f8\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c1fd4\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:17 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800aa110\npush    rdi                                                            ; +0x5, 0x1800aa115\nsub     rsp, 20h                                                       ; +0x6, 0x1800aa116\nxor     edi, edi                                                       ; +0xa, 0x1800aa11a\nmov     [rcx+50h], r8d                                                 ; +0xc, 0x1800aa11c\nmov     [rcx+4Ch], edi                                                 ; +0x10, 0x1800aa120\nmov     rbx, rcx                                                       ; +0x13, 0x1800aa123\nmov     [rcx+68h], edi                                                 ; +0x16, 0x1800aa126\nmov     [rcx+58h], rdx                                                 ; +0x19, 0x1800aa129\ntest    rdx, rdx                                                       ; +0x1d, 0x1800aa12d\njz      short loc_1800AA13A                                            ; +0x20, 0x1800aa130\nmov     rcx, rdx; this                                                 ; +0x22, 0x1800aa132\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x25, 0x1800aa135\nmov     eax, [rbx+50h]                                                 ; +0x2a, 0x1800aa13a\nlea     rcx, [rax+rax*2]                                               ; +0x2d, 0x1800aa13d\nshl     rcx, 5; Size                                                   ; +0x31, 0x1800aa141\ncall    cs:__imp_malloc                                                ; +0x35, 0x1800aa145\nmov     [rbx+60h], rax                                                 ; +0x3b, 0x1800aa14b\nmov     eax, [rbx+50h]                                                 ; +0x3f, 0x1800aa14f\nlea     ecx, [rax+rax*2]                                               ; +0x42, 0x1800aa152\nadd     ecx, ecx                                                       ; +0x45, 0x1800aa155\nadd     rcx, rcx; Size                                                 ; +0x47, 0x1800aa157\ncall    cs:__imp_malloc                                                ; +0x4a, 0x1800aa15a\nmov     rcx, [rbx+60h]; void *                                         ; +0x50, 0x1800aa160\nmov     [rbx+38h], rax                                                 ; +0x54, 0x1800aa164\ntest    rcx, rcx                                                       ; +0x58, 0x1800aa168\njz      short loc_1800AA172                                            ; +0x5b, 0x1800aa16b\ntest    rax, rax                                                       ; +0x5d, 0x1800aa16d\njnz     short loc_1800AA1B8                                            ; +0x60, 0x1800aa170\ncmp     [rbx+50h], edi                                                 ; +0x62, 0x1800aa172\njbe     short loc_1800AA1B8                                            ; +0x65, 0x1800aa175\ntest    rcx, rcx                                                       ; +0x67, 0x1800aa177\njz      short loc_1800AA186                                            ; +0x6a, 0x1800aa17a\ncall    cs:__imp_free                                                  ; +0x6c, 0x1800aa17c\nmov     [rbx+60h], rdi                                                 ; +0x72, 0x1800aa182\nmov     rcx, [rbx+38h]; Block                                          ; +0x76, 0x1800aa186\ntest    rcx, rcx                                                       ; +0x7a, 0x1800aa18a\njz      short loc_1800AA199                                            ; +0x7d, 0x1800aa18d\ncall    cs:__imp_free                                                  ; +0x7f, 0x1800aa18f\nmov     [rbx+38h], rdi                                                 ; +0x85, 0x1800aa195\nmov     rcx, [rbx+58h]; this                                           ; +0x89, 0x1800aa199\ntest    rcx, rcx                                                       ; +0x8d, 0x1800aa19d\njz      short loc_1800AA1AB                                            ; +0x90, 0x1800aa1a0\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x92, 0x1800aa1a2\nmov     [rbx+58h], rdi                                                 ; +0x97, 0x1800aa1a7\nxor     al, al                                                         ; +0x9b, 0x1800aa1ab\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x9d, 0x1800aa1ad\nadd     rsp, 20h                                                       ; +0xa2, 0x1800aa1b2\npop     rdi                                                            ; +0xa6, 0x1800aa1b6\nretn                                                                   ; +0xa7, 0x1800aa1b7\nmov     eax, [rbx+50h]                                                 ; +0xa8, 0x1800aa1b8\nxor     edx, edx; Val                                                  ; +0xab, 0x1800aa1bb\nlea     r8, [rax+rax*2]                                                ; +0xad, 0x1800aa1bd\nshl     r8, 5; Size                                                    ; +0xb1, 0x1800aa1c1\ncall    memset                                                         ; +0xb5, 0x1800aa1c5\nmov     eax, [rbx+50h]                                                 ; +0xba, 0x1800aa1ca\nxor     edx, edx; Val                                                  ; +0xbd, 0x1800aa1cd\nlea     ecx, [rax+rax*2]                                               ; +0xbf, 0x1800aa1cf\nlea     r8d, [rcx+rcx]                                                 ; +0xc2, 0x1800aa1d2\nmov     rcx, [rbx+38h]; void *                                         ; +0xc6, 0x1800aa1d6\nadd     r8, r8; Size                                                   ; +0xca, 0x1800aa1da\ncall    memset                                                         ; +0xcd, 0x1800aa1dd\nmov     rcx, rbx; this                                                 ; +0xd2, 0x1800aa1e2\ncall    ?setupIndices@CCTextureAtlas@cocos2d@@AEAAXXZ; cocos2d::CCTextureAtlas::setupIndices(void) ; +0xd5, 0x1800aa1e5\nmov     rax, cs:__glewGenBuffers                                       ; +0xda, 0x1800aa1ea\nlea     rdx, [rbx+40h]                                                 ; +0xe1, 0x1800aa1f1\nmov     ecx, 2                                                         ; +0xe5, 0x1800aa1f5\nmov     r8, [rax]                                                      ; +0xea, 0x1800aa1fa\ncall    r8                                                             ; +0xed, 0x1800aa1fd\nmov     rcx, rbx; this                                                 ; +0xf0, 0x1800aa200\ncall    ?mapBuffers@CCTextureAtlas@cocos2d@@AEAAXXZ; cocos2d::CCTextureAtlas::mapBuffers(void) ; +0xf3, 0x1800aa203\nmov     byte ptr [rbx+48h], 1                                          ; +0xf8, 0x1800aa208\nmov     al, 1                                                          ; +0xfc, 0x1800aa20c\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xfe, 0x1800aa20e\nadd     rsp, 20h                                                       ; +0x103, 0x1800aa213\npop     rdi                                                            ; +0x107, 0x1800aa217\nretn                                                                   ; +0x108, 0x1800aa218", "xrefs": ["cocos2d::CCAtlasNode::initWithTexture @ 0x180001c4a", "cocos2d::CCParticleBatchNode::initWithTexture @ 0x180063b50", "cocos2d::CCSpriteBatchNode::initWithTexture @ 0x1800918f5", "cocos2d::CCTextureAtlas::create @ 0x1800a9cfc", "cocos2d::CCTextureAtlas::createWithTexture @ 0x1800a9dd4", "cocos2d::CCTextureAtlas::initWithFile @ 0x1800aa0f8", "<???> @ 0x18014cf68", "<???> @ 0x1801c1fd4"], "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"}