//
// EditorSFXManager::importFromString from 0x781288 to 0x781394 (268 bytes)
//
// 2 xrefs:
// > EditorSFXManager::applyConfigDirect @ 0x78142e
// > EditorSFXManager::applyMyConfig @ 0x781522
//
// 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 11:59:29 +0000
//
int __fastcall EditorSFXManager::importFromString(EditorSFXManager *a1, unsigned __int8 *a2, _DWORD *a3, int *a4)
{
int v5; // r4
int v8; // r4
int v9; // r3
size_t v10; // r3
const char *v11; // r0
int *v12; // r0
char *v13; // r1
unsigned __int8 v15[4]; // [sp+Ch] [bp-1Ch] BYREF
int v16; // [sp+10h] [bp-18h]
int v17[3]; // [sp+18h] [bp-10h] BYREF
v5 = *a2;
if ( (v5 & 1) != 0 )
v8 = *((_DWORD *)a2 + 1);
else
v8 = v5 >> 1;
if ( v8 )
{
cocos2d::ZipUtils::decompressString(v15, a2, 0, 0);
if ( (v15[0] & 1) != 0 )
v9 = v16;
else
v9 = (int)v15[0] >> 1;
if ( !v9 )
{
if ( a4 )
std::string::assign(a4, "Invalid or corrupt share string.");
v8 = 0;
goto LABEL_29;
}
v10 = std::string::find(v15, 59, 0);
if ( v10 == -1 )
std::string::basic_string(v17, (int)v15);
else
std::string::basic_string(v17, v15, 0, v10);
if ( (v17[0] & 1) != 0 )
v11 = (const char *)v17[2];
else
v11 = (char *)v17 + 1;
if ( (unsigned int)(atoi(v11) - 1) <= 1 )
{
v8 = EditorSFXManager::deserializeAll(a1, v15, *a3 == 0);
if ( v8 )
goto LABEL_28;
if ( !a4 )
{
LABEL_22:
v8 = 0;
LABEL_28:
std::string::~string((int)v17);
LABEL_29:
std::string::~string((int)v15);
return v8;
}
v12 = a4;
v13 = "Parse error.";
}
else
{
if ( !a4 )
goto LABEL_22;
v12 = a4;
v13 = "Invalid or corrupt share string.";
}
std::string::assign(v12, v13);
goto LABEL_22;
}
if ( !a4 )
return 0;
std::string::assign(a4, "Empty string.");
return v8;
}