//
// _stat64i32 from 0x180129854 to 0x180129952 (254 bytes)
//
// 3 xrefs:
// > sub_180020140 @ 0x180020395
// > sub_180020140 @ 0x1800203da
// > ??> @ 0x180202abc
//
// This function is hookable on this platform (idp: pc, 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 10:54:56 +0000
//
int __cdecl stat64i32(const char *FileName, struct _stat64i32 *Stat)
{
int v4; // ebx
unsigned int v5; // r8d
_QWORD v7[3]; // [rsp+20h] [rbp-50h] BYREF
char v8; // [rsp+38h] [rbp-38h]
_QWORD v9[2]; // [rsp+40h] [rbp-30h] BYREF
void *Block; // [rsp+50h] [rbp-20h]
__int64 v11; // [rsp+58h] [rbp-18h]
__int64 v12; // [rsp+60h] [rbp-10h]
char v13; // [rsp+68h] [rbp-8h]
if ( !FileName )
return common_stat<_stat64i32>(nullptr, (__int64)Stat);
v9[0] = 0;
v9[1] = 0;
Block = nullptr;
v11 = 0;
v12 = 0;
v13 = 0;
_LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)v7, nullptr);
v5 = 65001;
if ( *(_DWORD *)(v7[1] + 12LL) == 65001 )
{
if ( v8 )
*(_DWORD *)(v7[0] + 936LL) &= ~2u;
}
else if ( (unsigned int)_acrt_AreFileApisANSI() )
{
if ( v8 )
*(_DWORD *)(v7[0] + 936LL) &= ~2u;
v5 = 0;
}
else
{
if ( v8 )
*(_DWORD *)(v7[0] + 936LL) &= ~2u;
v5 = 1;
}
if ( (unsigned int)__acrt_mbs_to_wcs_cp<__crt_win32_buffer_internal_dynamic_resizing>(FileName, (__int64)v9, v5) )
{
if ( v13 )
free_base(Block);
return -1;
}
else
{
v4 = common_stat<_stat64i32>((wchar_t *)Block, (__int64)Stat);
if ( v13 )
free_base(Block);
}
return v4;
}