//
// cocos2d::CCFileUtils::writeToFile from 0x5dec50 to 0x5decfa (170 bytes)
//
// 0 xrefs:
//
// 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
//
bool __fastcall cocos2d::CCFileUtils::writeToFile(int a1, int a2, const char **a3)
{
tinyxml2::XMLDocument *v5; // r5
tinyxml2::XMLNode *v6; // r0
_BOOL4 v7; // r4
tinyxml2::XMLNode *v8; // r0
tinyxml2::XMLElement *v9; // r6
tinyxml2::XMLAttribute *Attribute; // r0
tinyxml2::XMLNode *v12; // r0
v5 = (tinyxml2::XMLDocument *)operator new(0x174u);
tinyxml2::XMLDocument::XMLDocument(v5, 1, 0);
v6 = (tinyxml2::XMLNode *)tinyxml2::XMLDocument::NewDeclaration(v5, "xml version=\"1.0\" encoding=\"UTF-8\"");
v7 = (_BOOL4)v6;
if ( v6 )
{
tinyxml2::XMLNode::InsertEndChild(v5, v6);
v8 = (tinyxml2::XMLNode *)tinyxml2::XMLDocument::NewElement(
v5,
"!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/Proper"
"tyList-1.0.dtd\"");
tinyxml2::XMLNode::InsertEndChild(v5, v8);
v9 = (tinyxml2::XMLElement *)tinyxml2::XMLDocument::NewElement(v5, "plist");
Attribute = (tinyxml2::XMLAttribute *)tinyxml2::XMLElement::FindOrCreateAttribute(v9, "version");
tinyxml2::XMLAttribute::SetAttribute(Attribute, "1.0");
if ( !v9 )
{
(*(void (__fastcall **)(tinyxml2::XMLDocument *))(*(_DWORD *)v5 + 68))(v5);
return 0;
}
tinyxml2::XMLNode::InsertEndChild(v5, v9);
v12 = sub_5DEBD0(a2, v5);
v7 = (_BOOL4)v12;
if ( v12 )
{
tinyxml2::XMLNode::InsertEndChild(v9, v12);
v7 = tinyxml2::XMLDocument::SaveFile(v5, *a3, 0) == 0;
}
}
(*(void (__fastcall **)(tinyxml2::XMLDocument *))(*(_DWORD *)v5 + 68))(v5);
return v7;
}