I have lot of executable that I have compiled (long time back) for many of which I don't have sourcecode now. But when I compiled them I didn't put any icons for them, so they all look like same dull, bald default icon. So my questions are,
(1) is it possible for me to write a software that can change the resources section of the exe and change its looks? If so, can anyone plz point me to the location where its explained? (I am a beginner, I have no idea on the exe format and all) Also its fun to keep changing Icons without having the pain of recompiling everything just for the icon change...
(2) This is raises a natural converse question, Is it similarly possible to zap out the icon used by some file and use it for some other file? (If so, plz point me to location where I can get some details.
I am a C/C++ developers and I am looking for solution on Windows Platform...
Regards, MicroKernel
It is possible to read and write resoures from an exe or DLL file. Reading the resources is easy(ish) - just use LoadLibraryEx(LOAD_AS_DATA_FILE) to load it, then you can enumerate the resources using the standard resource API's. All of this is documented on MSDN.
Writing the resources can also be done using the UpdateResource API and related functions.
You should bear in mind though that changing the resources of someone elses EXE file will invalidate any signing. Also, depending on OS resources is risky - windows has been known to remove resources without warning (since they are undocumented). Copying resources may not be legal too (although IANAL).