Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,

I have a question for which I haven't found the answer, yet (though I've been looking for some time, just don't know what phrase to ask to get the answer):
How to generate an exe file from exe file?

I've made some games and prototypes with some game engines (UDK, Unity) and have made some programs in C++ on my own. But I don't know how to make a program (like UDK) where I can do stuff, click BUILD and I get an exe file with stuff that I made.

I presume that making a game engine might be hard (and time consuming) but I would like to know how does it work that I can make a program from another program.
Posted
Comments
[no name] 5-Jun-14 7:34am    
Well it sounds to me that you are either wanting to build your own compiler or looking for deployment software. Hard to tell as your description is very vague.
Grey Whale 5-Jun-14 7:57am    
So it would require of me making a compiler?
So UDK or Unity is a compiler? So, let's say, I make a scene, I put objects on it, I put a camera, I click BUILD, and... what gets compiled then? Objects on scene?
I know that when I write the code, it must get compiled somehow (as I mentioned, I worked with game engines) but what when I just want to put some objects in the scene and all mechanics don't change? I have to recompile the code again?
[no name] 5-Jun-14 8:19am    
Not at all. Your description of what you want to do is just incredibly vague. Getting an exe from an exe does not make any sense at all. I think from your added vague description you just want to read a file into your program and use the data within it.
Grey Whale 5-Jun-14 8:32am    
To put it very simple: Game engine (like UDK and Unity) is an exe file with all other stuff (assets, libraries etc.). There, you can build a project and what do you get? Another exe file! ;)
My question is: How to get this "another exe file"? ;)
[no name] 5-Jun-14 8:54am    
No that is not at all "simple". That makes no sense at all. What "another exe file" are you expecting to get? From where to do you expect to get it? You already have an exe, what use is another exe?

You don't need to put it all into a single executable. As with a lot of programs, you can use libraries like dll's. It is the same like working with opengl for example. You include the header files so the compiler can knows the definitions available in the library. The actual code is already in a compiled library. This is also very efficient and nice for you as a developer because you don't need to compile the complete library every time you want to run your program.

You could just check out how a UDK/Unity game can be deployed.

Good luck!
 
Share this answer
 
Comments
Grey Whale 5-Jun-14 8:09am    
Well, ok, I forgot about DLLs. :P
But my idea is that, for example, I give the exe file for a designer, he puts objects on scene in the program, clicks BUILD, and gets the another exe file (without having to compile all again).
I thought about looking into UE4 source code (as it is available for relatively low price) but I considered it walking through a code jungle.
One relatively simple way for obtaining that would be making an application scriptable, see, for instance "Building Scriptable Applications by hosting JScript"[^]. In other words you would deploy all the times the same executable, customized by the user's scripts.
 
Share this answer
 
You need to have a deep understanding of PE EXE format. Check below link might lead you to a direction. One of the idea could be to duplicate the original executable file and inject your code/data in the newly created file. Check below link

Inject your code to a Portable Executable file[^]

An In-Depth Look into the Win32 Portable Executable File Format[^]

you can find lots of information if you search for "creating PE header in runtime"
 
Share this answer
 
v2
Comments
Grey Whale 5-Jun-14 8:28am    
Hm, that might be it. I will have to give it a deeper look because it looks interesting.
Sounds like you're building an IDE for video game creation. In order to create the game's .exe file from you IDE, I would advise you to call a compiler from your IDE and pass along the files and libraries that are needed in order to create the game's .exe file.

I would also advise you to come up with a save format (or use an existing one) for your levels, characters, etc. This way, you can create content for the game, that can be tested in the IDE, which will run in the compiled environment. This also means that your IDE and the created .exe will share some .dll files to get them to treat the same data in the same fashion.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900