{"type": "func", "start": 6442580664, "end": 6442580780, "name": "capture_previous_context", "pseudocode": "// \n// capture_previous_context from 0x18001fab8 to 0x18001fb2c (116 bytes)\n// \n// 2 xrefs:\n// > __report_gsfailure @ 0x18001fa0a\n// > <???> @ 0x18004d160\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:15:45 +0000\n// \n\nstruct _IMAGE_RUNTIME_FUNCTION_ENTRY *__fastcall capture_previous_context(PCONTEXT ContextRecord)\n{\n  ULONG64 Rip; // rsi\n  int i; // edi\n  struct _IMAGE_RUNTIME_FUNCTION_ENTRY *result; // rax\n  unsigned __int64 ImageBase; // [rsp+60h] [rbp+8h] BYREF\n  unsigned __int64 EstablisherFrame; // [rsp+68h] [rbp+10h] BYREF\n  PVOID HandlerData; // [rsp+70h] [rbp+18h] BYREF\n\n  RtlCaptureContext(ContextRecord);\n  Rip = ContextRecord->Rip;\n  for ( i = 0; i < 2; ++i )\n  {\n    result = RtlLookupFunctionEntry(Rip, &ImageBase, nullptr);\n    if ( !result )\n      break;\n    result = (struct _IMAGE_RUNTIME_FUNCTION_ENTRY *)RtlVirtualUnwind(\n                                                       0,\n                                                       ImageBase,\n                                                       Rip,\n                                                       result,\n                                                       ContextRecord,\n                                                       &HandlerData,\n                                                       &EstablisherFrame,\n                                                       nullptr);\n  }\n  return result;\n}", "assembly": "; \n; capture_previous_context from 0x18001fab8 to 0x18001fb2c (116 bytes)\n; \n; 2 xrefs:\n; > __report_gsfailure @ 0x18001fa0a\n; > <???> @ 0x18004d160\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:15:45 +0000\n; \npush    rbx                                                            ; +0x0, 0x18001fab8\npush    rsi                                                            ; +0x2, 0x18001faba\npush    rdi                                                            ; +0x3, 0x18001fabb\nsub     rsp, 40h                                                       ; +0x4, 0x18001fabc\nmov     rbx, rcx                                                       ; +0x8, 0x18001fac0\ncall    cs:RtlCaptureContext                                           ; +0xb, 0x18001fac3\nmov     rsi, [rbx+0F8h]                                                ; +0x11, 0x18001fac9\nxor     edi, edi                                                       ; +0x18, 0x18001fad0\nxor     r8d, r8d; HistoryTable                                         ; +0x1a, 0x18001fad2\nlea     rdx, [rsp+58h+ImageBase]; ImageBase                            ; +0x1d, 0x18001fad5\nmov     rcx, rsi; ControlPc                                            ; +0x22, 0x18001fada\ncall    cs:RtlLookupFunctionEntry                                      ; +0x25, 0x18001fadd\ntest    rax, rax                                                       ; +0x2b, 0x18001fae3\njz      short loc_18001FB24                                            ; +0x2e, 0x18001fae6\nmov     rdx, [rsp+58h+ImageBase]; ImageBase                            ; +0x30, 0x18001fae8\nlea     rcx, [rsp+58h+arg_8]                                           ; +0x35, 0x18001faed\nmov     [rsp+58h+ContextPointers], 0; ContextPointers                  ; +0x3a, 0x18001faf2\nmov     r9, rax; FunctionEntry                                         ; +0x43, 0x18001fafb\nmov     [rsp+58h+EstablisherFrame], rcx; EstablisherFrame              ; +0x46, 0x18001fafe\nmov     r8, rsi; ControlPc                                             ; +0x4b, 0x18001fb03\nlea     rcx, [rsp+58h+arg_10]                                          ; +0x4e, 0x18001fb06\nmov     [rsp+58h+HandlerData], rcx; HandlerData                        ; +0x53, 0x18001fb0b\nxor     ecx, ecx; HandlerType                                          ; +0x58, 0x18001fb10\nmov     [rsp+58h+ContextRecord], rbx; ContextRecord                    ; +0x5a, 0x18001fb12\ncall    cs:RtlVirtualUnwind                                            ; +0x5f, 0x18001fb17\ninc     edi                                                            ; +0x65, 0x18001fb1d\ncmp     edi, 2                                                         ; +0x67, 0x18001fb1f\njl      short loc_18001FAD2                                            ; +0x6a, 0x18001fb22\nadd     rsp, 40h                                                       ; +0x6c, 0x18001fb24\npop     rdi                                                            ; +0x70, 0x18001fb28\npop     rsi                                                            ; +0x71, 0x18001fb29\npop     rbx                                                            ; +0x72, 0x18001fb2a\nretn                                                                   ; +0x73, 0x18001fb2b", "xrefs": ["__report_gsfailure @ 0x18001fa0a", "<???> @ 0x18004d160"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}