以编程方式将两个exe文件合并为一个

以编程方式将两个exe文件合并为一个

本文介绍了以编程方式将两个exe文件合并为一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以将两个exe文件以编程方式合并到一个文件中,因此运行该文件将可以同时执行两个较早的exe文件.我在Google上发现了一些有关注入代码或dll文件的事情,但是有可能两个文件合并两个exe文件或将exe注入exe吗?

Is there a way to merge two exe files into one, programmatically, so that running it would execute both older exe files together. I found some things on google about injecting code or dll files but is it possible two merge two exe files or to inject exe into exe?

谢谢.

谢谢大家.只是对于那些说不可能的人,我不得不说我几乎按照某些建议的方式做到了.几乎是这样的(我不记得很久以前的所有情况了):

Thanks everyone. Just for those who said that it's not possible, I have to say I almost did it in the end in the way some suggested. It almost goes like this (I can't remember all of it cos it was a long time ago):

[注意:此算法与某些蠕虫和病毒的算法非常相似.我不是黑客或病毒编写者!并且只能将其用于实验目的或出于无害的目的-代码中的错误可能会破坏目录中的可执行文件.]

[BEWARE: This algorithm is very similar to those of some worms and viruses. I am not a hacker or a virus writer! and this is to be used only for experimental or unharmful reasons - Making mistakes in the code can ruin the executables in directories.]

1- Exe会检查自己的大小以检测是否有任何附加到自己的东西.如果没有,那么:

1- The Exe checks itself's size to detect whether anything has been appended to itself. if it hasn't then:

     1.1- The exe finds other executable files in its directory (lets call one of them as victim!)
     1.2- it makes a copy of itself (lets call it newMe)
     1.3- it copies the other executable found in the directory to the end of newMe.
     1.4- it deletes the other executable file found and renames newMe to its victim's name.

2-如果exe检测到已向其中添加了某些内容,则:

2- If the exe detects that something has been added to it then:

     2.1- Then it copies data from itself (from ORIGINAL_FILE_SIZE to the end of file) to a new file (lets call it newBorn.exe)
     2.2- It runs itself's code and then executes the newBorn.

我说我ALMOST这样做是因为该exe将另一个exe附加到其自身.但是可以重复执行此操作,以将2个甚至3个或更多可执行文件附加并执行到一个文件中.您只需要知道编写程序的ORIGINAL_FILE_SIZE.

I said I ALMOST did it cos in this way the exe appends another exe to itself. but this could be repeated for appending and executing 2 or even 3 or more executables into one. you just have to know the ORIGINAL_FILE_SIZE of the written program.

推荐答案

从理论上讲,这是可能的,但需要您付出一些努力.

Theoretically this is possible, but it will take some effort from your side.

您可以将数据附加到exe文件,这是自解压档案的工作方式.但是,您将需要自己的数据格式,类似于文件系统,因为您只有一个平面的.exe文件.
请参阅这篇Microsoft文章(有关Google的更多信息) http://support.microsoft.com/?scid=kb%3Ben-us%3B84062&x=12&y=13

You can append data to an exe file, this is how self extracting archives work. However, you'll need your own data format, similar to a file system, because you've got just one flat .exe file.
See this Microsoft article (there's a lot more on google) http://support.microsoft.com/?scid=kb%3Ben-us%3B84062&x=12&y=13

您要打包两个文件的exe文件必须解压缩这些文件并最终可以运行它们.

The exe you're packing your two files in must then extract those files and can finally run them.

祝你好运.

这篇关于以编程方式将两个exe文件合并为一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 03:51