PDA

View Full Version : Safe to hex edit my .exe?


bignobody
06-05-2006, 11:04 AM
Howdy,

I know there is a fair amount of "wasted" space in a typical Win32 exe from reading various articles about making them as small as possible. For example, looking at my current project's .exe from about $02D0 to $1000 is all zeros. Can I safely edit this to add little messages to anyone snooping about with a hex editor? Or can doing this potentially cause problems?

Jare
06-05-2006, 04:02 PM
In general it's not safe. However you can add a binary resource that is a text file with messages.

Way back when 16 bits seemed enough for everyone, my bro and I were hired to compress someone else's game down from 3 floppies to 1. We filled the 3 free sectors with a list of smileys. Someone found it and made it known. That was fun. Smileys were an obscure geeky unixy usenety thing.

bignobody
06-05-2006, 07:33 PM
Thanks, Jare. I'll do it the safe way then :yes:

Regards,

iMalc
06-09-2006, 02:33 AM
http://upx.sourceforge.net/

'nuf said!

bignobody
06-09-2006, 06:46 AM
Thanks for the link, iMalc. So now I can add messages as a binary resource, and get rid of the wasted space to boot!

Regards,

roel
06-09-2006, 06:46 AM
Whether you can fill it or not depends on if it used or not. 00's can contain actually information, but when they are used to fill alignment gaps you can safely modify them. You need a specification of the PE format to judge. It is more likely that someone looking around will see your message there. Another way: some linkers allow you to provide your own stub, you know, the piece of 16-bit code that says "this program cannot be run in dos mode". You can create your own, telling the same message, with your own additional hidden messages also in the stub. This is all probably too much work though.

bignobody
06-09-2006, 08:41 AM
Thanks for the info, roel. You're probably right though, too much work for such a small return of effort.

Regards,