//
// __scrt_acquire_startup_lock from 0x140677850 to 0x140677889 (57 bytes)
//
// 3 xrefs:
// > __scrt_common_main_seh @ 0x140677e20
// > ??> @ 0x1409326a8
// > ??> @ 0x1409326b4
//
// 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 11:36:00 +0000
//
char _scrt_acquire_startup_lock()
{
PVOID StackBase; // rcx
signed __int64 v1; // rax
if ( (unsigned int)_scrt_is_ucrt_dll_in_use() )
{
StackBase = NtCurrentTeb()->NtTib.StackBase;
while ( 1 )
{
v1 = _InterlockedCompareExchange64(&qword_1409096F8, (signed __int64)StackBase, 0);
if ( !v1 )
break;
if ( StackBase == (PVOID)v1 )
return 1;
}
}
return 0;
}