Making TSR in C

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Making TSR in C

Postposted on Sat Apr 05, 2003 10:45 pm

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.
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition
fc34
Minister of Gerbil Affairs
 
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere

Postposted on Mon Apr 21, 2003 4:49 am

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.
no sig
muyuubyou
Grand Gerbil Poohbah
 
Posts: 3231
Joined: Wed Aug 28, 2002 6:19 am
Location: London, UK or Tokyo/Yokohama, Japan or Madrid, Spain

Postposted on Mon Apr 21, 2003 10:14 am

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!
arsenic
Gerbil In Training
 
Posts: 1
Joined: Mon Apr 21, 2003 10:02 am

Postposted on Mon Apr 21, 2003 11:01 am

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
liquidsquid
Minister of Gerbil Affairs
 
Posts: 2451
Joined: Wed May 29, 2002 10:49 am
Location: New York

Postposted on Mon Apr 28, 2003 11:45 am

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.
Veritas
Gerbil First Class
 
Posts: 113
Joined: Wed Dec 26, 2001 7:00 pm
Location: Houston, TX

Postposted on Mon Apr 28, 2003 12:07 pm

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.
Buub
Maximum Gerbil
Silver subscriber
 
 
Posts: 4214
Joined: Sat Nov 09, 2002 11:59 pm
Location: Seattle, WA

Postposted on Tue May 06, 2003 7:48 am

Will do. Thanx guyz!
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition
fc34
Minister of Gerbil Affairs
 
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 2 guests