找回密码
 立即注册
二进制文件Dotpackthe | 程序非源代码 2021-06-11 250 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
Dotpack Beta 1,我很自豪地宣布 Dotpack 的第一个测试版,一个用于 .NET 可执行文件的打包程序。上周左右我一直在研究这个,终于有了适合公众视线的东西。它始于我想在 .NET 上构建 64k 演示的愿望,因此它非常小——在撰写本文时,它的开销为 5331 字节。由于使用了 LZMA,它还实现了高压缩比;我测试过的文件的平均大小减少了 60-80%。
目前它相当简单,根本不会篡改原始二进制文件,但未来的版本将带来混淆和一系列代码转换,以进一步降低文件大小。

这个版本有几个我根本没有时间处理的已知问题:Silverlight 包装在那里(您可以将它传递给一个 .xap 并返回一个),但它非常挑剔,到目前为止还不是特别好。由于解包后程序集的加载方式,使用 System.Reflection.Assembly.GetExecutingAssembly().Name 打包二进制文件将返回一个空字符串,这可能会导致重大问题。我将在下一个版本中修复这些问题。

未来将推出的其他功能,不分先后:

    * 程序集的合并。在我完成自己的预链接器之前,我最初计划将 ILmerge 支持作为权宜之计发布,但许可问题和普遍较差的 API 使这不太吸引人。我正在开发一个预链接器,除了合并程序集之外,它还将执行死代码分析以去除代码中未使用的部分。
    * 混淆。这不仅会使分析二进制文件变得更加困难,而且您将受益于名称占用的空间更少。这在大型二进制文件中可能相当可观。
    * Visual Studio 集成。您将能够轻松地将 Dotpack 绑定到您的 Visual Studio 工作流中,以从您的发布版本生成打包的二进制文件。

Dotpack 可自由分发,但受非商业许可。如果您在商业环境中使用它,即使您不分发二进制文件,也请购买商业许可证。除了支持 Dotpack 的开发之外,您还将获得领先于非商业用户的构建。


(I'm proud to announce the first beta of Dotpack, a packer for .NET executables. I've been working on this for the last week or so and finally have something fit for public eyes. It started out of my desire to build 64k demos on .NET and for that reason it's very small -- as of this writing, it's sitting at 5331 bytes overhead. It also achieves high compression ratios due to its use of LZMA; average size reduction for the files I've tested has been 60-80%.

At the moment it's fairly straightforward, not tampering with the original binary at all, but future versions will bring obfuscation and an array of code transformations to drop the filesize even further.

This version has several known issues I simply didn't have time to deal with: Silverlight packing is there (you can pass it a .xap and get one back), but it's very finicky and not particularly good so far. Packing binaries that use System.Reflection.Assembly.GetExecutingAssembly().Name will get back an empty string due to the way assemblies are loaded after unpacking, which can cause major issues. I'm going to fix these for the next release.

Other future features which will be coming, in no particular order:

    * Merging of assemblies. I was originally planning on releasing with ILmerge support as a stopgap until I finished my own prelinker, but licensing issues and a generally poor API made that less appealing. I'm working on a prelinker which, in addition to just merging assemblies, will perform dead code analysis to strip unused portions of the code away.
    * Obfuscation. Not only will this make it more difficult to analyze your binaries, but you'll get the benefit of less space being taken up by names. This can be quite substantial in a large binary.
    * Visual Studio integration. You'll be able to easily tie Dotpack into your Visual Studio workflow to produce packed binaries from your release builds.

Dotpack is freely distributable, but is under a non-commercial license. If you're using it in a commercial environment, even if you're not distributing your binaries, please purchase a commercial license. In addition to supporting Dotpack's development, you will also get builds ahead of the non-commercial users.)

1623383523763.rar


上一篇:Hiding instructions at the end of methods in an .NET Assembly
下一篇:Writing a profiler for Silverlight applications