// // cocos2d::CCImage::initWithImageFile from 0x18007caf0 to 0x18007cca5 (437 bytes) // // 4 xrefs: // > cocos2d::CCTextureCache::addImage @ 0x1800a7d41 // > cocos2d::CCTextureCache::reloadTexture @ 0x1800a97ac // > @ 0x1801438a8 // > @ 0x1801b4e48 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // // Hidden C++ exception states: #wind=1 __int64 __fastcall cocos2d::CCImage::initWithImageFile( cocos2d::CCImage *this, const char *a2, enum cocos2d::CCImage::EImageFormat a3) { unsigned __int8 v6; // di struct cocos2d::CCFileUtils *v7; // rax struct cocos2d::CCFileUtils *v8; // rax void **v9; // rdx __int64 v10; // rax _BYTE *v11; // rbx unsigned __int8 v12; // al char v13; // al void *v14; // rcx int v16; // [rsp+20h] [rbp-48h] BYREF void *Block[3]; // [rsp+28h] [rbp-40h] BYREF unsigned __int64 v18; // [rsp+40h] [rbp-28h] v6 = 0; v16 = 0; v7 = cocos2d::CCFileUtils::sharedFileUtils(); ((void (__fastcall *)(struct cocos2d::CCFileUtils *, void **, const char *, _QWORD))v7->createCCArrayWithContentsOfFile)( v7, Block, a2, 0); v8 = cocos2d::CCFileUtils::sharedFileUtils(); v9 = Block; if ( v18 > 0xF ) v9 = (void **)Block[0]; v10 = ((__int64 (__fastcall *)(struct cocos2d::CCFileUtils *, void **, const char *, int *))v8->addSearchResolutionsOrder)( v8, v9, "rb", &v16); v11 = (_BYTE *)v10; if ( v10 ) { if ( v16 <= 0 ) goto LABEL_27; switch ( a3 ) { case kFmtPng: LABEL_6: v12 = cocos2d::CCImage::_initWithPngData(this, (_QWORD *)v10, v16); LABEL_26: v6 = v12; goto LABEL_27; case kFmtJpg: LABEL_25: v12 = cocos2d::CCImage::_initWithJpgData(this, v11, v16); goto LABEL_26; case kFmtTiff: v12 = cocos2d::CCImage::_initWithTiffData(this, (void *)v10, v16); goto LABEL_26; case kFmtRawData: goto LABEL_27; } if ( v16 > 8 && *(_BYTE *)v10 == 0x89 && *(_BYTE *)(v10 + 1) == 80 && *(_BYTE *)(v10 + 2) == 78 && *(_BYTE *)(v10 + 3) == 71 && *(_BYTE *)(v10 + 4) == 13 && *(_BYTE *)(v10 + 5) == 10 && *(_BYTE *)(v10 + 6) == 26 && *(_BYTE *)(v10 + 7) == 10 ) { goto LABEL_6; } if ( v16 <= 2 ) { LABEL_27: j_j_free_0(v11); goto LABEL_28; } v13 = *(_BYTE *)v10; if ( v13 == 73 ) { if ( v11[1] != 73 ) { LABEL_23: if ( v13 != -1 || v11[1] != 0xD8 ) goto LABEL_27; goto LABEL_25; } } else { if ( v13 != 77 ) goto LABEL_23; if ( v11[1] != 77 ) goto LABEL_27; } v12 = cocos2d::CCImage::_initWithTiffData(this, v11, v16); goto LABEL_26; } LABEL_28: if ( v18 > 0xF ) { v14 = Block[0]; if ( v18 + 1 >= 0x1000 ) { v14 = *((void **)Block[0] - 1); if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v14); } return v6; }
GD Web Decomp Icon

GD Web Decomp

Raw Source