//
// stream_is_at_end_of_file_nolock from 0x18013f674 to 0x18013f6ed (121 bytes)
//
// 4 xrefs:
// > unknown_libname_72 @ 0x18013f744
// > unknown_libname_73 @ 0x18013f7fe
// > ??> @ 0x180203b84
// > ??> @ 0x180203b90
//
// 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:55:04 +0000
//
bool __fastcall stream_is_at_end_of_file_nolock(__int64 a1)
{
void *osfhandle; // rax
void *v3; // rbx
LARGE_INTEGER FileSize; // [rsp+30h] [rbp+8h] BYREF
LARGE_INTEGER NewFilePointer; // [rsp+38h] [rbp+10h] BYREF
if ( (*(_DWORD *)(a1 + 20) & 8) != 0 )
return 1;
if ( (*(_DWORD *)(a1 + 20) & 0xC0) != 0 && *(_QWORD *)a1 == *(_QWORD *)(a1 + 8) )
return 0;
osfhandle = (void *)get_osfhandle(*(_DWORD *)(a1 + 24));
v3 = osfhandle;
if ( osfhandle == (void *)-1LL
|| !SetFilePointerEx(osfhandle, 0, &NewFilePointer, 1u)
|| !GetFileSizeEx(v3, &FileSize) )
{
return 0;
}
return NewFilePointer.QuadPart == FileSize.QuadPart;
}