by WalterBright · 4y ago · 0 comments
Very fast & easy.
Of course, it broke when COMDATs were introduced.
I did a similar thing with my text editor. The colors were configurable. The usual way was to have a configuration file, which the editor would read upon startup. But floppy disk systems were unbearably slow. So what I did was take the address of the configuration data in the data segment. I'd work backwards to where those bytes were in the EXE file, and patch the EXE file. This worked great!
Until the advent of virus scanners, which broke that. Virus scanners hated self-modifying EXE files.
You can name it: 'Bright Moments'
I'd be happy to place an advanced order if it leans you in that direction!
For a modern take on similar idea see also this discussion from a while ago:
"Improving startup time in Atom with V8 snapshots"
I was amazed that I never ran across another DOS program that used the technique.
Do you unfork then unexec or unexec then unfork?