自解压可执行文件是如何制作的?
有许多程序可以让您将几个文件打包在一起并生成一个可执行文件,其中包含提取它们所需的代码。不知何故,这些文件驻留在可执行文件内。我有兴趣做同样的事情;这是怎么做到的?
仅供参考,我主要对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能可以将一个或多个文件保存在资源中,将其编译为 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.
还有诸如
pkzip
和winzip
为你做这件事。如果你的时间有价值,那么这些会更有效率。There are also products like
pkzip
andwinzip
which do it for you. If your time is worth anything, those would be more efficient.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.