I'm trying to change the icon of a .exe file, normally a simple task but this .exe file is a installer and for some reason when after I change or remove the icon, the exe shrinks in size from 300 mb to 12 kb and crashes when it runs.I've tried using Resource Hacker to either replace the icon or remove it but when I try to save it, the result ends up as a tiny file which crashes when it runs. I also tried using IconChanger 3.8 and the same thing happened. I cannot change any resources on the file using Resource Hacker. If I attempt to modify version info, description, anything, it will save as a tiny 12 kb file.Is there some kind of protection against changing resources that I don't know about? What can I do in this situation? Any other methods that might work for changing an icon or removing its icon in this situation?
Can't change the icon of a .exe file. Seems to be protected?
executable;software security
Such a problem is common with executables having overlay.An overlay is extra data appended at the end of a PE. The overlay is located at the end of the sections. When a PE is loaded the overlay is not mapped into the memory of the process. An overlay is common with installers, self extracting archives etc. In order to extract the overlay, you can use any decent PE editor such as exeinfope, Detect It Easy or like this way.Hence for your problem, I would suggest to dump the overlay, make required modifications on the PE, and finally re-append back the dumped overlay to the end of the executable. For the last step you can use a Hex Editor or the MS-DOS COPY command.