How DllExport works: The .export directive
masterDllExport works by utilizing a modified version of the IL Assembler (ILAsm). It uses a .export directive (which is part of the ILAsm compiler, not the CLR) to prepare the necessary steps for exporting symbols.
This process involves modifying the PE (Portable Executable) format to include an Export Address Table (EAT) and generating thunk stubs so that unmanaged code can correctly transition into the managed environment.