You Dont Need Apis
Pure Reflection
Pure Reflection
Code
public static object DynamicInvoke(string Dll, string Name, object[] Param, Type Ret)
{
List<Type> Types = new List<Type>();
for (int i = 0; i <= Param.Length - 1; i++)
Types.Add(Param[i].GetType());
AssemblyBuilder A = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("DI"), AssemblyBuilderAccess.Run);
ModuleBuilder M = A.DefineDynamicModule("MB");
MethodBuilder MB = M.DefinePInvokeMethod(Name, Dll, MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.PinvokeImpl, CallingConventions.Standard, Ret, Types.ToArray(), CallingConvention.Winapi, CharSet.Ansi);
MB.SetImplementationFlags(MethodImplAttributes.PreserveSig);
M.CreateGlobalFunctions();
return M.GetMethod(Name).Invoke(null, Param);
}