Page 1 of 1

Making TSR in C

Posted: Sat Apr 05, 2003 10:45 pm
by fc34
Anyone know if that is possible. I want to make a program that is a TSR, ie. does not show in the taskbar in XP.

Posted: Mon Apr 21, 2003 4:49 am
by muyuubyou
Hmm I think it should be relatively easy. I did some assembly TSR back in the day (some thousands of lines), the learned to code aprox. the same thing in C+asm (a couple of hundreds of lines).

Anyway, that was using DOS interrupts and I wonder how do they interface with the windows API.

Sorry for the delay, I see you posted this thing a while ago. If you're still interested, drop me a line. I'll try to find it.

Posted: Mon Apr 21, 2003 10:14 am
by arsenic
The best way to do it may be to write a "service." Try looking into the <a href="http://msdn.microsoft.com/library/en-us/dllproc/base/createservice.asp">CreateService function</a>, this may be what you're looking for. If that's not it, then it may work to just CreateThread and have your WinMain() return. Of course, in both of these cases, your program will show up in the Processes tab. Hope that helps!

Posted: Mon Apr 21, 2003 11:01 am
by liquidsquid
You can bury a service into a svchost process, and then it is "hidden" in a sense, so it is hard to keep them from showing. I wrote a "snooper" program a while back which would allow the boss and me to take snapshots of other people's desktops to see if they were f-ing off. It was a lot of fun since I wrote in a few other "trinkets" as well :wink: . The best part was seing what the boss was up to. He was the worst of the bunch by far. It was a lot of work however to hide the sucker because it used WinSockets which like to crash on it's own (Windows 95/98 days), and when you took a screen shot, a lot of memory would swap on the user's box giving away the snapshot process. I semi-solved that one by snapshooting a percent of the screen, compressing it and sending it in succession.

I could have made a great back-door virus out of it if I wished as I could manipulate files pretty well too. I used it mostly to back up files of people who always forgot to. Weren't they suprised when I saved thier butts when thier machines crashed!

-LS

Posted: Mon Apr 28, 2003 11:45 am
by Veritas
Windows XP does not support TSRs. TSRs were a hack to make DOS seem sorta like it was a multitasking OS. Since XP is a multitasking OS there is no need to use the old TSR hacks (I am 99.9999% sure XP does not support them anyhow). As others have suggested, you are going to have to write a win32 service. Having done a little research, I don't think it is easily possible to hide things on the process list on an NT/XP system.

Posted: Mon Apr 28, 2003 12:07 pm
by Buub
There is no such thing as a TSR in Windows. TSR's are something that runs under DOS.

Yes you should investigate writing a Service. Consult http://msdn.microsoft.com/ for info on how this is done.

If you have MS Visual Studio it should also have one or more samples for creating a Service in the Project Wizard.

Posted: Tue May 06, 2003 7:48 am
by fc34
Will do. Thanx guyz!