View Full Version : Decoding internal IDs in slice files

09-26-2001, 02:28 PM
I've been looking through my daily downloaded slice files as well as those posted by others and am having a bit of trouble figuring out how to translate the ServerIDs (for example IDs in the series records after the header information and before the ServerVersion). They appear to be sometimes 3? and sometimes 4? bytes long, but I've been pretty unsuccessful in translating them. I'm feeling pretty stupid about this, any help would be appreciated.


09-27-2001, 04:24 PM
I was wondering how you go about intercepting the slice files?

10-12-2001, 01:18 PM
All TiVo numerics have a special expanding format that is designed to save space. They work by reserving either two or four bits in the first byte of any number for the number length code. The first two or four bits encode the length as follows:

00 - A single byte.
10 - Two bytes.
11 - Three or more bytes (determined by the next two bits).
1100 - Three bytes.
1110 - Four bytes.
1111 - Five bytes.

Additionally, the largest number a single byte can encode is 0x3F while two bytes can encode 0x0FFF, three bytes can encode 0x0FFFFF, while four and five bytes can encode 0x0FFFFFFF and 0xFFFFFFFF, respectively.

To read and decode a numeric, look at the high bit of the first byte of the number. If it is on (i.e. 0x80), the number expands to more than one byte. Next, check to see if the high four bits are 0xF0, 0xE0, 0xC0 or 0x80. If so, the number has four through one extra bytes.

11-06-2001, 12:13 AM
I have had some success in decoding slice files but am a little stuck on a few issues. I am
having a little trouble with the 0x4A tuple in the Program Records (0x03), do you
have any information on this tuple ? I get a 0x4A (the tuple), followed
always by an 0x04, then an 0x01 and then follows the Series Link ID. Do
you have any idea what the 0x04 and 0x01 could be - I thought that the
0x01 could be the Version.
Also, I am completely stuck on the Showing Records (0x06), I get a 0x42
(the tuple I guess) followed by an 0x05 and then an 0x01 then the Station
Link ID, then I get an 0x44 (the Day field I assume) followed by an
encoded day (0xC0 0x2D 0x6A = 11626), then I am lost, I seem to get a load
of semi-repeating data like 0x4A, 0x07, 0x34, 0x4A, 0x07, 0x35 (the
0x34/0x35 byte increases until it has to be 2 byte encoded) and then at
the end of this sequence I get a 0x4A, 0x07, 0x80, 0x50, 0x00, 0x07, 0x80,
0x50. I assume that these are links or ID's for the program times ??

Its probably obvious, but I can't see it ...