Loading a C# Dll doesnt initialize CLR
When Loading a C# DLL the call to the first PEDecoder::CheckNTHeaders in PEDecoder::CheckFormat in _CorDllMain(mscoreei.dll) fails. I think its one of the calls to PEDecoder::CheckSection. So something is not wrong with the sections?
Also if (alignedImageSize != ALIGN_VALUE_UP(lastSectionEnd, sysInfo.dwPageSize)) fails because actually old_header->OptionalHeader.SectionAlignment is used for that. I Think atleast. SectionAlignment is 0x2000 and mscoree.dll checked that with a hardcoded 0x2000.
For ref: https://github.com/dotnet/coreclr/blob/master/src/utilcode/pedecoder.cpp
Have you resolved?
I don't even remember posting this. I guess I stopped using MemoryModule and rolled my own. https://gist.github.com/dedmen/d97b70556866a235e2ee3efdeb977357 This is the code I ended up with and it worked. It's a mess and I had to remove some stuff before publishing.
mmm, i dont understand changes :(
i want load a c# dll, but stops here:
if (alignedImageSize != ALIGN_VALUE_UP(lastSectionEnd, sysInfo.dwPageSize))