Binary file editing and hardware compatibility

Binary file editing. I’ve recovered many a student’s term paper from munged disks over the years using Norton Disk Edit, from the Norton Utilities (making myself a hero many times). Usually I can only recover the plain text, but that’s a lot better than nothing. Rebuilding an Excel spreadsheet or a QuarkXPress document is much harder–you have to know the file formats, which I don’t.
But at any rate, I’ve on a number of occasions had to run NDE to recover meeting minutes or other documents at work. The sheer number of times I have to do this made me adamantly opposed to widespread use of NTFS at work. Sure, the extra security and other features is nice, but try telling that to an irate user who just lost the day’s work for some reason. The “technical superiority” argument doesn’t hold any water there.

Enter WinHex (www.winhex.com). Now it doesn’t matter so much that the powers that be at work didn’t listen to my arguments. 🙂 (NDE from vanilla DOS would still be safer, since the disk will be in suspended state, but I guess you could yank the drive and put it in another PC for editing.)

For those who’ve never done this before, you can recover data using a brute force method of searching for known text strings that appeared in the file. For example, I once worked on recovering a thesis that contained the line “I walk through a valley of hands.” Chances are, if I search for that, I’m gonna find the rest of the document in close proximity. A Windows-based editor makes this kind of data recovery very nice–search for the string, keeping Notepad open, then copy and paste the strings as you find them.

Knowledge of the underlying filesystem (FAT or NTFS) is helpful but not essential, as is knowledge of the file format involved. If worse comes to worse, you can recover the strings out of the file and have the app open to re-enter it (being aware that you run the risk of overwriting the data, of course).

I found some useful links on the WinHex site detailing certain file formats.

This is a program I suspect I’ll be buying soon, since my need for it is probably more a matter of when rather than if.

———-

From: “James Cooley”

Subject: Tip for tat?

Hi Dave,

I waded through all your views (That’s where all those hits came from!) and I like your style and learned a great deal. Here’s another tip I didn’t see mentioned: in autoexec.bat, add the following: set temp=C:\temp set tmp=C:\temp set tmpdir=C:\temp

You could use the ramdisk drive you mention, of course. I don’t know if this speeds things up, but it sure helps minimize the clutter from most installs when you clean the temp directory periodically. I use C:\temp2 for those disposable downloads because some programs hate extracting into their own directory. Norton Anti-Virus comes to mind: if you run the updates from C:\temp it hangs.

I ordered _UNIX in a Nutshell_ from a recommendation on your site, but got a 500 page tome instead of the 92 pages you mentioned. If you recall the O’Rielly book I’m talking about, could you give me the exact name so I needn’t hunt it down again?

Hope your hands are healing.

Regards,

Jim

———-

Thanks. I’m glad you enjoyed it (but isn’t that an awful lot of reading?)

I’ve seen the tmpdir trick; fortunately not a whole lot of programs use it anymore but that is useful. Thanks.

And yes, as you observe it’s a good idea to use a separate dir for program installs. I try to avoid hanging it directly off the root for speed considerations (a clean root dir is a fast root dir)–I usually stick it on the Windows desktop out of laziness. That’s not the best place for it either, but it’s convenient to get to.

The 92-page book is Learning the Unix Operating System, by Jerry Peek and others. It’s about $12. The 500-page Unix in a Nutshell is useful, but more as a reference. I’ve read it almost cover-to-cover, but I really don’t like to read the big Nutshell books that way. Information overload, you know?

———-

From: “al wynn”

Subject: MAX screen resolution for Win95/98/2000

Do you know the MAXIMUM screen resolutions for Win95/98/2000 (in pixels) ? Which operating systems can support a dual-monitors setting ?

NEC 15′ MultiSync CRT monitors max out at (1280 x 1024 @ 66Hz); for 17′ CRT’s, it’s usually (1600 x 1200 @76Hz). Do you know any 15′ and 17′ models that can handle denser resolutions ? (like (1792 x 1344 @68Hz) or (1920 x 1440 @73Hz) ?

Also, which Manufacturer/Model do you prefer for flat-panel LCD’s ? Which 15′ or 17′ LCD models boast the highest resolution ?

———-

I believe Windows’ limit is determined by the video drivers. So, if a video card ships someday that supports some obnoxious resolution like 3072×2560, Windows should support it. That’s been the case in the past, usually (and not just with the Windows platform–it holds true for other systems as well).

Windows 98 and 2000 support dual monitors.

I’ve never seen a 15″ monitor that does more than 1280×1024, and never seen a 17″ that does more than 1600×1200. I find anything higher than 1024×768 on a 15″ monitor and higher than 1152×864 on a 17″ strains my eyes after a full day of staring at it.

As for flat-panels, I don’t own one so I can’t speak authoritatively. I’d probably buy an NEC or a Mitsubishi if I were going to get one. The price difference between an off-brand flat-panel and a big name is small enough (relative to price) and the price high enough that I’d want to go with someone I know knows how to make quality stuff–I’m not gonna pay $800-900 for something only to have it break after two years. I’m totally sold on NEC, since I bought a used NEC Multisync II monitor in 1990 that was built in 1988. It finally died this year.

A 15″ flat-panel typically does 1024×768, while a 17″ does 1280×1024.

Dave’s rules for safe e-mail usage

Dave’s rules for safe e-mail usage. Please feel free to copy and paste and save this for future use. Print it out and hang copies next to your users’ monitors if you want. Make a poster out of it, I don’t care.
1. Don’t execute unexpected attachments. There’s a lot of cutesy stuff going around out there. Do you know where it came from? Do you know that the person who sent it to you scanned it for viruses? Five bucks says they didn’t. Happy99.exe is a good example–it shot off nice fireworks, then proceeded to e-mail itself to people for you and replace a critical system file. How nice of it. I don’t care how funny or how cute some attachment is, I don’t run it. Period. I don’t have time to scan it for viruses, so I can’t run it safely, and I certainly don’t have time to recover from a formatted hard drive, so I delete all unexpected attachments. Usually I make time to mail the user who sent it and tell them not to send me that crap.

2. Think twice before double-clicking on attachments, expected or unexpected. Do you know what it is? If you can’t tell a GIF or a JPEG from a Word document or an executable, you have no business double-clicking on attachments. Delete whatever it is. It’s better to miss the joke than to end up with a formatted hard drive (which you don’t have time for–see #1).

3. When in doubt, ask questions. Don’t be afraid to shoot back an e-mail message asking what an unexpected piece of mail is before opening it. You think if my editor sent off an unexpected piece of mail saying O’Reilly’s cancelled my new book, I wouldn’t ask questions? Why should an unexpected attachment from him be any different?

4. Change your stationery. On one of my work computers, where I have to use Outlook (company policy–maybe that’ll change now), I changed my stationery. In addition to my name and title and contact info, I include a line that reads, “This message should have arrived without attachments. If there are attachments, DON’T OPEN THEM!” I have to remember to delete that line manually on the rare occasions when I do send attachments. But if a virus ever hits and I do inadvertently run it, at least its cargo goes out with a warning.

5. Don’t send people executable attachments. Better yet, don’t send them unarchived Word and Excel documents either. Zip them up first. They’ll transfer faster because they’re smaller when they’re zipped, and the person on the receiving end can have better peace of mind, because viruses generally don’t send out zipped copies of themselves, and infecting a zip file is much more difficult than infecting an unarchived file.

6. Avoid using attachments whenever you can. You have network drives at work? Use them. Save it to the network, then send a message telling your coworkers where to find it. Just found a hot new shareware program? Send the world a link to it, rather than the program itself. Involving fewer computers in the file transfer speeds up the transfer and lowers risks.

7. If you must view Word, Excel, and other MS Office attachments, do so with something other than Office. View Word documents in WordPad. Yes, WordPad is slow and dumb. That’s the point. It’s too dumb to let the virus do anything. Microsoft provides Excel and PowerPoint viewers. Download them and use them to view attached e-mail. Those viewers are too dumb to let viruses do anything too.

8. Fight the machine. The more you deviate from the norm (Windows 98, Outlook and the rest of MS Office, Internet Explorer), the less susceptible you are to viruses. Why do virus writers target MS Office on Windows? Well, besides it being the second-best virus toolkit in existence, it’s also extremely common. If I’m a bored loser who wants to hear about my own exploits on the news, I’m going to aim for the largest audience possible. That happens to be Windows/Office/IE. I can’t avoid MS Word, but I’ll take my computers to the pawn shop before I use Outlook and IE exclusively.

Alternative applications and OSs aren’t just trendier, they’re safer. If StarOffice or WordPerfect Office running under Linux will let you get your work done, think about it. You may be in the minority, but you’re a lot safer.