Hi John and Ldblake,
Thanks for your examples
I used and im familiar with Reshacker for a long time
BTW my goal is simple : as far as i don't want to update a precise resource, i just want to update the WHOLE resource of an EXE by another one.
I have TEST.EXE with resources that contains 2 dialogs and 2 bitmaps and 1 menu.
I have a compiled RES that contains other RESources.
I want to inject the whole second RES into the 1st EXE.
If i use loadres, how can i update the whole target EXE file with the second RES file ?
Thanks for your help and advice
To do it the dirty way, (using brute force), would require you doing some research. For example, the EXE header would need updating, offset of the resource, sizes, other things too probably.
Here is a quote from an M.S. doc.
=======================
Windows Header
The Windows (new-style) executable-file header contains information that the loader requires for segmented executable files.
This information includes the linker version number, data specified by the linker, data specified by the resource compiler, tables
of segment data, tables of resource data, and so on. The following illustration shows the Windows executable-file header:
The following sections describe the entries in the Windows executable-file header.
Information Block
The information block in the Windows header contains the linker version number, the lengths of various tables that further
describe the executable file, the offsets from the beginning of the header to the beginning of these tables, the heap and stack
sizes, and so on. The following list summarizes the contents of the header information block (the locations are relative to the
beginning of the block):
==================
Etc.
If you want to know more look at
http://www.wotsit.org/ for the EXE format.
The way I would do it is to delete all the resources in the target EXE using BeginUpdateResource(), enumerate all the resources in the source EXE (EnumResourceTypes, EnumResourceNames), extract each resource singly and add each one to the target EXE with UpdateResource(). Finally use EndUpdateResource() to complete the process.
John