MCPcopy Create free account
hub / github.com/NetSPI/BOF-PE / AddExceptionSupport

Function AddExceptionSupport

loader/mappedmodule.cpp:359–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359static 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

Callers 1

MappedModuleMethod · 0.85

Calls 6

GetExceptionTablesFunction · 0.85
exceptionsMethod · 0.80
baseMethod · 0.80
imageSizeMethod · 0.80
descriptorMethod · 0.45

Tested by

no test coverage detected