//
// FileOperation::readFile from 0xb41684 to 0xb417a4 (288 bytes)
//
// 1 xrefs:
// > ??> @ 0xae690
//
// 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
//
void FileOperation::readFile()
{
FILE *v0; // x0
FILE *v1; // x20
char *v2; // x2
char *v3; // x0
unsigned int *v4; // x2
int v5; // w1
unsigned int *v6; // x2
char *filename; // [xsp+28h] [xbp+28h] BYREF
char s[8]; // [xsp+30h] [xbp+30h] BYREF
__int64 v9; // [xsp+38h] [xbp+38h]
__int64 v10; // [xsp+40h] [xbp+40h]
__int64 v11; // [xsp+48h] [xbp+48h]
__int64 v12; // [xsp+50h] [xbp+50h]
__int64 v13; // [xsp+58h] [xbp+58h]
__int16 v14; // [xsp+60h] [xbp+60h]
FileOperation::getFilePath(_stack_chk_guard, (__int64)&filename);
v0 = fopen(filename, "r");
v14 = 0;
*(_QWORD *)s = 0;
v9 = 0;
v10 = 0;
v11 = 0;
v12 = 0;
v13 = 0;
v1 = v0;
if ( v0 )
{
fgets(s, 50, v0);
fclose(v1);
v2 = filename;
v3 = filename - 24;
if ( filename - 24 == (char *)&qword_124B6B0 )
return;
if ( &pthread_create )
{
v6 = (unsigned int *)(filename - 8);
do
v5 = __ldaxr(v6);
while ( __stlxr(v5 - 1, v6) );
goto LABEL_12;
}
}
else
{
v2 = filename;
v3 = filename - 24;
if ( filename - 24 == (char *)&qword_124B6B0 )
return;
if ( &pthread_create )
{
v4 = (unsigned int *)(filename - 8);
do
v5 = __ldaxr(v4);
while ( __stlxr(v5 - 1, v4) );
goto LABEL_12;
}
}
v5 = *((_DWORD *)v2 - 2);
*((_DWORD *)v2 - 2) = v5 - 1;
LABEL_12:
if ( v5 <= 0 )
operator delete(v3);
}