C# 从内存加载动态链接库

上传者: vblegend_2013 | 上传时间: 2019-12-21 21:32:09 | 文件大小: 1.97MB | 文件类型: zip
纯C# 实现的 从内存加载动态链接库,支持加壳的DLL,使用方便 class Program { public delegate Int32 CompressHandle(ref Byte dest,ref Int32 len, Byte [] source,Int32 sourcelen); static void Main(string[] args) { Byte[] source = new byte[10000]; Byte[] dest = new byte[10000]; Int32 len = source.Length; Byte[] dllBin = File.ReadAllBytes("zlib1.dll"); using (var dll = new DllLoader()) { if (dll.LoadLibrary(dllBin)) { var Compress = dll.GetProcDelegate("compress"); if (Compress != null) { var result = Compress.Invoke(ref dest[0], ref len, source, len); Console.WriteLine(result); } } } } }

文件下载

资源详情

[{"title":"( 38 个子文件 1.97MB ) C# 从内存加载动态链接库","children":[{"title":"InvokeDll","children":[{"title":".vs","children":[{"title":"InvokeDll","children":[{"title":"DesignTimeBuild","children":[{"title":".dtbcache <span style='color:#111;'> 226B </span>","children":null,"spread":false}],"spread":true},{"title":"v15","children":[{"title":".suo <span style='color:#111;'> 51.00KB </span>","children":null,"spread":false},{"title":"Server","children":[{"title":"sqlite3","children":[{"title":"storage.ide <span style='color:#111;'> 472.00KB </span>","children":null,"spread":false},{"title":"storage.ide-shm <span style='color:#111;'> 32.00KB </span>","children":null,"spread":false},{"title":"db.lock <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"storage.ide-wal <span style='color:#111;'> 3.96MB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"InvokeDll.sln <span style='color:#111;'> 1.45KB </span>","children":null,"spread":false},{"title":"InvokeDll","children":[{"title":"InvokeDll.csproj <span style='color:#111;'> 3.51KB </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"Release","children":null,"spread":false},{"title":"x86","children":[{"title":"Debug","children":null,"spread":false}],"spread":true},{"title":"Debug","children":[{"title":"InvokeDll.exe <span style='color:#111;'> 28.00KB </span>","children":null,"spread":false},{"title":"InvokeDll.exe.config <span style='color:#111;'> 184B </span>","children":null,"spread":false},{"title":"Msvbvm60.dll <span style='color:#111;'> 1.36MB </span>","children":null,"spread":false},{"title":"InvokeDll.pdb <span style='color:#111;'> 67.50KB </span>","children":null,"spread":false},{"title":"zlib1.dll <span style='color:#111;'> 41.50KB </span>","children":null,"spread":false},{"title":"zlib.dll <span style='color:#111;'> 70.50KB </span>","children":null,"spread":false},{"title":"System.Net.Http.dll <span style='color:#111;'> 176.59KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Program.cs <span style='color:#111;'> 941B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"x86","children":[{"title":"Debug","children":[{"title":"InvokeDll.csproj.CopyComplete <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"InvokeDll.exe <span style='color:#111;'> 28.00KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.56KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"InvokeDll.csproj.FileListAbsolute.txt <span style='color:#111;'> 920B </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"InvokeDll.pdb <span style='color:#111;'> 67.50KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"InvokeDll.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Debug","children":[{"title":"InvokeDll.exe <span style='color:#111;'> 28.00KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.68KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"InvokeDll.csproj.FileListAbsolute.txt <span style='color:#111;'> 802B </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"InvokeDll.pdb <span style='color:#111;'> 67.50KB </span>","children":null,"spread":false},{"title":"TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"InvokeDll.csprojAssemblyReference.cache <span style='color:#111;'> 73.26KB </span>","children":null,"spread":false},{"title":"InvokeDll.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Win32","children":[{"title":"Api.cs <span style='color:#111;'> 8.91KB </span>","children":null,"spread":false}],"spread":true},{"title":"DllLoader.cs <span style='color:#111;'> 14.30KB </span>","children":null,"spread":false},{"title":"App.config <span style='color:#111;'> 184B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"AssemblyInfo.cs <span style='color:#111;'> 1.30KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • Beatfan_N :
    对PeakCAN的C++库无效,提示受保护的内存,后来采用曲线方式,将dll放到内嵌资源,运行时复制到用户文档文件夹,关闭时再删除dll
    2020-06-18
  • 茶水先生 :
    研究一下,怎样加载加壳dll
    2019-10-08
  • concreteHAM :
    不错,解决了大问题,可以隐藏一些不想被别人知道的东西。
    2019-04-25
  • xlsmt :
    么用起来,不知道怎么用
    2019-02-08

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明