//
// __scrt_acquire_startup_lock from 0x18001f390 to 0x18001f3c9 (57 bytes)
//
// 3 xrefs:
// > dllmain_crt_process_attach @ 0x18001f8c2
// > dllmain_crt_process_detach @ 0x18001f9dc
// > ??> @ 0x18004b178
//
// 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
//
char _scrt_acquire_startup_lock()
{
int v0; // eax
PVOID StackBase; // rcx
signed __int64 v2; // rax
LOBYTE(v0) = __uncaught_exception();
if ( v0 )
{
StackBase = NtCurrentTeb()->NtTib.StackBase;
while ( 1 )
{
v2 = _InterlockedCompareExchange64(&qword_180047FF8, (signed __int64)StackBase, 0);
if ( !v2 )
break;
if ( StackBase == (PVOID)v2 )
return 1;
}
}
return 0;
}