Attack of the 16-bit App

Recently, I was given the task of upgrading some Windows 95 machines in our company to Windows XP. One user on Windows 95 was using a 16-bit application called Advanced Gage Calibration. This program is used to calibrate machine tools. Upon copying to Windows XP and launching the program, it complained about missing files. Upon loading trusty Filemon, I determined it needed VBRUN300.DLL along with some other DLLs. After copying over all the files flagged by Filemon, the program was still giving a “BTREIVE: File not found error”. This was quite curious as Filemon showed it wasn’t hitting any missing files.

Having experience with BTREIVE in the past, I knew it was an ODBC driver which interfaces a program with a database. I was going in circles on Google trying to find a BTREIVE installation program (a hex dump of WBTRCALL.DLL showed it was version 5.11). I took a step back and took another look at the Filemon log. Before loading any of the files, the AGC program reads C:WINDOWSWIN.INI. WIN.INI is the forerunner of the Windows 9x/NT Registry. Back in yesteryear, programs use to store their program data in WIN.INI and SYSTEM.INI. I remember tinkering with Gator, a 16-bit text editor, back in 1993. The trial version would store its trial “countdown” data in a secret section in the WIN.INI file. Even after uninstalling and reinstalling Gator, it would know how many days you used in their trial period because of this section. Upon looking at the WIN.INI file on the Windows 95 machine, I discovered this:

[BTRIEVE]
OPTIONS=/m:63 /p:4096 /f:40 /l:60 /u:5
TASKS=50

This must pass certain options to BTREIVE to read the data. One of the errors was a subscript error, so some of these options must tell BTREIVE the “index” and “boundaries” of the database. The other interesting thing was this text string in the hex dump of WBTRCALL.DLL: “Btrieve V5.11 DLL for MS-Windows Beta Version“. Beta version? Why would you sell a program with beta drivers? Yikes!

– Soli Deo Gloria

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.