http://www.perlmonks.org?node_id=992230


in reply to Crazy question about writing to a text file that is actually an executable...

trick the OS into thinking it is a text file
The OS would obey your orders! Just open your executable with a text editor. The OS can't, however, show you what you wish to see. It will only show what's in the executable depending on the configuration of the text editor and OS.

Is this just a pipe dream? Could be! Until its realized :)