| 357 | } |
| 358 | |
| 359 | static void AddExceptionSupport(const Pe::PeNative& mappedPe){ |
| 360 | |
| 361 | auto exceptionTableSize = 0ul; |
| 362 | auto exceptionTable = GetExceptionTables(mappedPe, exceptionTableSize); |
| 363 | |
| 364 | #if defined(__x86_64__) || defined(_M_X64) |
| 365 | //Add the runtime function table so that SEH/C++ exceptions work for x64 PE's |
| 366 | RtlAddFunctionTable((PRUNTIME_FUNCTION)mappedPe.exceptions().descriptor().ptr, mappedPe.exceptions().descriptor().size / sizeof(RUNTIME_FUNCTION), DWORD64(mappedPe.base())); |
| 367 | #endif |
| 368 | |
| 369 | RtlpInsertInvertedFunctionTableEntry(PVOID(mappedPe.base()), mappedPe.imageSize(), exceptionTable, exceptionTableSize); |
| 370 | } |
| 371 | |
| 372 | |
| 373 |
no test coverage detected