May 09, 2004

Preventing viruses from starting

For the past week I have been helping some internet users reclaim "lost performance" from their windows desktops and laptops. The lament of the users were pretty much the same: "when I first bought it, it ran pretty quick, now the computer is just so slow. Did I contract a virus?"

The answer to this question would not be just "yes", but rather "how many viruses did you contract". As users traverse the internet, it is most likely that they will contract many viruses over a span of time. A common mechanism in which many virus writers exploit is to inject their executable into the startup area of your machine. There is a registry entry which lists all the executables that Windows should execute everytime you boot the machine. The registry path is this:

\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

When you look into that registry key, you will find many valid executables as well as lots of questionable ones. The viruses hide themselves here and get executed as your machine reboots. By running, they eat up your processor cycles, memory, as well as any other resources required for them to run. This is the cause of your machine's slow-down. By changing this list, you will definitely reclaim much of your machine's performance.

Caution: If you do decide to remove some entries, make sure that they are not system services. Stopping system services will affect the way your machine operates. Additionally, you should jot down the names and entries of the ones you delete just in case you make a mistake and have to restore those registry entries.

May 04, 2004

Program that writes programs

This is not something new. In fact, it has been available for ages in the form of Wizards within the Visual Studio IDE. If you've been doing some MFC programming for a while, you know what I mean. You invoke a wizard, fill-in some required parameters, and voila.... the tool generates a sequence of code to perform what you need. The output is usually something obscure and involves API calls with transformed parameters that you have given via the dialog box. The concept is to generate something relatively obscure (yet required) provided that some simple questions are answered.

The notion is not new. When you graduate to programming in C from assembly language, the same thing occurs. C abstracts the sequence required to set up a procedure call (pushing parameters on the stack, saving current processor context, then making the JMP). The reverse happens on a RETURN from a subroutine.

Another incarnation of this concept is within some database RAD (Rapid Application Development) tools. Working with databases can be quite tedious, not because that it is hard, but because setting up for database calls is mundane. Most database manipulation occurs as you 1. set up the datastructure to receive your result, 2. set up your SQL query/statement, 3. execute the statement, 4. do something with the result. There are some tools emerging today that attempts to take the tedium out of all that. Some of these are: CodeCharge Studio, ASPMaker, as well as other code-generation tools.

These are just some examples of using the machine to take the tedium out of your chores. With tools and proper use of concepts, we are one step closer to "bicentenial man" (having the robot do our lawn).