//
// cocos2d::CCImage::initWithImageData from 0x7ebc82 to 0x7ebd46 (196 bytes)
//
// 7 xrefs:
// > cocos2d::CCRenderTexture::newCCImage @ 0x7e0e66
// > sub_7E10F8 @ 0x7e112e
// > cocos2d::CCParticleSystem::initWithDictionary @ 0x7e54b0
// > cocos2d::CCImage::initWithImageFileThreadSafe @ 0x7ebd8e
// > cocos2d::CCImage::initWithImageFile @ 0x7ec264
// > cocos2d::CCSprite::setTexture @ 0x7f1100
// > cocos2d::VolatileTexture::reloadAllTextures @ 0x80158c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:01:00 +0000
//
int __fastcall cocos2d::CCImage::initWithImageData(
cocos2d::CCImage *this,
int *a2,
int a3,
int a4,
int a5,
int a6,
int a7)
{
int v8; // r3
bool v9; // zf
if ( !a2 || a3 <= 0 )
return 0;
switch ( a4 )
{
case 1:
return cocos2d::CCImage::_initWithPngData(this, a2, a3);
case 0:
return cocos2d::CCImage::_initWithJpgData(this, a2, a3);
case 2:
return cocos2d::CCImage::_initWithTiffData(this, a2, a3);
case 4:
return cocos2d::CCImage::_initWithRawData(this, a2, a3, a5, a6, a7, 0);
}
if ( a3 <= 8 )
{
if ( a3 <= 2 )
return 0;
}
else if ( *(unsigned __int8 *)a2 == 137
&& *((_BYTE *)a2 + 1) == 80
&& *((_BYTE *)a2 + 2) == 78
&& *((_BYTE *)a2 + 3) == 71
&& *((_BYTE *)a2 + 4) == 13
&& *((_BYTE *)a2 + 5) == 10
&& *((_BYTE *)a2 + 6) == 26
&& *((_BYTE *)a2 + 7) == 10 )
{
return cocos2d::CCImage::_initWithPngData(this, a2, a3);
}
v8 = *(unsigned __int8 *)a2;
if ( v8 == 73 )
{
v9 = *((_BYTE *)a2 + 1) == 73;
goto LABEL_26;
}
if ( v8 == 77 )
{
v9 = *((_BYTE *)a2 + 1) == 77;
LABEL_26:
if ( v9 )
return cocos2d::CCImage::_initWithTiffData(this, a2, a3);
return 0;
}
if ( v8 == 255 && *((unsigned __int8 *)a2 + 1) == 216 )
return cocos2d::CCImage::_initWithJpgData(this, a2, a3);
return 0;
}