//
// capture_current_context from 0x1801201c8 to 0x180120235 (109 bytes)
//
// 3 xrefs:
// > __report_securityfailure @ 0x180120152
// > ??> @ 0x180202444
// > ??> @ 0x180202450
//
// 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
//
struct _IMAGE_RUNTIME_FUNCTION_ENTRY *__fastcall capture_current_context(PCONTEXT ContextRecord)
{
ULONG64 Rip; // rdi
struct _IMAGE_RUNTIME_FUNCTION_ENTRY *result; // rax
unsigned __int64 ImageBase; // [rsp+50h] [rbp+8h] BYREF
unsigned __int64 EstablisherFrame; // [rsp+58h] [rbp+10h] BYREF
PVOID HandlerData; // [rsp+60h] [rbp+18h] BYREF
RtlCaptureContext(ContextRecord);
Rip = ContextRecord->Rip;
result = RtlLookupFunctionEntry(Rip, &ImageBase, nullptr);
if ( result )
return (struct _IMAGE_RUNTIME_FUNCTION_ENTRY *)RtlVirtualUnwind(
0,
ImageBase,
Rip,
result,
ContextRecord,
&HandlerData,
&EstablisherFrame,
nullptr);
return result;
}