//
// capture_previous_context from 0x1406777dc to 0x140677850 (116 bytes)
//
// 3 xrefs:
// > __report_gsfailure @ 0x14067760a
// > ??> @ 0x14093269c
// > ??> @ 0x1409326a8
//
// 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
//
struct _IMAGE_RUNTIME_FUNCTION_ENTRY *__fastcall capture_previous_context(PCONTEXT ContextRecord)
{
ULONG64 Rip; // rsi
int i; // edi
struct _IMAGE_RUNTIME_FUNCTION_ENTRY *result; // rax
unsigned __int64 ImageBase; // [rsp+60h] [rbp+8h] BYREF
unsigned __int64 EstablisherFrame; // [rsp+68h] [rbp+10h] BYREF
PVOID HandlerData; // [rsp+70h] [rbp+18h] BYREF
RtlCaptureContext(ContextRecord);
Rip = ContextRecord->Rip;
for ( i = 0; i < 2; ++i )
{
result = RtlLookupFunctionEntry(Rip, &ImageBase, nullptr);
if ( !result )
break;
result = (struct _IMAGE_RUNTIME_FUNCTION_ENTRY *)RtlVirtualUnwind(
0,
ImageBase,
Rip,
result,
ContextRecord,
&HandlerData,
&EstablisherFrame,
nullptr);
}
return result;
}