Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+5)

This particular feature doesn't merit a write-up due to its simplicity, it's achieved by the following:

  1. When application is built a null byte (0x00) is written to the end of the executable
  2. When the application is run it opens its own executable and scans for the last null byte in the file. If there is anything after the last null byte it's assumed to be a program and is read in, otherwise the files listed by the commandline arguments are read

This exact approach only works with text as we're assured the file we're appending to the executable won't contain a null byte of its own

An executable opening itself, never would have thought of that. Thanks for sharing the technique.