Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!donau!duteca.et.tudelft.nl!kooijman From: kooijman@duteca.et.tudelft.nl (Richard Kooijman) Newsgroups: comp.os.msdos.programmer Subject: Re: How can a TSR detect if it has been installed? Message-ID: <1991Jun24.083508.6970@donau.et.tudelft.nl> Date: 24 Jun 91 08:35:08 GMT References: <1991Jun23.145337.20537@netcom.COM> <4944@gumby.Altos.COM> Sender: news@donau.et.tudelft.nl (UseNet News System) Organization: Delft University of Technology, Dep. of Electrical engineering Lines: 33 Nntp-Posting-Host: duteca.et.tudelft.nl jesse@gumby.Altos.COM (Jesse Chisholm AAC-RjesseD) writes: >| >How can it prevent itself from being re-installed? I know programs such as >| >NORTON SI will show you who "owns" an interrupt, and my program comes up >| >as the owner. If there was a way to see if the owner was NOT DOS (i.e. another >Many TSRs chain their interrupt and so it might be installed but no longer >be the first in the chain. A way of checking for the signature you mention >that gets around this is to check at that offset for ALL segments from 0000 >up to your current CS. when you find the signature if the segment is not >equal to the current CS, then your TSR has been installed before and is still >in memory. If the first time you find the signature is in your current >CS segment, then your TSR has not yet been installed. Go for it. One problem with this solution: you can find the signature in your disk buffers or disk cache. To avoid this you must look for a garbled signature. So, say the ID string is "clock tsr v1.1", then you can change this at run-time in "CLOCK TSR V1.1" and look for this string when your TSR is started. This solution works flawlessly (although the whole concept is ugly, due to the lack of standardisation in the TSR world) and has been used by many programmers (professionels too). Richard. -- Richard Kooijman | (__) Delft University of Technology | (oo) ------------------------- Dept. Electrical Engineering | /-------\/ - | Don't have a Bart, man! | Section Computerarchitecture | / | || ------------------------- Neural Network Group | * ||----|| Room 10.04 | ^^ ^^ kooijman@duteca.et.tudelft.nl | The Simpsons' cow