Anyone Remember…

I did an unexpected bit of malware cleanup today, and in the process found myself in the windows and then the system32 directory identifying offending DLL, EXE, DAT, INI, LOG and TXT files, primarily the first three, using old-fashioned DOS commands. You know, dir/ah for hidden files, dir/ah/p to pause if too many for one screen, dir/ah *.dll for the hidden DLL files, and also dir/od or dir/o-d/p in whatever combinations, to show newest files last, or first and pause after a screen, respectively.

Since it was clear that the bunches of oddly named files that had hidden and system attributes and very recent dates were put there by malware, active currently or not, but in case of errors, I was renaming them.

After a bit of:
attrib -s -h malfile.dll

Then:
ren malfile.dll malfiledll.not

I got tired of typing so much. So I spontaneously remembered my batch file skills, duh, and went to town. Better yet, I used the first way I ever learned of creating a new batch file, before I even learned (for shaky values of “learned” since it was so tricky) to use Edlin for editing them.

Anyone remember “copy con”?

It’s just the copy command, but applied to the “console to write a file. So at the prompt I typed:
copy con atsh.bat

After pressing enter, the regular prompt, C:yada yada>, goes away. Continuing, I typed:

attrib -s -h %1
ren %1 %1.not

Then pressed Ctrl-Z, which displays as ^Z, and pressed enter to save the file.

%1 Is the parameter passed into the batch file. So at the command prompt I could then type:

atsh aq6zyd.dll

That removed the system and hidden attributes and renamed the file to aq6zyd.dll.not, which is not precisely the naming convention I’d been using, but it still makes them of a nonsense “type” and clearly indicates they are the ones I renamed, whether for renaming back if mistaken, or deletion when clearly not needed.

The system in question was a serious mess. At first I couldn’t get into Control Panel. I never could get into Services, because it thinks IE 5.5 or higher is not installed.

Of course, this system is weird in that it’s XP Home and even when I am in safe mode command prompt as administrator, it locks me out of accessing some files and has some of the malware files in memory. The machine needed to be back in a hurry, so I returned it with no apparent malware running, but without certainty that it’s not there or isn’t going to come right back. It’s just not crippled and ought to go for a while. The thing really should be fdisked and reinstalled fresh.

The whole thing brought back memories of my early computer usage and messing with batch files. When the OS was DOS, or DOS and Windows 3.1, batch files really mattered. Before DOS Edit, I used copy con all the time.

The Basics

Is. It. Plugged. In.

Really, are you sure you checked?

If you help people for money or free, it’s often the first question to ask. It’s also one that people Will Lie About. Well, maybe not lie, but presume about, gloss over, fail to check carefully, not take seriously.

Happens all the time. That’s why I often tell people to unplug and replug cables, rather than merely asking are they plugged in properly. Network cables especially lend themself to that.

So please, if you’re the hapless computer user with the problem, please pay attention to the basics like this. Never assume. Never brush it off.

Buh-Bye Passwords

Tony reports that Microsoft plans to wean itself from passwords and move to smart cards, both for their own benefit and to help nudge along the increasing interest in biometrics and smart cards.

That would certainly help with the problem of people using spouses, pets and kids as their easily guessed passwords. On the other hand, it’ll be just like having to remember your discount card to go to the local supermarket or pharmacy, only worse. Leave one home and you can’t get the sale prices. Leave the other home and, oops, you can’t work. Heh.

Family Reunion

I found myself wanting to use Palatino Linotype as the font on a web site, to match most closely the font used on the client’s business cards and marketing materials.

Having recently found out that use of the “face” parameter of the HTML font tag is not necessarily considered a Good Thing, and knowing I will be relying heavily on CSS, where the “font-family” specification is used instead, that made me wonder what the rest of the font family members ought to be. Not everyone will have that Palatino font, after all.

I found this font resources page at Browser News, a site new to me, to be extremely useful. It charts similar fonts and gives an example based on the preference of Book Antiqua:

font-family:’Book Antiqua’, ‘Palatino Linotype’, Palatino, ‘Times New Roman’, TimesNR, Times, serif;

This is similar to what I would need in my CSS file, except to move Book Antiqua to the third position. Very nice.

VB Tips Collection

As I mentioned in the blog intro, XTreme had a history of publishing Visual Basic tips as part of the main site. I recently decided to revamp entirely, as the stale odor coming from the site overwhelmed me. Went down to a bare bones main page and left nothing linked from it until I could update further (that is, got around to updating further). Outside of search engines that still show them, if not ranked as highly as they once were, they aren’t linked anywhere. If you’ve moved along to VB.NET, some may no longer apply, but they work for some or all of the older versions of VB from 3.0 (for some of the basics) through 6.0. They are all linked in this post, just to get them out there again. Some may yet be reproduced entirely in posts here. Any new tips, Visual Basic or otherwise, will go here in the blog. The beauty of blogging software is that it’s so much easier to have a tip idea, write it, post it, correct it if needed, and receive feedback. But this isn’t a post on why blogging is a great tool. Here they are:

Fun With Textboxes – a basic tip with code for doing this and that in a VB textbox, with a picture of the result and a link to the VB5 project. Simple as it is, this has been one of the most popular tips. This is going to take forever if I describe each one, so forgive me if I’m terse for some of it.

Using Control Arrays To Your Advantage – another super simple tip that has gotten some of the highest traffic of all the VB tips. It can be easy to lose sight of the need for beginner info to be available if you are not one yourself. The next four are also quite popular, each one a database tip oriented toward VB6.

Example of Updating a Foxpro Table Via ODBC Direct Returning Recordcount with ADO

Closing, Reopening and Rebinding with DataEnvironment Example of Opening and Closing Recordset, then Opening a Different Table with the DataEnvironment

More database-related tips:

How to open an ODBC Direct Work Space and create an updatable recordset

Generating Output of Database Structure

Other tips and code samples:

Automation of MSN Messenger from VB Code – This is obsolete, but may provide ideas. Microsoft upgraded Messenger shortly after this was posted, changed the object model and broke compatibility with this code.

The next one was the result of a tip request from someone who’d seen the other tips on the site. We eventually figured out it was probably a homework assignment, and the guy hassled us for more and more help so that it would match more precisely the specs of his assignment. Idea for a tip, good. Harassment and being lazy, bad. Example of Determining Change Denominations in Visual

VB Add-In to Close All Code Windows

The next two were the result of the entire concept of finding factors and testing primes sort of “coming to me” in a grokkish rush. The tip for primes is the crudest, slowest method, and I challenge people to go from there and determine the better ways. Thus it shows what it shows, but may not be exactly what you want in a program that matters.

How to Determine the Factors of a Specified Number in Visual Basic Code

How to Determine Whether a Specified Number is Prime Visual Basic Code

VB6 Bug Using Printer.Scale to Print a Graph

How To: Launch Windows Control Panel Extensions Using VB

How to Determine Drive Size and Available Space Even On Huge Drives

Restart App At Windows Startup

Reading the lines of a multiline textbox into the an array

One way to determine whether a specific year is a leap year…

Use Object Browser and Class Wizard

This next one was online for a couple years before I discovered the original code had a minor bug that kept it from working exactly as intended. Oops… How to to tile a picture on a form

On instancing and naming

There you have it, the original collection of XTreme Computing VB tips from days gone by.

Microsoft: Root of All Evil

This is an interesting thread of comments at Wizbang. In my experience, a DVD drive from the supplier either comes with software, or you can pay $5 extra to get it. If I build a computer with DVD, I install that software, and the software goes along with the computer in case it has to be reinstalled. Anything else would be wrong on the part of… the computer maker! Not Microsoft.

An Oddity

I may edit this to flesh out the details later, like maybe camera model and exploit details. I’ve been encountering the strangest thing with pictures taken by a digital camera. Some of them, and it always seems to be the last ones on the memory stick in the particular batch, if they are e-mailed as-is get flagged by the web host’s mail scanning program as being infected with the recently uncovered JPEG exploit. Now, I know they aren’t affected by the exploit. The problem with the scans is that a slight internal defect in the JPEG file can mimic the way the exploit reads when the file is examined. This means the camera itself, or the storage medium it uses, is creating malformed JPEG files. Not good. It’s gotten old, not being able to e-mail the original graphics without the risk of having them purged.