Microsoft Visual SourceSafe file format

Author: Devin Smith
Last Updated: 03/20/2005


Introduction

This article is an attempt to document the undocumented Microsoft Source Safe file format.
Usually these files are in the VSS\data directory.

Inside this directory you will see a directory for every letter of the alphabet (a-z) as well
as some others (like labels). This document doesn't discuss the directory structure but
rather the structure of the individual files inside each directory. This document is laid out
in a way that will show you an actual hex dump of the file along with information on the
relative fields. At the end of this article you will be able to download the source code used
for processing a source safe file.

SourceSafe stores the latest revision of the file inside the above mentioned letter directories
as well as the list of changes. For example, in the 'm' directory we might have the files:

mffcaaaa
mffcaaaa.a

In this document the mffcaaaa will be referred to as the change-set file, while the mffcaaaa.a
will be referred to as the latest revision of the source code file.

Hexdump

The first 80 bytes (00-4F): Blue = Known, Red = Unknown

0000 53 6F 75 72 63 65 53 61 66 65 40 4D 69 63 72 6F SourceSafe@Micro
0010 73 6F 66 74 00 00 00 00 00 00 00 00 00 00 00 00 soft............
0020 02 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030 00 00 00 00 64 01 00 00 44 48 0D BB 02 00 21 00 ....d...DH....!.
0040 00 00 66 69 6C 65 6E 61 6D 65 2E 65 78 74 00 00 ..filename.ext..
....


0000-0013 - Signiture (Always "SourceSafe@Microsoft")
0014-001F - 00 padded (it always seems to be 00 padded in every file)
0020      - 02 = A file is being stored, 01 = A directory.
0021-0041 - Unknown
0042-xxxx - Filename (0 terminated) If the changeset file was called mffcaaaa then
            mffcaaaa.a would be the latest revision of filename.ext
.........

Source code

Below is source code you can use to look at a SourceSafe change-set file. It is very incomplete.

analss.c