Jump to content


Safe to hex edit my .exe?


6 replies to this topic

#1 bignobody

    Valued Member

  • Members
  • PipPipPip
  • 155 posts

Posted 05 June 2006 - 06:04 PM

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?
-bignobody
notsoftgames.com - Creator of Shlongg!

#2 Jare

    Valued Member

  • Members
  • PipPipPip
  • 247 posts

Posted 05 June 2006 - 11: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.

#3 bignobody

    Valued Member

  • Members
  • PipPipPip
  • 155 posts

Posted 06 June 2006 - 02:33 AM

Thanks, Jare. I'll do it the safe way then :yes:

Regards,
-bignobody
notsoftgames.com - Creator of Shlongg!

#4 iMalc

    New Member

  • Members
  • PipPip
  • 11 posts

Posted 09 June 2006 - 09:33 AM

http://upx.sourceforge.net/

'nuf said!

#5 bignobody

    Valued Member

  • Members
  • PipPipPip
  • 155 posts

Posted 09 June 2006 - 01:46 PM

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,
-bignobody
notsoftgames.com - Creator of Shlongg!

#6 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 697 posts

Posted 09 June 2006 - 01:46 PM

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.

#7 bignobody

    Valued Member

  • Members
  • PipPipPip
  • 155 posts

Posted 09 June 2006 - 03:41 PM

Thanks for the info, roel. You're probably right though, too much work for such a small return of effort.

Regards,
-bignobody
notsoftgames.com - Creator of Shlongg!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users