The file starts with five plain values: two strings that name the file and the SketchUp that saved it, a GUID, a third string and the time of the save. The version map follows straight after them. All numbers are little-endian.
00000000 FF FE FF 0E 53 00 6B 00 65 00 74 00 63 00 68 00
00000010 55 00 70 00 20 00 4D 00 6F 00 64 00 65 00 6C 00
00000020 FF FE FF 0C 7B 00 31 00 38 00 2E 00 30 00 2E 00
00000030 31 00 36 00 39 00 37 00 35 00 7D 00 …
Fields
The length of the version string varies, so the offsets after it are those of a
twelve-character version such as {18.0.16975}. Read each string’s length
to find the next field.
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 32 | CString | Signature | The text SketchUp Model. |
| 32 (0x20) | 4 + 2 × length | CString | Version | The version of SketchUp that saved the file, in braces: {18.0.16975}. 28 bytes here. |
| 60 (0x3C) | 16 | GUID | Model GUID | The model’s identity, a random GUID. |
| 76 (0x4C) | 4 or more | CString | Path | Where the model was saved, informational only. Usually empty. |
| 80 (0x50) | 4 | u32 | Saved | The time of the save as a Unix time. |
| 84 (0x54) | Version map | The first object of the archive. |
Strings
Every string in the file is an MFC CString as a Unicode
CArchive writes it:
| Bytes | Meaning |
|---|---|
FF | A byte FF. |
FE FF | The word FFFE. Together with the FF before it, this marks a Unicode string. |
| length | The length in UTF-16 code units: one byte if below 255; otherwise FF and a 16-bit length if below FFFF; otherwise FF FF FF and a 32-bit length. |
| text | The text, length × 2 bytes of UTF-16LE. There is no terminating zero. |
So the empty string is FF FE FF 00, and a string of twelve characters
takes 4 + 24 bytes. The files seen only use the one-byte length. That longer strings
escape to a word and a dword follows MFC’s CArchive, and OpenSKP’s reader
describes the same three forms.
To read a string: check for FF FE FF; read a byte; if it is below FF it
is the length; otherwise read a 16-bit word, and if that is below FFFF it is the length;
otherwise read a 32-bit length. Then read twice that many bytes as UTF-16LE.
Signature
The text SketchUp Model as a CString: FF FE FF, the length 14
(0E) and 28 bytes of UTF-16LE. These 32 bytes are the same in every SKP file
of every version, and are what identifies the file as a SketchUp model.
Version
The version of SketchUp that saved the file, as a CString in braces: the major
version, the minor version and the build, separated by dots. The major number is the
last two digits of the release’s year: {17.1.174} is SketchUp 2017, and
{18.0.16975} and {18.0.19877} are SketchUp 2018. The string’s
length changes the offsets of everything after it: a ten-character version such as
{17.1.174} puts the GUID at 0x38 and the version map at 0x50, a
twelve-character one at 0x3C and 0x54.
Model GUID
Sixteen bytes in Microsoft’s byte order: a 32-bit number, two 16-bit numbers, then
eight bytes as they are. For example, the bytes
A8 35 DD B6 D6 6B 09 4A AD 8B 8A 4C C9 D8 C8 0E read as
{B6DD35A8-6BD6-4A09-AD8B-8A4CC9D8C80E}.
The model’s identity (skppy calls it model_id). In every file seen it is
different and a random (version 4) GUID: the third group starts with 4 and the fourth with
8, 9, A or B.
Path
The saved_path: where the model was saved, and purely informational. It is
a CString, empty (FF FE FF 00) in almost every file seen; one classic file
holds a Windows path to a .skp file here. A reader must not open or follow
it.
Saved
A 32-bit Unix time: seconds since 1 January 1970, UTC. The times match the save dates
of the files seen: a file whose name ends in _180522 holds
EE 4C 04 5B, 1,527,008,494, which is 22 May 2018, 17:01:34 UTC.