//
// dllmain_crt_process_detach from 0x1800dfe44 to 0x1800dfec4 (128 bytes)
//
// 4 xrefs:
// > ??> @ 0x1800dfe43
// > dllmain_crt_dispatch @ 0x1800dfd27
// > dllmain_dispatch @ 0x1800dff75
// > ??> @ 0x1801bb100
//
// 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
//
__int64 __fastcall dllmain_crt_process_detach(char a1)
{
char v3; // bl
__int64 v4; // rcx
cocos2d::CCComponent *v5; // rcx
unsigned int v6; // ebx
void *v7; // rdx
__int64 v8; // rcx
unsigned int v9; // edx
HINSTANCE v10; // rcx
void *const v11; // r8
if ( dword_1801AC704 <= 0 )
return 0;
--dword_1801AC704;
v3 = _scrt_acquire_startup_lock();
if ( dword_1801AC6B8 == 2 )
{
_scrt_dllmain_uninitialize_c();
sub_1800DF74C();
sub_1800E04A4(v4);
dword_1801AC6B8 = 0;
_scrt_release_startup_lock(v3);
LOBYTE(v5) = a1;
v6 = (unsigned __int8)_scrt_uninitialize_crt(v5, nullptr);
_scrt_dllmain_uninitialize_critical(v8, v7);
return v6;
}
else
{
_scrt_fastfail(7);
__debugbreak();
return dllmain_dispatch(v10, v9, v11);
}
}