Difference between revisions of "VFS: understanding the Index file layout"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
This is an attempt at dissecting the data arrangement within a new Index file.
On this page you can find a short description of the index file layout including some basic nice to knows.<BR>
 
<BR>
This is the complete raw bytecode of a new Index, created by:
The index-file contains <b>34-byte long records</b> which contain the following fields (listed in order):<BR>
* setting the cache size to 50 megabytes
<b>Location (4 Bytes):</b> The location within the cache file counted in bytes from start of file.<BR>
* setting the bandwidth to 50 kilobits
<b>Length (4 Bytes):</b> The reserved amount of space in the cache file for this item, counted in bytes (multiples of 1024 as 1024 is the block size)<BR>
* exiting the client
<b>Accesstime (4 Bytes):</b> Timestamp of last access, is updated when file is read from cache and is set on intial addition in the cache. Counted in seconds since 1/1/1970 (commonly known as unix time or POSIX time)<BR>
* deleting any existing cache folder
<b>UUID (16 Bytes):</b> The unique ID of the asset<BR>
* starting the client
<b>Filetype (2 Bytes):</b> The asset type, mostly 0 (textures)<BR>
* letting the world begin to load for about 30 seconds
<b>Size (4 Bytes):</b> The size, counted in bytes, of the data currently stored for this asset. This can be significantly lower than the Length<BR>
* quit the client
* dump the Index with a hex editor
 
Here are the raw data bytes with an offset header at the beginning of each 16-byte line. This is from the file <b>C:\Documents and Settings\admin\Application Data\SecondLife\cache\index.db2.x.8714</b>
 
0000: 00 00 00 00 00 04 00 00 0e 22 b1 45 04 60 8b 19
0010: 16 68 39 9c 57 90 b7 df 8d 9d c9 cf 15 00 70 00
0020: 00 00 00 04 00 00 00 04 00 00 0e 22 b1 45 03 dc
0030: 9f f9 46 43 55 d9 84 3b 51 45 42 dc a5 48 15 00
0040: 3e 00 00 00 00 08 00 00 00 04 00 00 0e 22 b1 45
0050: 4b 70 87 16 cf 36 8b 73 83 ae 3c 10 f4 02 1b f4
0060: 15 00 4e 00 00 00 00 0c 00 00 00 04 00 00 0e 22
0070: b1 45 0a 01 0d 21 3f 86 00 2b c8 b4 3f 13 1a da
0080: a3 b6 15 00 28 01 00 00 00 10 00 00 00 48 00 00
0090: 11 22 b1 45 fc 4b 9f 0b d0 08 45 c6 96 a4 01 dd
00a0: 94 7a c6 21 00 00 27 12 00 00 00 58 00 00 00 84
00b0: 01 00 0f 22 b1 45 f2 50 fd e6 91 04 7c 78 a4 82
00c0: 53 74 39 cb 6d 21 00 00 63 06 00 00 00 dc 01 00
00d0: 00 04 00 00 15 22 b1 45 d4 e9 38 f2 68 ed 87 62
00e0: 53 85 45 c8 12 dd 08 bc 0d 00 06 02 00 00 00 e0
00f0: 01 00 00 04 00 00 15 22 b1 45 7a 2a 9c ac 9f 4c
0100: f1 f4 0d 83 c6 a2 7a 72 2a 7f 0d 00 12 03 00 00
0110: 00 e4 01 00 00 88 01 00 1a 22 b1 45 7d bb 2c cc
0120: 22 85 91 31 34 8d db 95 97 39 26 73 00 00 d7 21
0130: 00 00 00 6c 03 00 00 28 00 00 15 22 b1 45 16 3c
0140: ae 3c ba e6 c9 2f 44 27 20 8c bb 2f 76 d2 00 00
0150: 77 02 00 00 00 94 03 00 00 1c 00 00 15 22 b1 45
0160: 55 ee 69 93 b1 df 2d 68 7a 8b 9a 04 6f 4f 7d 1b
0170: 00 00 77 02 00 00 00 b0 03 00 00 24 00 00 15 22
0180: b1 45 8a 6b 75 08 02 85 07 d1 12 4e 98 c0 b9 f0
0190: 10 1c 00 00 77 02 00 00 00 d4 03 00 00 04 00 00
01a0: 15 22 b1 45 a9 d1 0d d1 f2 d2 4f fd 7a e3 3d 65
01b0: 41 7c 77 82 0d 00 f4 02 00 00 00 d8 03 00 00 08
01c0: 00 00 16 22 b1 45 a8 29 d0 33 f9 ee 87 7b 25 84
01d0: 7c 0b d2 77 38 9d 0d 00 27 04 00 00 00 e0 03 00
01e0: 00 04 00 00 17 22 b1 45 3f 6e a2 f6 58 0e 8d 56
01f0: f0 a1 00 48 4e 34 03 a0 00 00 7a 01 00 00 00 e4
0200: 03 00 00 24 00 00 17 22 b1 45 31 5d e2 8a 1d 21
0210: 8d 55 63 38 4e 3e 0c 2f e7 ca 00 00 94 23 00 00
0220: 00 08 04 00 00 14 00 00 21 22 b1 45 4c 8c 3c 77
0230: de 8d bd e2 b9 b8 32 63 5e 0f d4 a6 01 00 d0 11
0240: 00 00 00
 
A raw examination of the data shows that each cached-object record is approximately 34 bytes long. The highlighted sections show what bytes are identical across all records in this sample:
<b>
0000: <font color="blue">00</font> 00
0002: 00 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 0e <font color="violet">22 b1 45</font> 04 60 8b 19 16 68
0012: 39 9c 57 90 b7 df 8d 9d c9 cf 15 <font color="blue">00</font> 70 00 <font color="red">00 00</font>
0022: <font color="blue">00</font> 04
0024: 00 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 0e <font color="violet">22 b1 45</font> 03 dc 9f f9 46 43
0034: 55 d9 84 3b 51 45 42 dc a5 48 15 <font color="blue">00</font> 3e 00 <font color="red">00 00</font>
0044: <font color="blue">00</font> 08
0046: 00 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 0e <font color="violet">22 b1 45</font> 4b 70 87 16 cf 36
0056: 8b 73 83 ae 3c 10 f4 02 1b f4 15 <font color="blue">00</font> 4e 00 <font color="red">00 00</font>
0066: <font color="blue">00</font> 0c
0068: 00 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 0e <font color="violet">22 b1 45</font> 0a 01 0d 21 3f 86
0078: 00 2b c8 b4 3f 13 1a da a3 b6 15 <font color="blue">00</font> 28 01 <font color="red">00 00</font>
0088: <font color="blue">00</font> 10
008a: 00 <font color="red">00 00</font> 48 00 <font color="blue">00</font> 11 <font color="violet">22 b1 45</font> fc 4b 9f 0b d0 08
009a: 45 c6 96 a4 01 dd 94 7a c6 21 00 <font color="blue">00</font> 27 12 <font color="red">00 00</font>
00aa: <font color="blue">00</font> 58
00ac: 00 <font color="red">00 00</font> 84 01 <font color="blue">00</font> 0f <font color="violet">22 b1 45</font> f2 50 fd e6 91 04
00bc: 7c 78 a4 82 53 74 39 cb 6d 21 00 <font color="blue">00</font> 63 06 <font color="red">00 00</font>
00cc: <font color="blue">00</font> dc
00ce: 01 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 15 <font color="violet">22 b1 45</font> d4 e9 38 f2 68 ed
00de: 87 62 53 85 45 c8 12 dd 08 bc 0d <font color="blue">00</font> 06 02 <font color="red">00 00</font>
00ee: <font color="blue">00</font> e0
00f0: 01 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 15 <font color="violet">22 b1 45</font> 7a 2a 9c ac 9f 4c
0100: f1 f4 0d 83 c6 a2 7a 72 2a 7f 0d <font color="blue">00</font> 12 03 <font color="red">00 00</font>
0110: <font color="blue">00</font> e4
0112: 01 <font color="red">00 00</font> 88 01 <font color="blue">00</font> 1a <font color="violet">22 b1 45</font> 7d bb 2c cc 22 85
0122: 91 31 34 8d db 95 97 39 26 73 00 <font color="blue">00</font> d7 21 <font color="red">00 00</font>
0132: <font color="blue">00</font> 6c
0134: 03 <font color="red">00 00</font> 28 00 <font color="blue">00</font> 15 <font color="violet">22 b1 45</font> 16 3c ae 3c ba e6
0144: c9 2f 44 27 20 8c bb 2f 76 d2 00 <font color="blue">00</font> 77 02 <font color="red">00 00</font>
0154: <font color="blue">00</font> 94
0156: 03 <font color="red">00 00</font> 1c 00 <font color="blue">00</font> 15 <font color="violet">22 b1 45</font> 55 ee 69 93 b1 df
0166: 2d 68 7a 8b 9a 04 6f 4f 7d 1b 00 <font color="blue">00</font> 77 02 <font color="red">00 00</font>
0176: <font color="blue">00</font> b0
0178: 03 <font color="red">00 00</font> 24 00 <font color="blue">00</font> 15 <font color="violet">22 b1 45</font> 8a 6b 75 08 02 85
0188: 07 d1 12 4e 98 c0 b9 f0 10 1c 00 <font color="blue">00</font> 77 02 <font color="red">00 00</font>
0198: <font color="blue">00</font> d4
019a: 03 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 15 <font color="violet">22 b1 45</font> a9 d1 0d d1 f2 d2
01aa: 4f fd 7a e3 3d 65 41 7c 77 82 0d <font color="blue">00</font> f4 02 <font color="red">00 00</font>
01ba: <font color="blue">00</font> d8
01bc: 03 <font color="red">00 00</font> 08 00 <font color="blue">00</font> 16 <font color="violet">22 b1 45</font> a8 29 d0 33 f9 ee
01cc: 87 7b 25 84 7c 0b d2 77 38 9d 0d <font color="blue">00</font> 27 04 <font color="red">00 00</font>
01dc: <font color="blue">00</font> e0
01de: 03 <font color="red">00 00</font> 04 00 <font color="blue">00</font> 17 <font color="violet">22 b1 45</font> 3f 6e a2 f6 58 0e
01ee: 8d 56 f0 a1 00 48 4e 34 03 a0 00 <font color="blue">00</font> 7a 01 <font color="red">00 00</font>
01fe: <font color="blue">00</font> e4
0200: 03 <font color="red">00 00</font> 24 00 <font color="blue">00</font> 17 <font color="violet">22 b1 45</font> 31 5d e2 8a 1d 21
0210: 8d 55 63 38 4e 3e 0c 2f e7 ca 00 <font color="blue">00</font> 94 23 <font color="red">00 00</font>
0220: <font color="blue">00</font> 08
0222: 04 <font color="red">00 00</font> 14 00 <font color="blue">00</font> 21 <font color="violet">22 b1 45</font> 4c 8c 3c 77 de 8d
0232: bd e2 b9 b8 32 63 5e 0f d4 a6 01 <font color="blue">00</font> d0 11 <font color="red">00 00</font>
0242: <font color="blue">00</font>
</b>

Revision as of 13:31, 5 February 2007

On this page you can find a short description of the index file layout including some basic nice to knows.

The index-file contains 34-byte long records which contain the following fields (listed in order):
Location (4 Bytes): The location within the cache file counted in bytes from start of file.
Length (4 Bytes): The reserved amount of space in the cache file for this item, counted in bytes (multiples of 1024 as 1024 is the block size)
Accesstime (4 Bytes): Timestamp of last access, is updated when file is read from cache and is set on intial addition in the cache. Counted in seconds since 1/1/1970 (commonly known as unix time or POSIX time)
UUID (16 Bytes): The unique ID of the asset
Filetype (2 Bytes): The asset type, mostly 0 (textures)
Size (4 Bytes): The size, counted in bytes, of the data currently stored for this asset. This can be significantly lower than the Length