自解压可执行文件是如何制作的?

发布于 2024-08-21 10:00:27 字数 137 浏览 2 评论 0原文

有许多程序可以让您将几个文件打包在一起并生成一个可执行文件,其中包含提取它们所需的代码。不知何故,这些文件驻留在可执行文件内。我有兴趣做同样的事情;这是怎么做到的?

仅供参考,我主要对 Windows .exe 文件感兴趣,如果它有所作为的话。

There are many programs out there that will allow you to pack a few files together and generate an executable that has the necessary code to extract them. Somehow, those files are residing inside the executable. I am interested in doing the same thing; how is this done?

FYI, I'm interested primarily in Windows .exe files, if it makes a difference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

晌融 2024-08-28 10:00:27

您可能可以将一个或多个文件保存在资源中,将其编译为 exe,然后使用 exe 中的一些代码将其提取到文件中。

即:

http://www.codeproject.com/KB/winsdk/binaryresources.aspx< /a>

You could probably save a file/files in a resource, compile it into the exe then use some code in the exe to extract it out to a file.

ie:

http://www.codeproject.com/KB/winsdk/binaryresources.aspx

自解压 .exe 文件通常是存档文件(zip、rar、tar 等)与一个小程序连接在一起,该程序进行解压,然后执行从存档中提取的程序。

一个非常复杂的人可以将存档提取到内存中,然后跳转到提取的代码并运行它,但在过去,这类事情更容易做到。

如果您想在 Windows 中编写自己的程序,您将创建一个小型控制台应用程序来执行提取,并将“真实”程序包含在控制台程序的资源中。

Self extracting .exe files are usually archive files (zip, rar, tar, etc) concatenated together with a small program that does the extraction then executes the program that was extracted from the archive.

A really sophisticated one could extract the archive into memory and then jump to the extracted code and run it, but back in the old days, that sort of thing was easier to do.

If you wanted to write your own in Windows, you would create a small console application that did the extraction, and you would include the 'real' program in the console programs' resources.

顾北清歌寒 2024-08-28 10:00:27

There are also products like pkzip and winzip which do it for you. If your time is worth anything, those would be more efficient.

客…行舟 2024-08-28 10:00:27

UPX 是一个众所周知的 Windows .EXE 加壳程序,可以在 WikiPedia 上找到。这里是 UPX 的 sourceforge 上的主站点。

希望这有帮助,
此致,
汤姆.

UPX is a well known packer for Windows .EXE which can be found here on WikiPedia. And here is the main site on sourceforge for UPX.

Hope this helps,
Best regards,
Tom.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文