//
// __scrt_fastfail from 0x180123b84 to 0x180123ccf (331 bytes)
//
// 5 xrefs:
// > __scrt_initialize_onexit_tables @ 0x1801206e1
// > __scrt_initialize_thread_safe_statics @ 0x1801208ee
// > dllmain_crt_process_attach @ 0x180120beb
// > dllmain_crt_process_detach @ 0x180120c70
// > ??> @ 0x1802025e8
//
// 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
//
void __fastcall _scrt_fastfail(unsigned int a1)
{
ULONG64 Rip; // rbx
struct _IMAGE_RUNTIME_FUNCTION_ENTRY *v3; // rax
bool v4; // bl
struct _EXCEPTION_POINTERS ExceptionInfo; // [rsp+40h] [rbp-C0h] BYREF
_QWORD v6[20]; // [rsp+50h] [rbp-B0h] BYREF
struct _CONTEXT ContextRecord; // [rsp+F0h] [rbp-10h] BYREF
DWORD64 retaddr; // [rsp+5C8h] [rbp+4C8h]
__int64 v9; // [rsp+5D0h] [rbp+4D0h] BYREF
unsigned __int64 ImageBase; // [rsp+5D8h] [rbp+4D8h] BYREF
unsigned __int64 EstablisherFrame; // [rsp+5E0h] [rbp+4E0h] BYREF
PVOID HandlerData; // [rsp+5E8h] [rbp+4E8h] BYREF
if ( IsProcessorFeaturePresent(0x17u) )
__fastfail(a1);
sub_180123B7C();
memset(&ContextRecord, 0, sizeof(ContextRecord));
RtlCaptureContext(&ContextRecord);
Rip = ContextRecord.Rip;
v3 = RtlLookupFunctionEntry(ContextRecord.Rip, &ImageBase, nullptr);
if ( v3 )
RtlVirtualUnwind(0, ImageBase, Rip, v3, &ContextRecord, &HandlerData, &EstablisherFrame, nullptr);
ContextRecord.Rip = retaddr;
ContextRecord.Rsp = (DWORD64)&v9;
memset(v6, 0, 0x98u);
v6[2] = retaddr;
v6[0] = 0x140000015LL;
ExceptionInfo.ExceptionRecord = (PEXCEPTION_RECORD)v6;
v4 = IsDebuggerPresent();
ExceptionInfo.ContextRecord = &ContextRecord;
SetUnhandledExceptionFilter(nullptr);
if ( !UnhandledExceptionFilter(&ExceptionInfo) && !v4 )
sub_180123B7C();
}