473,659 Members | 2,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Build an exe from another exe

Hi everyone, I need to make another exe from my app.
For example there are some app that compare two file and then buil
another exe with the different (patcher).
Help me please! :)

10x

Jan 2 '07 #1
5 1227

<Ga********@gma il.comwrote in message
news:11******** *************@4 2g2000cwt.googl egroups.com...
Hi everyone, I need to make another exe from my app.
For example there are some app that compare two file and then buil
another exe with the different (patcher).
Help me please! :)
There are no facilites in C++ to directly do what
you're asking. How an executable is formed is
dependent upon the host system. However, once
you figure that out, you can use C++ to open an
output file (std::ofstream) and write any bits
to it you want. (You'll want to open the file in
'binary mode').

For further details about how to do what you want,
try consulting support resources concerning your
particular system(s).

-Mike
Jan 2 '07 #2

Mike Wahler wrote:
There are no facilites in C++ to directly do what
you're asking. How an executable is formed is
dependent upon the host system. However, once
you figure that out, you can use C++ to open an
output file (std::ofstream) and write any bits
to it you want. (You'll want to open the file in
'binary mode').

I can think of several platforms where you *cannot* write an executable
file without non-standard extensions. Several mainframe platforms, for
example, implement executables as structured file types (not byte
streams), and need to be written as such (and not as a simple binary
byte stream).

Jan 2 '07 #3
On 2 Jan 2007 13:55:08 -0800, "ro***********@ yahoo.com"
<ro***********@ yahoo.comwrote:
>
Mike Wahler wrote:
>There are no facilites in C++ to directly do what
you're asking. How an executable is formed is
dependent upon the host system. However, once
you figure that out, you can use C++ to open an
output file (std::ofstream) and write any bits
to it you want. (You'll want to open the file in
'binary mode').


I can think of several platforms where you *cannot* write an executable
file without non-standard extensions. Several mainframe platforms, for
example, implement executables as structured file types (not byte
streams), and need to be written as such (and not as a simple binary
byte stream).
An alternative would be not to write the executable binary directly,
but to generate a file of source code and call a compiler to compile
that source code into the executable in whatever format would be
required.

rossum
Jan 3 '07 #4

rossum wrote:
On 2 Jan 2007 13:55:08 -0800, "ro***********@ yahoo.com"
<ro***********@ yahoo.comwrote:

Mike Wahler wrote:
There are no facilites in C++ to directly do what
you're asking. How an executable is formed is
dependent upon the host system. However, once
you figure that out, you can use C++ to open an
output file (std::ofstream) and write any bits
to it you want. (You'll want to open the file in
'binary mode').

I can think of several platforms where you *cannot* write an executable
file without non-standard extensions. Several mainframe platforms, for
example, implement executables as structured file types (not byte
streams), and need to be written as such (and not as a simple binary
byte stream).
An alternative would be not to write the executable binary directly,
but to generate a file of source code and call a compiler to compile
that source code into the executable in whatever format would be
required.

Sure, there's a lot to recommend that approach, not least is
eliminating the tedium of actually generating object code and
executables directly. Of course it requires a great deal of
infrastructure to be installed and available on your system (very few
Windows systems have an installed C compiler, for example), and how you
get that to happen will be very system specific.

Jan 3 '07 #5
Perfect, Thx.
So, I can embed a minimal installation of MinGW (for example) or for
who have alredy mingw a version that ready system variables(for
Windows) or use shell (*nix).
Yes I think this is perfect... just for curiosity there are another
way?

thanks to all :)

Jan 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1899
by: Jerry Boone | last post by:
I have a development unit running XP Pro and I cannot get it to build a web project without restarting IIS. There errors in the task list are.... ! Could not copy temporary files to the output directory ! The file'bin\project1.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process. ! The file'bin\project1.pdb' cannot be copied to the run directory. The process...
5
4463
by: Al | last post by:
Hi all We have created a xml file that imports a single project using the Import element. This project compiles to a class library, but has references to two other projects that are also class libraries. We are having a path reference issue for the depending projects; if the build is started in another directory than that of the imported project. (It's a simple cannot find project xyz.csproj, build fails.) If we place the xml file in...
1
1661
by: Matt Fielder | last post by:
I need to customize the build process beyond just selecting which projects get built in what order. What I want to happen is when I select "Release" 1: Pop a dialog confirming I want to build (release build takes several minutes, and I regularly forget to switch back to "debug") 2: Build several projects in a specific order. 3: Run a batch file that checks everything out from VSS (can write the batch file, just need to call it here) 4:...
3
4675
by: NickP | last post by:
Hi there, Today I try to compile an application of mine and I am getting a whole list of bizaar errors.... ------------------------------------------------ Error 1 The "ResolveAssemblyReference" task failed unexpectedly. System.BadImageFormatException: Could not load file or assembly 'C:\System.exe' or one of its dependencies. The module was expected to
6
5389
by: =?Utf-8?B?YXByMDUyNA==?= | last post by:
I am wondering if there is a devenv switch that will ignore build dependencies that are set in .xxproj files. At the command line I am attempting to build individual projects that I do not want subjected to the build dependencies set in the project files.
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.