//
// cocos2d::CCString::createWithData from 0xd46628 to 0xd46768 (320 bytes)
//
// 2 xrefs:
// > cocos2d::CCString::createWithContentsOfFile @ 0xd467c4
// > ??> @ 0x77a70
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:07:34 +0000
//
cocos2d::CCObject *__fastcall cocos2d::CCString::createWithData(cocos2d::CCString *this, const unsigned __int8 *a2)
{
char *v4; // x0
char *v5; // x19
size_t v6; // x0
size_t v7; // x20
char *v8; // x3
cocos2d::CCObject *v9; // x20
unsigned __int64 v11; // x0
__int64 v12; // [xsp+40h] [xbp+40h] BYREF
size_t v13; // [xsp+48h] [xbp+48h]
void *v14; // [xsp+50h] [xbp+50h]
if ( !this )
return nullptr;
v4 = (char *)malloc((size_t)(a2 + 1));
v5 = v4;
if ( !v4 )
return nullptr;
a2[(_QWORD)v4] = 0;
if ( a2 )
memcpy(v4, this, (size_t)a2);
v12 = 0;
v13 = 0;
v14 = nullptr;
v6 = strlen(v5);
v7 = v6;
if ( v6 > 0x16 )
{
v11 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v12 = v11 | 1;
v8 = (char *)operator new(v11);
v14 = v8;
v13 = v7;
LABEL_11:
*((_BYTE *)memcpy(v8, v5, v7) + v7) = 0;
v9 = cocos2d::CCString::create(&v12);
if ( (v12 & 1) == 0 )
goto LABEL_8;
LABEL_12:
operator delete(v14);
goto LABEL_8;
}
LOBYTE(v12) = 2 * v6;
v8 = (char *)&v12 + 1;
if ( v6 )
goto LABEL_11;
BYTE1(v12) = 0;
v9 = cocos2d::CCString::create(&v12);
if ( (v12 & 1) != 0 )
goto LABEL_12;
LABEL_8:
free(v5);
return v9;
}