{"type": "func", "start": 6442974176, "end": 6442974405, "name": "cocos2d::CCImage::initWithImageData", "pseudocode": "// \n// cocos2d::CCImage::initWithImageData from 0x18007fbe0 to 0x18007fcc5 (229 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCRenderTexture::newCCImage @ 0x1800626be\n// > sub_180065EE0 @ 0x180065f68\n// > cocos2d::CCParticleSystem::initWithDictionary @ 0x18006a9a2\n// > cocos2d::CCSprite::setTexture @ 0x18008fd48\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801bf118\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:01 +0000\n// \n\nchar __fastcall cocos2d::CCImage::initWithImageData(\n        cocos2d::CCImage *a1,\n        char *a2,\n        __int64 a3,\n        int a4,\n        int a5,\n        int a6,\n        int a7)\n{\n  char result; // al\n  char v8; // r9\n\n  result = 0;\n  if ( a2 && (int)a3 > 0 )\n  {\n    switch ( a4 )\n    {\n      case 1:\n        return cocos2d::CCImage::_initWithPngData(a1, a2, a3);\n      case 0:\n        return cocos2d::CCImage::_initWithJpgData(a1, a2, a3);\n      case 2:\n        return cocos2d::CCImage::_initWithTiffData(a1, a2, a3);\n      case 4:\n        return cocos2d::CCImage::_initWithRawData(a1, a2, a3, a5, a6, a7, 0);\n    }\n    if ( (int)a3 <= 8 )\n    {\n      if ( (int)a3 <= 2 )\n        return result;\n    }\n    else if ( *a2 == -119\n           && a2[1] == 80\n           && a2[2] == 78\n           && a2[3] == 71\n           && a2[4] == 13\n           && a2[5] == 10\n           && a2[6] == 26\n           && a2[7] == 10 )\n    {\n      return cocos2d::CCImage::_initWithPngData(a1, a2, a3);\n    }\n    v8 = *a2;\n    if ( *a2 == 73 )\n    {\n      if ( a2[1] != 73 )\n        return result;\n      return cocos2d::CCImage::_initWithTiffData(a1, a2, a3);\n    }\n    if ( v8 == 77 )\n    {\n      if ( a2[1] != 77 )\n        return result;\n      return cocos2d::CCImage::_initWithTiffData(a1, a2, a3);\n    }\n    if ( v8 == -1 && a2[1] == -40 )\n      return cocos2d::CCImage::_initWithJpgData(a1, a2, a3);\n  }\n  return result;\n}", "assembly": "; \n; cocos2d::CCImage::initWithImageData from 0x18007fbe0 to 0x18007fcc5 (229 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCRenderTexture::newCCImage @ 0x1800626be\n; > sub_180065EE0 @ 0x180065f68\n; > cocos2d::CCParticleSystem::initWithDictionary @ 0x18006a9a2\n; > cocos2d::CCSprite::setTexture @ 0x18008fd48\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801bf118\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:01 +0000\n; \nsub     rsp, 48h                                                       ; +0x0, 0x18007fbe0\nxor     al, al                                                         ; +0x4, 0x18007fbe4\ntest    rdx, rdx                                                       ; +0x6, 0x18007fbe6\njz      loc_18007FCC0                                                  ; +0x9, 0x18007fbe9\ntest    r8d, r8d                                                       ; +0xf, 0x18007fbef\njle     loc_18007FCC0                                                  ; +0x12, 0x18007fbf2\ncmp     r9d, 1                                                         ; +0x18, 0x18007fbf8\njz      short loc_18007FC72                                            ; +0x1c, 0x18007fbfc\ntest    r9d, r9d                                                       ; +0x1e, 0x18007fbfe\njz      loc_18007FCB7                                                  ; +0x21, 0x18007fc01\ncmp     r9d, 2                                                         ; +0x27, 0x18007fc07\njz      loc_18007FCA2                                                  ; +0x2b, 0x18007fc0b\ncmp     r9d, 4                                                         ; +0x31, 0x18007fc11\njnz     short loc_18007FC3D                                            ; +0x35, 0x18007fc15\nmov     r9d, [rsp+48h+arg_20]; int                                     ; +0x37, 0x18007fc17\nmov     [rsp+48h+var_18], al; bool                                     ; +0x3c, 0x18007fc1c\nmov     eax, [rsp+48h+arg_30]                                          ; +0x40, 0x18007fc20\nmov     [rsp+48h+var_20], eax; int                                     ; +0x47, 0x18007fc27\nmov     eax, [rsp+48h+arg_28]                                          ; +0x4b, 0x18007fc2b\nmov     [rsp+48h+var_28], eax; int                                     ; +0x4f, 0x18007fc2f\ncall    ?_initWithRawData@CCImage@cocos2d@@IEAA_NPEAXHHHH_N@Z; cocos2d::CCImage::_initWithRawData(void *,int,int,int,int,bool) ; +0x53, 0x18007fc33\nadd     rsp, 48h                                                       ; +0x58, 0x18007fc38\nretn                                                                   ; +0x5c, 0x18007fc3c\ncmp     r8d, 8                                                         ; +0x5d, 0x18007fc3d\njle     short loc_18007FC7B                                            ; +0x61, 0x18007fc41\ncmp     byte ptr [rdx], 89h                                            ; +0x63, 0x18007fc43\njnz     short loc_18007FC81                                            ; +0x66, 0x18007fc46\ncmp     byte ptr [rdx+1], 50h ; 'P'                                    ; +0x68, 0x18007fc48\njnz     short loc_18007FC81                                            ; +0x6c, 0x18007fc4c\ncmp     byte ptr [rdx+2], 4Eh ; 'N'                                    ; +0x6e, 0x18007fc4e\njnz     short loc_18007FC81                                            ; +0x72, 0x18007fc52\ncmp     byte ptr [rdx+3], 47h ; 'G'                                    ; +0x74, 0x18007fc54\njnz     short loc_18007FC81                                            ; +0x78, 0x18007fc58\ncmp     byte ptr [rdx+4], 0Dh                                          ; +0x7a, 0x18007fc5a\njnz     short loc_18007FC81                                            ; +0x7e, 0x18007fc5e\ncmp     byte ptr [rdx+5], 0Ah                                          ; +0x80, 0x18007fc60\njnz     short loc_18007FC81                                            ; +0x84, 0x18007fc64\ncmp     byte ptr [rdx+6], 1Ah                                          ; +0x86, 0x18007fc66\njnz     short loc_18007FC81                                            ; +0x8a, 0x18007fc6a\ncmp     byte ptr [rdx+7], 0Ah                                          ; +0x8c, 0x18007fc6c\njnz     short loc_18007FC81                                            ; +0x90, 0x18007fc70\nadd     rsp, 48h                                                       ; +0x92, 0x18007fc72\njmp     ?_initWithPngData@CCImage@cocos2d@@IEAA_NPEAXH@Z; cocos2d::CCImage::_initWithPngData(void *,int) ; +0x96, 0x18007fc76\ncmp     r8d, 2                                                         ; +0x9b, 0x18007fc7b\njle     short loc_18007FCC0                                            ; +0x9f, 0x18007fc7f\nmovzx   r9d, byte ptr [rdx]                                            ; +0xa1, 0x18007fc81\ncmp     r9b, 49h ; 'I'                                                 ; +0xa5, 0x18007fc85\njnz     short loc_18007FC96                                            ; +0xa9, 0x18007fc89\ncmp     [rdx+1], r9b                                                   ; +0xab, 0x18007fc8b\njz      short loc_18007FCA2                                            ; +0xaf, 0x18007fc8f\nadd     rsp, 48h                                                       ; +0xb1, 0x18007fc91\nretn                                                                   ; +0xb5, 0x18007fc95\ncmp     r9b, 4Dh ; 'M'                                                 ; +0xb6, 0x18007fc96\njnz     short loc_18007FCAB                                            ; +0xba, 0x18007fc9a\ncmp     [rdx+1], r9b                                                   ; +0xbc, 0x18007fc9c\njnz     short loc_18007FCC0                                            ; +0xc0, 0x18007fca0\nadd     rsp, 48h                                                       ; +0xc2, 0x18007fca2\njmp     ?_initWithTiffData@CCImage@cocos2d@@IEAA_NPEAXH@Z; cocos2d::CCImage::_initWithTiffData(void *,int) ; +0xc6, 0x18007fca6\ncmp     r9b, 0FFh                                                      ; +0xcb, 0x18007fcab\njnz     short loc_18007FCC0                                            ; +0xcf, 0x18007fcaf\ncmp     byte ptr [rdx+1], 0D8h                                         ; +0xd1, 0x18007fcb1\njnz     short loc_18007FCC0                                            ; +0xd5, 0x18007fcb5\nadd     rsp, 48h                                                       ; +0xd7, 0x18007fcb7\njmp     ?_initWithJpgData@CCImage@cocos2d@@IEAA_NPEAXH@Z; cocos2d::CCImage::_initWithJpgData(void *,int) ; +0xdb, 0x18007fcbb\nadd     rsp, 48h                                                       ; +0xe0, 0x18007fcc0\nretn                                                                   ; +0xe4, 0x18007fcc4", "xrefs": ["cocos2d::CCRenderTexture::newCCImage @ 0x1800626be", "sub_180065EE0 @ 0x180065f68", "cocos2d::CCParticleSystem::initWithDictionary @ 0x18006a9a2", "cocos2d::CCSprite::setTexture @ 0x18008fd48", "<???> @ 0x18014cf68", "<???> @ 0x1801bf118"], "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"}