纯C#实现的从内存加载动态链接库,支持加壳的DLL,运用方便classProgram{publicdelegateInt32CompressHandle(refBytedest,refInt32len,Byte[]source,Int32sourcelen);staticvoidMain(string[]args){Byte[]source=newbyte[10000];Byte[]dest=newbyte[10000];Int32len=source.Length;Byte[]dllBin=File.ReadAllBytes("zlib1.dll");using(vardll=newDllLoader()){if(dll.LoadLibrary(dllBin)){varCompress=dll.GetProcDelegate("compress");if(Compress!=null){varresult=Compress.Invoke(refdest[0],reflen,source,len);Console.WriteLine(result);}}}}}
1