//
// AutoSaveSettingsLayer::getBackupDirectory from 0x6e6ff0 to 0x6e7124 (308 bytes)
//
// 2 xrefs:
// > AutoSaveSettingsLayer::openBackupDirectory @ 0x6e7142
// > AutoBackupPopup::backupDirectory @ 0x73caf4
//
// 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:57:25 +0000
//
AutoSaveSettingsLayer *__fastcall AutoSaveSettingsLayer::getBackupDirectory(AutoSaveSettingsLayer *this)
{
int v2; // r3
int v3; // r0
int v4; // r1
int v5; // r2
int v7; // r3
unsigned int v8; // r1
int v9; // r8
char *v10; // r9
int v11; // r0
int v12; // r1
char *v13; // r2
char *v14; // r0
int v15; // r0
int v16; // r1
char *v17; // r2
int v18; // [sp+10h] [bp-2Ch] BYREF
int v19; // [sp+14h] [bp-28h]
int v20; // [sp+18h] [bp-24h]
int v21; // [sp+1Ch] [bp-20h] BYREF
int v22; // [sp+20h] [bp-1Ch]
char *path; // [sp+24h] [bp-18h]
int v24; // [sp+28h] [bp-14h] BYREF
int v25; // [sp+2Ch] [bp-10h]
char *v26; // [sp+30h] [bp-Ch]
AutoSaveSettingsLayer::getCustomBackupDirectory((AutoSaveSettingsLayer *)&v18);
if ( (v18 & 1) != 0 )
v2 = v19;
else
v2 = (int)(unsigned __int8)v18 >> 1;
if ( v2 && GameToolbox::directoryExists((int)&v18) )
{
v3 = v18;
v4 = v19;
v5 = v20;
v18 = 0;
v19 = 0;
v20 = 0;
*(_DWORD *)this = v3;
*((_DWORD *)this + 1) = v4;
*((_DWORD *)this + 2) = v5;
}
else
{
GameToolbox::getSaveDirectory((GameToolbox *)&v24);
if ( (v24 & 1) != 0 )
{
v7 = v25;
v8 = (v24 & 0xFFFFFFFE) - 1;
}
else
{
v7 = (int)(unsigned __int8)v24 >> 1;
v8 = 10;
}
v9 = v7 + 12;
if ( v8 - v7 <= 0xB )
{
std::string::__grow_by_and_replace((int)&v24, v8, v9 - v8, v7, v7, 0, 0xCu, "auto_backups");
}
else
{
if ( (v24 & 1) != 0 )
v10 = v26;
else
v10 = (char *)&v24 + 1;
std::char_traits::copy(&v10[v7], "auto_backups", 0xCu);
if ( (v24 & 1) != 0 )
v25 = v9;
else
LOBYTE(v24) = 2 * v9;
v10[v9] = 0;
}
v11 = v24;
v12 = v25;
v13 = v26;
v24 = 0;
v25 = 0;
v26 = nullptr;
v21 = v11;
v22 = v12;
path = v13;
std::string::~string((int)&v24);
if ( (v21 & 1) != 0 )
v14 = path;
else
v14 = (char *)&v21 + 1;
mkdir(v14, 0x1EDu);
v15 = v21;
v16 = v22;
v17 = path;
v21 = 0;
v22 = 0;
path = nullptr;
*(_DWORD *)this = v15;
*((_DWORD *)this + 1) = v16;
*((_DWORD *)this + 2) = v17;
std::string::~string((int)&v21);
}
std::string::~string((int)&v18);
return this;
}