2 ms·
>The issue is that with bundling the .dll, it would still mean it being extracted somewhere Hmm, this got me thinking about stuffing native code into CLR image
by garaetjjte 2y ago
>The issue is that with bundling the .dll, it would still mean it being extracted somewhere
Hmm, this got me thinking about stuffing native code into CLR image. If you would just include additional executable code sections into PE, would loader map them normally? Or presence of IMAGE_DIRECTORY_ENTRY_COMHEADER would stop it from mapping native code? If so, maybe you could remove that header and manually do pre-XP style initialization, by calling _CorExeMain from imported mscoree.dll. Though you would need to somehow trick it into locating COMHEADER that we removed.
Or maybe I'm overthinking this and MS already supports that? https://learn.microsoft.com/en-us/cpp/dotnet/mixed-native-and-managed-assemblies https://learn.microsoft.com/en-us/cpp/dotnet/mixed-native-an...