[comp.sys.ibm.pc.programmer] Auto Installation

dmurdoch@watstat.uwaterloo.ca (Duncan Murdoch) (06/12/90)

In article <23617@adm.BRL.MIL> NORM%IONAACAD.BITNET@cunyvm.cuny.edu ( Norman Walsh) writes:
>A better way to do this sort of thing (especially with multiple-segment
>programs like TP) is to open the file and search for some string, like
>the following:

I don't see why the "search for key string" algorithm is better than the
"work out the offset" algorithm of the original posting (For new readers:
the discussion is about how to allow a program
to patch itself.  The original messages were in comp.lang.pascal, but I've
moved followups to comp.sys.ibm.pc.programmer, which seems more appropriate.)
The search is certainly slower, and runs the risk of finding a false key:
maybe the spot in your help screen where you say how to make manual patches,
or someone's password which just happens to be the same as your search key.

On the other hand, the format of the .EXE file is documented, as
is the loading algorithm, and the only way I can see that it would go
wrong is if Turbo Pascal chose to move data around in memory after it was
loaded.  I can't see any reason for that; can you?  (Perhaps your method
would work with overlays?  But TP doesn't overlay data, does it?)

Duncan Murdoch