Closed
Description
public static void Test()
{
var module= ModuleDefMD.Load(@"C:\cl.dll");
var method = module.Types[1].Methods[0];
method.ExportInfo = new MethodExportInfo();
module.Write("cl.dll");
var handle = LoadLibrary("cl.dll"); //---- handle=0 ---
var value = Get(); //--- BadImageFormatException ---
}
[DllImport("cl.dll")]
public static extern int Get();
[DllImport("kernel32")]
public static extern int LoadLibrary(string name);
cl.dll (x86)
public static class Demo
{
public static int Get()
{
return 7;
}
}
If remove "method.ExportInfo = new MethodExportInfo();", handle is not 0.
Metadata
Metadata
Assignees
Labels
No labels