{"type": "func", "start": 6442961408, "end": 6442961639, "name": "cocos2d::CCImage::initWithImageData", "pseudocode": "// \n// cocos2d::CCImage::initWithImageData from 0x18007ca00 to 0x18007cae7 (231 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCRenderTexture::newCCImage @ 0x18006049e\n// > sub_180063AC0 @ 0x180063b46\n// > cocos2d::CCParticleSystem::initWithDictionary @ 0x180068870\n// > cocos2d::CCSprite::setTexture @ 0x18008cb3c\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b4e3c\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\nchar __fastcall cocos2d::CCImage::initWithImageData(\n        cocos2d::CCImage *this,\n        char *a2,\n        __int64 a3,\n        enum cocos2d::CCImage::EImageFormat a4,\n        int a5,\n        int a6,\n        int a7)\n{\n  char v7; // r10\n  char v9; // r9\n  _BYTE *v10; // rax\n\n  v7 = 0;\n  if ( !a2 || (int)a3 <= 0 )\n    return v7;\n  if ( a4 == kFmtPng )\n    return cocos2d::CCImage::_initWithPngData(this, a2, a3);\n  if ( a4 == kFmtJpg )\n    return cocos2d::CCImage::_initWithJpgData(this, a2, a3);\n  if ( a4 != kFmtTiff )\n  {\n    if ( a4 == kFmtRawData )\n      return cocos2d::CCImage::_initWithRawData(this, a2, a3, a5, a6, a7, 0);\n    if ( (int)a3 <= 8 )\n    {\n      if ( (int)a3 <= 2 )\n        return v7;\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(this, a2, a3);\n    }\n    v9 = *a2;\n    v10 = a2 + 1;\n    if ( *a2 == 73 )\n    {\n      if ( *v10 != 73 )\n      {\nLABEL_21:\n        if ( v9 != -1 || *v10 != 0xD8 )\n          return v7;\n        return cocos2d::CCImage::_initWithJpgData(this, a2, a3);\n      }\n    }\n    else\n    {\n      if ( v9 != 77 )\n        goto LABEL_21;\n      if ( *v10 != 77 )\n        return v7;\n    }\n  }\n  return cocos2d::CCImage::_initWithTiffData(this, a2, a3);\n}", "assembly": "; \n; cocos2d::CCImage::initWithImageData from 0x18007ca00 to 0x18007cae7 (231 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCRenderTexture::newCCImage @ 0x18006049e\n; > sub_180063AC0 @ 0x180063b46\n; > cocos2d::CCParticleSystem::initWithDictionary @ 0x180068870\n; > cocos2d::CCSprite::setTexture @ 0x18008cb3c\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b4e3c\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\nsub     rsp, 48h                                                       ; +0x0, 0x18007ca00\nxor     r10b, r10b                                                     ; +0x4, 0x18007ca04\ntest    rdx, rdx                                                       ; +0x7, 0x18007ca07\njz      loc_18007CACA                                                  ; +0xa, 0x18007ca0a\ntest    r8d, r8d                                                       ; +0x10, 0x18007ca10\njle     loc_18007CACA                                                  ; +0x13, 0x18007ca13\ncmp     r9d, 1                                                         ; +0x19, 0x18007ca19\njz      short loc_18007CA94                                            ; +0x1d, 0x18007ca1d\ntest    r9d, r9d                                                       ; +0x1f, 0x18007ca1f\njz      loc_18007CAC1                                                  ; +0x22, 0x18007ca22\ncmp     r9d, 2                                                         ; +0x28, 0x18007ca28\njz      loc_18007CADE                                                  ; +0x2c, 0x18007ca2c\ncmp     r9d, 4                                                         ; +0x32, 0x18007ca32\njnz     short loc_18007CA5F                                            ; +0x36, 0x18007ca36\nmov     eax, [rsp+48h+arg_30]                                          ; +0x38, 0x18007ca38\nmov     r9d, [rsp+48h+arg_20]; int                                     ; +0x3f, 0x18007ca3f\nmov     [rsp+48h+var_18], r10b; bool                                   ; +0x44, 0x18007ca44\nmov     [rsp+48h+var_20], eax; int                                     ; +0x49, 0x18007ca49\nmov     eax, [rsp+48h+arg_28]                                          ; +0x4d, 0x18007ca4d\nmov     [rsp+48h+var_28], eax; int                                     ; +0x51, 0x18007ca51\ncall    ?_initWithRawData@CCImage@cocos2d@@IEAA_NPEAXHHHH_N@Z; cocos2d::CCImage::_initWithRawData(void *,int,int,int,int,bool) ; +0x55, 0x18007ca55\nadd     rsp, 48h                                                       ; +0x5a, 0x18007ca5a\nretn                                                                   ; +0x5e, 0x18007ca5e\ncmp     r8d, 8                                                         ; +0x5f, 0x18007ca5f\njle     short loc_18007CA9D                                            ; +0x63, 0x18007ca63\ncmp     byte ptr [rdx], 89h                                            ; +0x65, 0x18007ca65\njnz     short loc_18007CAA3                                            ; +0x68, 0x18007ca68\ncmp     byte ptr [rdx+1], 50h ; 'P'                                    ; +0x6a, 0x18007ca6a\njnz     short loc_18007CAA3                                            ; +0x6e, 0x18007ca6e\ncmp     byte ptr [rdx+2], 4Eh ; 'N'                                    ; +0x70, 0x18007ca70\njnz     short loc_18007CAA3                                            ; +0x74, 0x18007ca74\ncmp     byte ptr [rdx+3], 47h ; 'G'                                    ; +0x76, 0x18007ca76\njnz     short loc_18007CAA3                                            ; +0x7a, 0x18007ca7a\ncmp     byte ptr [rdx+4], 0Dh                                          ; +0x7c, 0x18007ca7c\njnz     short loc_18007CAA3                                            ; +0x80, 0x18007ca80\ncmp     byte ptr [rdx+5], 0Ah                                          ; +0x82, 0x18007ca82\njnz     short loc_18007CAA3                                            ; +0x86, 0x18007ca86\ncmp     byte ptr [rdx+6], 1Ah                                          ; +0x88, 0x18007ca88\njnz     short loc_18007CAA3                                            ; +0x8c, 0x18007ca8c\ncmp     byte ptr [rdx+7], 0Ah                                          ; +0x8e, 0x18007ca8e\njnz     short loc_18007CAA3                                            ; +0x92, 0x18007ca92\nadd     rsp, 48h                                                       ; +0x94, 0x18007ca94\njmp     ?_initWithPngData@CCImage@cocos2d@@IEAA_NPEAXH@Z; cocos2d::CCImage::_initWithPngData(void *,int) ; +0x98, 0x18007ca98\ncmp     r8d, 2                                                         ; +0x9d, 0x18007ca9d\njle     short loc_18007CACA                                            ; +0xa1, 0x18007caa1\nmovzx   r9d, byte ptr [rdx]                                            ; +0xa3, 0x18007caa3\nlea     rax, [rdx+1]                                                   ; +0xa7, 0x18007caa7\ncmp     r9b, 49h ; 'I'                                                 ; +0xab, 0x18007caab\njnz     short loc_18007CAD3                                            ; +0xaf, 0x18007caaf\ncmp     [rax], r9b                                                     ; +0xb1, 0x18007cab1\njz      short loc_18007CADE                                            ; +0xb4, 0x18007cab4\ncmp     r9b, 0FFh                                                      ; +0xb6, 0x18007cab6\njnz     short loc_18007CACA                                            ; +0xba, 0x18007caba\ncmp     byte ptr [rax], 0D8h                                           ; +0xbc, 0x18007cabc\njnz     short loc_18007CACA                                            ; +0xbf, 0x18007cabf\ncall    ?_initWithJpgData@CCImage@cocos2d@@IEAA_NPEAXH@Z; cocos2d::CCImage::_initWithJpgData(void *,int) ; +0xc1, 0x18007cac1\nmovzx   r10d, al                                                       ; +0xc6, 0x18007cac6\nmovzx   eax, r10b                                                      ; +0xca, 0x18007caca\nadd     rsp, 48h                                                       ; +0xce, 0x18007cace\nretn                                                                   ; +0xd2, 0x18007cad2\ncmp     r9b, 4Dh ; 'M'                                                 ; +0xd3, 0x18007cad3\njnz     short loc_18007CAB6                                            ; +0xd7, 0x18007cad7\ncmp     [rax], r9b                                                     ; +0xd9, 0x18007cad9\njnz     short loc_18007CACA                                            ; +0xdc, 0x18007cadc\nadd     rsp, 48h                                                       ; +0xde, 0x18007cade\njmp     ?_initWithTiffData@CCImage@cocos2d@@IEAA_NPEAXH@Z; cocos2d::CCImage::_initWithTiffData(void *,int) ; +0xe2, 0x18007cae2", "xrefs": ["cocos2d::CCRenderTexture::newCCImage @ 0x18006049e", "sub_180063AC0 @ 0x180063b46", "cocos2d::CCParticleSystem::initWithDictionary @ 0x180068870", "cocos2d::CCSprite::setTexture @ 0x18008cb3c", "<???> @ 0x1801438a8", "<???> @ 0x1801b4e3c"], "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"}