Re: A89: Determining the handle


[Prev][Next][Index][Thread]

Re: A89: Determining the handle




On Tue, Jul 25, 2000 at 12:43:11 +0200, Zeljko Juric wrote:
> 
> Hi!
> 
> Does anybody know a good method for creating a program which
> will for example display on the screen its own handle [...]

Compare the start and end address of EVERY (e.g. `SymFindFirst(0,2)') symbol
to the current PC (or some other address known to be inside the current
program). If there's no match, the running program is (probably) an Exec-
string. If there's exactly one match, gotcha! And finally, if there for some
reason are several matches, well, then you should take a real close look at
your algorithm...


/Johan



References: