views:

71

answers:

3

How can I extract an exe from a setup file, modify its contents and then assemble it again. Is there a tool or somthing or is there a way of doing this by a programmatically?

A: 

that generally depends upon how the setup file was constructed. Look at the tools offered by whoever offers the software with which the setup file was created. When you look at the tools, you should also check what options they have for patching - releasing a patch, rather than a full kit, is often preferable.

Or, if you really do have to release a full kit, why not just rebuild the whole kit, and release that?

atk
+1  A: 

Depending on the type of setup package, there may be some setup package editors. (see Josh Stodola's suggestion of ORCA, for MSI type packages).

Otherwise, and in a nutshell...

not easily...


A Setup file typically has a CRC or other digest/checksum which enables it to assert its integrity prior to running its setup logic per-se. Therefore once the setup package has been altered, its calculated CRC differs from the stored CRC and the setup process is aborted.

Assuming the above is not a problem, one is also typically limited in terms of the changes that can be applied to an exe or more generally to a binary file. The safest changes are these which do not modify the file size and essentially replace a few bytes; sometimes a patch may require to add a piece of logic, at the end of the file (or at a location within the file known to be unused) and to provide a branch/jump instruction from some area of the existing logic where change is required.

Once a patched binary is available (or possibly a brand new exe, for example if one decompiled the orginal, modified the source and rebuilt it), the way to replace it in the setup program varies, depending on the type of setup package. Again speaking in general terms, the setup program/package typically includes a "manifest" of sorts where the various parts are listed with an offset or reference of some kind, followed by the various parts which often are compressed with ZIP or similar compression format.

Alternative approach...

Rather than modifying the installation package, it may be easier to introduce an additional setup package, to be run after the original one (such setups can be "chained" within an overall installation package), and which changes the exe and other binaries which require it.
This approach may not dispense one from figuring out the proper way of patching the binaries per-se, but it removes all the difficulties associated with the structure and integrity control devices of the original setup package.

mjv
+1  A: 

Not an .exe editor per se, but I have done similiar things to MSI installer files using Orca (most notably, installing iTunes on XP 64-bit successfully).

Josh Stodola
this worked .... thanx :-)
Tony