An analysis of the files used by Visual Source Safe 6.0

July 2008, Anthony Dunk

NOTE: The information in this document is not guaranteed to be correct. You use it at your own risk. Always keep a backup of your source safe repository files.

The VSS/data folder

VSS's main "data" folder contains sub-folders "a" thru "z" which contain the files that are checked into Source Safe and their deltas. It also contains folders called "labels", "locks", and "loggedin". As well, the following files are present in the main folder:

The um.dat file

This is the user management file, and has the following contents:
0x0000: ID String = "UserManagement@Microsoft"
0x0038: "HU"
0x003c: Number of VSS users recorded (2-byte int)
0x007c: Length of next user record (4-byte int)
0x0080: User record is as layed out below (Usually 64 bytes, except for last record in file which is 60 bytes because the last field is absent)
User record:
0x0000: "UU"
0x0002: Checksum of this record (2 bytes) (Must be recomputed if anything changes in user record otherwise VSS reports um.dat is corrupt)
0x0004: User name (32 bytes, including zero terminator) (e.g. "Admin")
0x0024: Hash of password for this user or 0x90 0x6e if no password (2 bytes)
0x0026: Permissions flag: 0x00=Read-Write, 0x01=Read-Only
0x0028: Offset of 148 byte record for this user in the file rights.dat (4 bytes)
0x003c: Length of next user record (4-byte int)
There is a command-line program which will convert a VSS password to the hash value stored in the um.dat file here, but the actual 15 character cipher text used by VSS has been intentionally obscured with x's.

The rights.dat file

0x0114: Number of users in the um.dat file.
0x0120: A table of 8 byte entries for each user. First 4 bytes are offset in this file to rights info for that user (which is an 148 byte record).
	The 5th byte is permissions for this user(0x0F=Read-Write, 0x01=Read-Only)

The names.dat file

0x0000: ID (50 00 00 00 48 4E)
0x0018: File size in bytes (4-byte int)
0x0058: Table of short file names in 8.3 format starts.

The "loggedin" folder

This folder simply contains a zero-sized file called xxxx.log for each user that is currently using VSS, where xxxx is the user name. It can also contain the file Admin.lck if the database is locked.

The "labels" folder

The labels folder contains text files which list the versions of projects to be labelled for each user label created.

The "locks" folder

This is used if VSS locking is enabled.

The "a" thru "z" data folders

These folders each contain a series of files with names such as caaaaaaa and caaaaaaa.a. The file with no suffix is the file that contains the history information, while the file associated with it which has a ".a" or ".b" suffix is the data file and holds the current contents of the file as last checked-in by the user. Each time a file is checked in the suffix alternates between ".a" and ".b". (Sometimes problems can occur in VSS which leave the history and data files out of sync with each other. These problems can usually be remedied by swapping the suffix on the affected file from ".a" to ".b" or vice-versa. However, Microsoft recommends against doing this because it can make the file history inaccessible. They say you should restore the file pair from a recent backup instead. Refer to the link at the bottom of this page).

The history/log file has the following header contents, amongst other things:
0x0000: ID string = "SourceSafe@Microsoft"
0x0020: Flag: 01=Folder, 02=File
0x0022: Values 0x06 0x00 - Version of Source Safe perhaps
0x0038: "DH"
0x003e: Number of history entries
0x0042: Filename
0x006B: The character suffix for the associated data file (usually 0x41 ("A") or 0x42 ("B"))

The VSS/users folder

This folder contains the Template.ini file which is used when a new VSS user is created. There is also a folder for each existing user and each contains a text file called ss.ini which contains user settings for VSS as well as the working folder for each project. This is supposed to be kept less than 64K in size.

Further reading



Home page