<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.webtv.zone/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wtv-411</id>
	<title>WebTV Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.webtv.zone/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wtv-411"/>
	<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/wiki/Special:Contributions/Wtv-411"/>
	<updated>2026-05-04T13:13:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Installing_Linux_on_the_MSN_TV_2_(RM4100)&amp;diff=772</id>
		<title>Installing Linux on the MSN TV 2 (RM4100)</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Installing_Linux_on_the_MSN_TV_2_(RM4100)&amp;diff=772"/>
		<updated>2023-12-29T02:26:29Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Connect the serial port */ Remove serial port image for now because I personally don&amp;#039;t like the current one anymore&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MSNTV 2|MSN TV 2]] was an internet appliance made by Microsoft that was designed as an upgrade to the first generation WebTV/MSN TV internet appliances. It introduced broadband, support for media playback, and an upgraded browser engine based on Microsoft&#039;s Internet Explorer 6 browser. The boxes were manufactured by RCA with the model number RM4100. They&#039;re also known to be decent Linux machines, and hacking the boxes to load Linux doesn&#039;t require a lot of effort. The first, and currently, the only method for doing this was discovered by Chris Wade in 2006, which involved a 4-pin serial port attached to the RM4100 motherboard and using it to flash a patched version of the MSN TV 2&#039;s BIOS by injecting shellcode directly into RAM. This patched BIOS would load a Linux kernel from the box&#039;s CompactFlash card on boot up in place of the stock MSN TV 2 firmware. Considering that the available guides for doing this are almost two decades old and are somewhat outdated nowadays, this guide will offer up-to-date and clear instructions for those interested in turning their MSN TV 2 box into a Linux machine. MSN TV 2 boxes nowadays are pretty rare to come by, though, and since the available kernels for them are built from very old versions of Linux, you might not be able to get much out of the MSN TV 2 running Linux these days.&lt;br /&gt;
&lt;br /&gt;
This guide will assume that you&#039;re using the original toc2rta Linux kernel (the one without video out support). I (the wiki admin) won&#039;t go over installing the kernel with video out support as one, the only version of that available online requires compiling the Linux source code, which I have no experience with, and two, the compiled version is no longer available anywhere. This will also assume that you&#039;ll only use the stock CompactFlash card that comes with the MSN TV 2 to flash the patched BIOS and load Linux from. It&#039;s possible to add a hard drive for extra storage if you&#039;re able to solder an IDE port onto the motherboard, but that&#039;s out of the scope of this guide. One of the steps in this guide also requires that you have a Linux or macOS system available to you or a Linux environment compatible with Windows installed on your computer, since right now there&#039;s no working native equivalent for Windows computers. I&#039;m hoping I can find a solution for that at some point in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;- wtv-411&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What You Need ==&lt;br /&gt;
&lt;br /&gt;
To perform this hack, you will need:&lt;br /&gt;
* An MSN TV 2 (RM4100) set top box&lt;br /&gt;
* A tool to pry off the rubber feet from the bottom of the MSN TV 2 (i.e., a spudger)&lt;br /&gt;
* A computer (Right now, Linux or macOS will have to be involved at some point during this guide)&lt;br /&gt;
* A CompactFlash reader&lt;br /&gt;
* A TTL adapter - one that connects to USB is recommended&lt;br /&gt;
* kernel.zip and rootfs.tar.gz ([https://archive.org/details/msntv2-linux-files Mirror])&lt;br /&gt;
* The patched MSN TV 2 BIOS, which loads the Linux kernel. You can download this on Archive.org at https://archive.org/details/msntv2-linux-bios.&lt;br /&gt;
&lt;br /&gt;
== Disassembling the MSN TV 2 ==&lt;br /&gt;
&lt;br /&gt;
Before you can get to installing Linux on the MSN TV 2, you&#039;ll have to get access to the hidden LVTTL serial port on the MSN TV 2&#039;s motherboard. To do this, you&#039;ll have to disassemble the shell of the set top box.&lt;br /&gt;
&lt;br /&gt;
(The following steps have been copied and slightly edited from [[MSNTV 2/Extracting System Content]])&lt;br /&gt;
&lt;br /&gt;
Before you can unscrew anything, you&#039;ll have to cut or remove the sticker with trademark information that&#039;s conveniently placed on the right side of the back of the MSN TV 2 box, which holds the two parts of its plastic shell together and prevents it from being fully removed. Since MSN TV has long since been defunct, tampering the sticker should no longer be a concern. You can slice this sticker by the crease it holds together, or go through the tedious process of completely removing it. Whatever method you choose, the two halves of the shell will be fully separated once the sticker is dealt with and now you can finally get to unscrewing the unit.&lt;br /&gt;
&lt;br /&gt;
Do you see the four rubber feet on the bottom of the unit? Underneath those are four screws that you&#039;ll have to unscrew to remove the bottom half of the box&#039;s shell. Pry off each rubber foot and then unscrew each of the four screws with a Philips head screwdriver. Now gently remove the bottom half of the shell and you&#039;ll see a metal cage with even more screws that hold the motherboard and top half of the plastic shell together. Specifically, there are 5 screws holding the metal cage: two on the left, two on the right, and one somewhere in the middle. Unscrew all 5 screws with the Philips head screwdriver, and once you&#039;re done, remove the metal cage from the top half of the shell and flip it over.&lt;br /&gt;
&lt;br /&gt;
== Connect the serial port ==&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve fully disassembled the shell, remove the top of the metal cage. The serial port should be at the bottom left of the motherboard and have 4 pins.&lt;br /&gt;
&amp;lt;!-- Below is a picture of it with the pinout.&lt;br /&gt;
&lt;br /&gt;
[[File:rm4100_serial_port_labelled.jpg|400px|Picture of the MSN TV 2 (RM4100)&#039;s serial port]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The pinout for the serial port is (from left to right):&lt;br /&gt;
&lt;br /&gt;
* 1 - TX&lt;br /&gt;
* 2 - RX&lt;br /&gt;
* 3 - GND&lt;br /&gt;
* 4 - 3.3V&lt;br /&gt;
&lt;br /&gt;
The serial port on the MSN TV 2 operates at 3.3V. You can buy a USB to TTL adapter for cheap that supports this voltage. At least in this case, the 3.3V pin doesn&#039;t have to be connected. The TX and RX connections from the adapter you&#039;re using might also have to be reversed on the MSN TV 2&#039;s TX/RX pins.&lt;br /&gt;
&lt;br /&gt;
== Prepare the CompactFlash card ==&lt;br /&gt;
&lt;br /&gt;
Now take out the CompactFlash card from the MSN TV 2 and plug it into a computer. Before doing anything, I recommend you image the card in case you corrupt it and have to start over. Make sure you&#039;ve downloaded kernel.zip, rootfs.tar.gz, and the patched BIOS before continuing. First, unzip all three files. In the unzipped kernel folder, copy the vmlinux.bin and cmdline files into the first partition of the card (this usually contains files for booting the MSN TV 2 firmware, such as BOOT.PRF and NK.BIN. Keep these in the partition for now). vmlinux.bin is the Linux kernel that the MSN TV 2 will boot Linux from, and cmdline is a text file containing the config for the kernel. If you&#039;re feeling adventurous, feel free to edit this file. Copy the patched BIOS from its folder, which has the filename &amp;quot;linux_patched_bios.bin&amp;quot;, to the first partition with the filename &amp;quot;BIOS.BIN&amp;quot;. If you&#039;re copying these files in Windows, make sure to remove the Archive attribute from vmlinux.bin and cmdline on the card as it&#039;s reported that Linux won&#039;t boot otherwise. You can do this by accessing the drive letter of the first partition in Command Prompt and running the following commands:&lt;br /&gt;
&lt;br /&gt;
 attrib -A vmlinux.bin&lt;br /&gt;
 attrib -A cmdline&lt;br /&gt;
&lt;br /&gt;
Next, you&#039;ll have to overwrite the entire third partition of the CF card (which contains at least three folders named &amp;quot;Init&amp;quot;, &amp;quot;Print&amp;quot;, and &amp;quot;Shell&amp;quot;) with the rootfs.img file you extracted from rootfs.tar.gz. If you have a Linux or macOS system, or if you have a Linux environment installed on Windows, it&#039;s as simple as running &amp;lt;code&amp;gt;dd if=rootfs.img of={CF_3RD_PART}&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;{CF_3RD_PART}&amp;lt;/code&amp;gt; representing the device name of the third CF card partition mounted on the computer (assuming no other removable devices are connected, this is usually &amp;quot;/dev/sda3&amp;quot;). Currently, there&#039;s no known way to do this natively in Windows. &lt;br /&gt;
&amp;lt;!-- If you can propose a native Windows solution that works, send an email to [mailto:411webtv@gmail.com 411webtv@gmail.com] and I&#039;ll update this section with instructions for Windows users (and I&#039;ll also give credit if you&#039;re comfortable with that). --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once everything&#039;s done, put the CompactFlash card back into the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
== Flashing the patched BIOS ==&lt;br /&gt;
&lt;br /&gt;
If everything&#039;s set up properly, try connecting to your serial device by using your serial terminal of choice and connecting to the COM port of your serial device at 115200 baud (Linux users can use minicom or screen, Windows users can use PuTTY. macOS users may have to perform extra steps to get their serial device recognized). You should be able to connect with no issues if your serial device is working. Now, power on the MSN TV 2 and wait for it to send &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; to the terminal. As soon as you see this character, immediately reply with a &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt;. If you do this quick enough, you should end up triggering the &amp;quot;MSNTV Service Menu&amp;quot;. The following text that&#039;ll be printed will look similar to this:&lt;br /&gt;
&lt;br /&gt;
 OK&lt;br /&gt;
 &lt;br /&gt;
 MSNTV Service Menu&lt;br /&gt;
 BoxID: xxxxxxxxxxxxxxxxxxxx&lt;br /&gt;
 Version: 1 Build: 387 MSNTV CRC: 758646167 MD5: FEC7884E 15CB25B6 8C59A9FA 4A6D0195&lt;br /&gt;
 POST: 00&lt;br /&gt;
&lt;br /&gt;
Followed by a list of commands supported by the menu. If you don&#039;t respond to the &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; command in time, then simply plug out the power from the MSN TV 2 and plug it back in to try again.&lt;br /&gt;
&lt;br /&gt;
Once you successfully trigger the service menu, now&#039;s where the good stuff begins. In order to flash the patched Linux-capable BIOS, the people over at Toc2rta devised a method to inject shellcode into the MSN TV 2&#039;s RAM that overrides one of the service menu functions and flashes the patched BIOS from the CF card when executed. The function in particular is the video test command (&amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
First, type in &amp;quot;x&amp;quot; in the terminal to go to the &amp;quot;Examine memory&amp;quot; program in the service menu. Then, copy and paste each command in the following list one by one into your terminal to fully inject the shellcode:&lt;br /&gt;
&lt;br /&gt;
(The following commands will only work on RCA RM4100 units. Thomson IP1000 units use a different set of commands that we won&#039;t include here for now. A disassembled version of this shellcode can be found [[MSN TV 2/Linux Shellcode Disassembly|here]])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
M 4 0x0082E160 0x82E1D368&lt;br /&gt;
M 4 0x0082E164 0x0FEEE800&lt;br /&gt;
M 4 0x0082E168 0x036A0000&lt;br /&gt;
M 4 0x0082E16C 0x82E1DE68&lt;br /&gt;
M 4 0x0082E170 0xAB1EE800&lt;br /&gt;
M 4 0x0082E174 0xFF68FFFD&lt;br /&gt;
M 4 0x0082E178 0x68FFFFFF&lt;br /&gt;
M 4 0x0082E17C 0x00100000&lt;br /&gt;
M 4 0x0082E180 0xB286E850&lt;br /&gt;
M 4 0x0082E184 0xC481FFFD&lt;br /&gt;
M 4 0x0082E188 0x00000018&lt;br /&gt;
M 4 0x0082E18C 0x0000003D&lt;br /&gt;
M 4 0x0082E190 0x68117F00&lt;br /&gt;
M 4 0x0082E194 0x0082E1FB&lt;br /&gt;
M 4 0x0082E198 0x000FBBE8&lt;br /&gt;
M 4 0x0082E19C 0x04C48100&lt;br /&gt;
M 4 0x0082E1A0 0xC3000000&lt;br /&gt;
M 4 0x0082E1A4 0x82E1E768&lt;br /&gt;
M 4 0x0082E1A8 0x0FAAE800&lt;br /&gt;
M 4 0x0082E1AC 0x00680000&lt;br /&gt;
M 4 0x0082E1B0 0x68000000&lt;br /&gt;
M 4 0x0082E1B4 0x00100000&lt;br /&gt;
M 4 0x0082E1B8 0x10000068&lt;br /&gt;
M 4 0x0082E1BC 0x21C2E800&lt;br /&gt;
M 4 0x0082E1C0 0x0768FFFD&lt;br /&gt;
M 4 0x0082E1C4 0xE80082E2&lt;br /&gt;
M 4 0x0082E1C8 0x00000F8C&lt;br /&gt;
M 4 0x0082E1CC 0x0014C481&lt;br /&gt;
M 4 0x0082E1D0 0x68C30000&lt;br /&gt;
M 4 0x0082E1D4 0x68742069&lt;br /&gt;
M 4 0x0082E1D8 0x0A657265&lt;br /&gt;
M 4 0x0082E1DC 0x6962000D&lt;br /&gt;
M 4 0x0082E1E0 0x622E736F&lt;br /&gt;
M 4 0x0082E1E4 0x73006E69&lt;br /&gt;
M 4 0x0082E1E8 0x74726174&lt;br /&gt;
M 4 0x0082E1EC 0x20676E69&lt;br /&gt;
M 4 0x0082E1F0 0x73616C66&lt;br /&gt;
M 4 0x0082E1F4 0x2E2E2E68&lt;br /&gt;
M 4 0x0082E1F8 0x69000D0A&lt;br /&gt;
M 4 0x0082E1FC 0x65206F2F&lt;br /&gt;
M 4 0x0082E200 0x726F7272&lt;br /&gt;
M 4 0x0082E204 0x66000D0A&lt;br /&gt;
M 4 0x0082E208 0x6873616C&lt;br /&gt;
M 4 0x0082E20C 0x20676E69&lt;br /&gt;
M 4 0x0082E210 0x63637573&lt;br /&gt;
M 4 0x0082E214 0x66737365&lt;br /&gt;
M 4 0x0082E218 0x202C6C75&lt;br /&gt;
M 4 0x0082E21C 0x20756F79&lt;br /&gt;
M 4 0x0082E220 0x206E6163&lt;br /&gt;
M 4 0x0082E224 0x6F626572&lt;br /&gt;
M 4 0x0082E228 0x0D0A746F&lt;br /&gt;
M 4 0x0082E22C 0x00000000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the commands have been entered into the terminal, type in &amp;quot;q&amp;quot; to exit the &amp;quot;Examine memory&amp;quot; program. Then, type in &amp;quot;v&amp;quot;. Assuming everything&#039;s been done correctly, the MSN TV 2 should print the following text:&lt;br /&gt;
&lt;br /&gt;
 Running test graphics ...&lt;br /&gt;
 HW_TestGraphics&lt;br /&gt;
 hi there&lt;br /&gt;
 starting flash...&lt;br /&gt;
&lt;br /&gt;
The MSN TV 2 will flicker the power and message lights back and forth while the shellcode flashes the patched BIOS. The terminal will then print &amp;quot;flashing successful, you can now reboot&amp;quot; when it&#039;s done. To reboot without touching the MSN TV 2 again, just press Enter to exit the video test, and then type in &amp;quot;q&amp;quot; to reboot the box. On reboot, the Linux kernel should boot and print to the serial terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Congrats! You&#039;ve successfully hacked your MSN TV 2 box to run Linux. Go crazy with it. I have no idea how useful they&#039;d be nowadays, but now you can load whatever programs you want onto the CompactFlash card or run a server on it. Whatever you want to do to make it your own. It would definitely be cooler if a compiled video patch were still available or better yet, if a GUI distro or modern Linux kernel can be compiled to run on the MSN TV 2. This stuff hasn&#039;t gotten any attention in the past decade, so there&#039;s a lot of room for improvement. Feel free to join the [https://discord.gg/qke279EUa8 WebTV/MSN TV Discord] to further discuss about this topic.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=TellyScript&amp;diff=632</id>
		<title>TellyScript</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=TellyScript&amp;diff=632"/>
		<updated>2023-08-26T19:00:13Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TellyScript is a scripting language used by WebTV/MSN TV clients that specifies access numbers and dialing instructions that should be used to connect to the WebTV/MSN TV network. It was designed by Andy Rubin and was based off a scripting language he had previously written in college. The name is a pun on &amp;quot;Telescript&amp;quot;, a scripting language developed by General Magic, a company Rubin and many other early WebTV Networks employees worked for prior to joining WebTV.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
At its core, TellyScript is designed to operate as a dialing script for WebTV/MSN TV clients, while having the flexibility of a general programming language, like C. It contains both general C-like functions and dedicated, WebTV-specific functions that can be taken advantage of to have better control over the connection process. This allows TellyScripts to do things like directly initialize the modem, update the progress bar on the connecting screen at specific events when connecting, work around modem-related bugs, use one of up to eight different sets of POPs (Point of Presence) to connect to based on the day of the week, time, and month a user is connecting on, and handling different kinds of failures. On the service side, TellyScripts sent to WebTV/MSN TV clients are generated from C-like script fragments, which include common TellyScript functions, locale-specific code, code to support logging in to supported WebTV/MSN TV ISPs, and code generated on the fly, which contain the actual access numbers and if applicable, toll call warnings. These fragments are selectively combined as the service sees fit for each WebTV/MSN TV client depending on factors like what type of box or client a user is connecting with and their location. The combined fragments are then tokenized and compressed before being sent to the WebTV/MSN TV client. The service also had the ability to track the last two TellyScripts sent for each WebTV/MSN TV client in the event the script computed on the service is different and has to be updated (the last two are tracked to accomodate the quirk of WebTV/MSN TV clients not saving TellyScripts to NVRAM unless they&#039;re powered off).&lt;br /&gt;
&lt;br /&gt;
On the client side, a TellyScript is obtained by first being downloaded off the [[WTVP/Processes/First-Time Registration|pre-registration]] (scriptless) servers after the WebTV/MSN TV service has detected that the user&#039;s location is supported (this is based off the phone number they&#039;ve dialed in from, or a number the user specified directly on the service if their phone line doesn&#039;t support ANI). The box will store this script in NVRAM and use it for all future connections unless it&#039;s cleared or replaced.&lt;br /&gt;
&lt;br /&gt;
The scripting language used by TellyScript is based off a C-like language that utilized byte-sized tokens for keywords, data types, and general script flow. It also utilized two types of compression: a simple &amp;quot;minification&amp;quot; algorithm that involves turning variable and function names into 1 or 2-letter names, and LZSS compression of the TellyScript code using a WebTV-specific variation of the algorithm.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
The structure of a TellyScript consists of a 36-byte header and the actual script, the latter of which is compressed and minified. The header starts with the magic string &amp;quot;ANDY&amp;quot; (0x414e4459 in hexadecimal). This is in reference to Andy Rubin, who designed the scripting language. The rest of the header contains two version fields with no known purpose, a field that possibly stores a 4-byte hash (possibly CRC32), which is used by the service to track if the client needs their script to be updated, fields for the lengths of the decompressed and compressed script data, a UNIX timestamp of when the script was generated, and an unknown field that has no discernable purpose right now. All integers in the header are packed as big endian 32-bit values.&lt;br /&gt;
&lt;br /&gt;
The following table will be provided to document the header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
! Field Name !! Type !! Offset !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Magic bytes || uint32 || 0x00 || Magic bytes identifying TellyScript header. Value always should be &amp;lt;code&amp;gt;0x414e4459&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;ANDY&amp;lt;/code&amp;gt; in ASCII)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;version1&amp;quot; || uint32 (possibly) || 0x04 || Use unknown. Value is usually 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;version2&amp;quot; || uint32 (possibly) || 0x08 || Use unknown. Value is usually 1, but has been reported to have a different value in at least one TellyScript&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;hash1&amp;quot; || uint32 || 0x0c || Possibly a CRC32 hash. Sent in WTVP request messages in the &amp;lt;code&amp;gt;wtv-script-id&amp;lt;/code&amp;gt; header if a client has a valid TellyScript. This hash value was read by the WebTV/MSN TV service to track if clients needed their scripts to be updated&lt;br /&gt;
|-&lt;br /&gt;
| Time created || uint32 || 0x10 || UNIX timestamp of the exact date and time a TellyScript was generated from the WebTV/MSN TV servers. Sent in WTVP request messages in the &amp;lt;code&amp;gt;wtv-script-mod&amp;lt;/code&amp;gt; header if a client has a valid TellyScript&lt;br /&gt;
|-&lt;br /&gt;
| Compressed script length || uint32 || 0x14 || Length of LZSS compressed script&lt;br /&gt;
|-&lt;br /&gt;
| Decompressed script length || uint32 || 0x18 || Length of decompressed script&lt;br /&gt;
|-&lt;br /&gt;
| Decompressed script hash || uint32 || 0x1c || CRC32 hash of decompressed script&lt;br /&gt;
|-&lt;br /&gt;
| &amp;quot;unknown1&amp;quot; || uint32 (possibly) || 0x20 || Unknown value. Always has value 0x0101ffff from looking at archived TellyScripts&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--pre&amp;gt;&lt;br /&gt;
struct TellyScript_Header&lt;br /&gt;
{&lt;br /&gt;
    uint32_t magic; /* Value always should be 0x414e4459 (&amp;quot;ANDY&amp;quot; in ASCII) */&lt;br /&gt;
    uint32_t version1; /* Use unknown. Value is usually 1 */&lt;br /&gt;
    uint32_t version2; /* Use unknown. Value is usually 1, but has been reported to have a different value in at least one TellyScript */&lt;br /&gt;
    uint32_t hash1; /* Use unknown. Possibly a CRC32 hash */&lt;br /&gt;
    uint32_t timestampPossibly; /* Exact use unknown. Assumed to most likely be a UNIX timestamp */&lt;br /&gt;
    uint32_t compressedLength; /* Length of (LZSS) compressed script */&lt;br /&gt;
    uint32_t decompressedLength; /* Length of decompressed script */&lt;br /&gt;
    uint32_t crcDecompressed; /* CRC32 hash of decompressed script */&lt;br /&gt;
    uint32_t unknown1; /* Unknown value. Always has value 0x0101ffff from looking at archived TellyScripts */&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Information on the tokenized scripting language is too extensive for us to simply write up here at the moment, and will possibly be added in the future when the opportunity allows us. Andy McFadden, however, has since made [https://gist.github.com/fadden/09b581dbb047945d3119048dc05e8bea source code available] that decompresses and decompiles tokenized TellyScript into readable C-like code, and is known to at least work with almost all TellyScript samples in our content archive.&lt;br /&gt;
&lt;br /&gt;
== DialScript ==&lt;br /&gt;
DialScript is a revision of TellyScript, primarily designed for use with Windows CE-based WebTV/MSN TV clients (see [[UltimateTV]]). It&#039;s confirmed to have been used since the Microsoft TV iteration of WebTV technology, but its inception seems to go back as far as 1999, as it was mentioned in a revision of the &amp;quot;[[Greater Scroll of Dialing Wisdom]]&amp;quot; document published in the same year. It&#039;s believed that it was used well into the [[MSNTV 2]]&#039;s lifespan as well.&lt;br /&gt;
&lt;br /&gt;
The only known differences between DialScript and TellyScript is that DialScripts appears to use a different magic string - &amp;lt;code&amp;gt;VKAT&amp;lt;/code&amp;gt;, most likely in reference to Venkatesh Krishnamurthy, the person who is credited in the &amp;quot;Greater Scroll of Dialing Wisdom&amp;quot; for being &amp;quot;in charge&amp;quot; of DialScript. The script data itself, when decompressed, also has 8 extra bytes at the beginning that don&#039;t appear to be part of the script itself and are currently undocumented. Outside of that, the core scripting language used by DialScript appears to have been unchanged from the original TellyScript incarnation. The script contents, however, make more use of system calls for modem stuff. This was likely to take advantage of Windows CE APIs to manage the modem as opposed to doing it at the low level in the script.&lt;br /&gt;
&lt;br /&gt;
== Availability ==&lt;br /&gt;
Thankfully, with the releases of eMac&#039;s &amp;quot;server emulator&amp;quot; over the years, alongside other sources, some TellyScripts and DialScripts have been preserved. For our own curiosity&#039;s sake, though, we would be interested in more versions of these TellyScripts and DialScripts for any version of WebTV/MSN TV. If you got any of them or other WebTV/MSN TV stuff we&#039;re looking for, don&#039;t hesitate to [[Wanted|send them over to us]]!&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
* [https://gist.github.com/wtv-411/6c3e4b4cfce495d8cc56fe634b2e35c5 De-tokenized script from a TellyScript generated on May 27, 1998 for an Old Classic]&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Template:Network/Protocols/WTVP/wtv-services/A-F&amp;diff=631</id>
		<title>Template:Network/Protocols/WTVP/wtv-services/A-F</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Template:Network/Protocols/WTVP/wtv-services/A-F&amp;diff=631"/>
		<updated>2023-08-13T05:27:23Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Fix typo for ftp service port&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Service Name || Description || Common Ports || Supports SECURE method?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-aroundtown || Unknown || 1628 || ?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-author || [[Services/Gallery/Page Builder|Page Builder service]] || 1643 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-census-udp || Specifies a UDP server for a WebTV/MSN TV client to connect to for [[Metering protocol|metering services]], if metering is configured to be enabled || 1657 || No (custom UDP protocol)&lt;br /&gt;
|-&lt;br /&gt;
| wtv-center || Hosts various aggregated sections (also known as [[Services/Gallery/Centers|info centers]]) of the WebTV/MSN TV service (Around Town, Money, WebTV Today, etc.) || 1639 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-chat || Hosts [[Services/Gallery/Chat|Chat]] services || 1630 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtvchat || Possibly the same as &amp;lt;code&amp;gt;wtv-chat&amp;lt;/code&amp;gt;, just with a slightly different change in name || 1630 || Yes(?)&lt;br /&gt;
|-&lt;br /&gt;
| wtv-content || Hosts various misc. content such as video, images, and demos || 1629 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-cookie || Service for managing website cookies on individual user accounts || 1619 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript || Service that facilitates creation of custom TellyScript for the box to use when dialing || 1623 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-disk || Downloadable content service for WebTV Plus units || 1635 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-epguide || Electronic Program Guide service. Used to give WebTV Plus units TV listings || 1633 || ?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-explore2 || [[Services/Gallery/Explore|Explore section]] of WebTV. As ulTRAX put it, &amp;quot;Explore was wasteland of ads presented as a public service&amp;quot; || 1625 || ?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-explore || Probably similar to wtv-explore2 || 1625 || ?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite || Hosts [[Services/Gallery/Favorites|Favorites]] services || 1611 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-flashrom || Flash update services. Allows the box to download flash updates to the system software || 1618 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-forum || Functions similarly to &amp;lt;code&amp;gt;wtv-news&amp;lt;/code&amp;gt; || 1605 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| file || File URI content proxy service(?). Dunno why there&#039;s a service definition for this || 1650 || ?&lt;br /&gt;
|-&lt;br /&gt;
| ftp || Believed to be an FTP content proxy service || 1650 || ?&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Template:Network/Protocols/WTVP/wtv-services/L-P&amp;diff=630</id>
		<title>Template:Network/Protocols/WTVP/wtv-services/L-P</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Template:Network/Protocols/WTVP/wtv-services/L-P&amp;diff=630"/>
		<updated>2023-08-13T05:09:55Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add wtv-music (confirmed to be a real service)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Service Name || Description || Common Ports || Supports SECURE method?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-log || Usage logging/telemetry services || 1609 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-mail || [[Services/Gallery/Mail|E-mail services]] || 1608 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| mailto || &amp;lt;code&amp;gt;mailto&amp;lt;/code&amp;gt; -&amp;amp;gt; &amp;lt;code&amp;gt;wtv-mail&amp;lt;/code&amp;gt; proxy service. Goes to the &amp;quot;Write an e-mail&amp;quot; page with the email address field pre-filled || 1608 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-music || Service that hosts music content for WebTV/MSN TV background music || 1656 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-news || Hosts [[Services/Gallery/Discuss|Discuss]] (newsgroup) services for WebTV/MSN TV || 1605 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| news || Newsgroup URI proxy. Redirects newsgroup requests to WebTV/MSN TV&#039;s own Discuss service || 1605 || Yes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-notices || Unknown || 1622 || ?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-onair || Unknown || 1648 || ?&lt;br /&gt;
|-&lt;br /&gt;
| wtv-partner || Unknown || 1638 || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-passport || Authentication for Passport accounts within WebTV/MSN TV. Currently only seen in use for Messenger login process || 1654 || Yes&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Headers/List&amp;diff=629</id>
		<title>WTVP/Headers/List</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Headers/List&amp;diff=629"/>
		<updated>2023-08-11T21:25:16Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add Cookie and Set-Cookie headers, User-Agent header can be sent server-side too for WebTV&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
List of known recorded WTVP headers. Most have been copied from http://web.archive.org/web/20041026232010/http://ubergeek03.mine.nu/WebTV/WebTVPHeaders.html, but we&#039;ve contributed some previously unknown headers we&#039;ve been able to observe, along with adding descriptions and command header classifications for all headers.&lt;br /&gt;
&lt;br /&gt;
Got any information you&#039;d like to contribute to this? [[Wanted|Send it over to us]] and it might be added onto here.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Header Name !! Description !! Type !! [[WTVP#Command_Headers|Command Header?]] !! Server? !! Client?&lt;br /&gt;
|-&lt;br /&gt;
| Accept-Language || Standard HTTP header || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Cookie || Standard HTTP header || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Connection || Standard HTTP header. WTVP was designed with persistent connections in mind, but official WNI servers have been seen sending a &amp;lt;code&amp;gt;Keep-Alive&amp;lt;/code&amp;gt; Connection header in responses nonetheless || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| Content-length || Standard HTTP header || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Content-type || Standard HTTP header || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Date || Standard HTTP header. Probably only present when connecting through Microsoft TV services || timestamp || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| Expires || Standard HTTP header || timestamp || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| Set-Cookie || Standard HTTP header || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| User-Agent || Standard HTTP header || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Approx-Content-Length || Sent in some responses from the WebTV/MSN TV web proxies. Contains the length of the original data for the queried resource before being sent as multipart data || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| mstv-checkurl-mode || Value currently observed as &amp;quot;1&amp;quot;. Only seen when connecting through Microsoft TV services. Function unknown || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| mstv-client-caps || Only seen when connecting through Microsoft TV services. Function unknown || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| mstv-listing-id || Value currently observed as &amp;quot;C1020&amp;quot;. Only seen when connecting through Microsoft TV services. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| smartcard-data || When connecting to the WebTV/MSN TV service with a compatible smart card inserted, a box will send this header in WTVP requests with the raw smart card data. || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| passport-domain || Domain name of the Passport account (now Microsoft account) linked to the current WebTV/MSN TV subscriber/user account || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| user-id || Appears to be a long string of numbers || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-addresses-url || Contains a service URL for listing all the user&#039;s stored addresses. Addresses are sent with the name, followed by a null byte, then the address with another null byte at the end. This is used for the Address panel. Value currently observed as &amp;lt;code&amp;gt;wtv-mail:/addresslist&amp;lt;/code&amp;gt;. || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ahuf || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-allow-dsc || Value currently observed as &amp;quot;true&amp;quot;. Function unknown || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-add || Specifies sound files as selected by the subscriber/user to add to the background music queue || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-clear || Apparently clears backlog of predefined background music to play. Value currently observed as &amp;quot;no_zits&amp;quot; || string || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-load-playlist || Sets a service URL for the client to query to get the list of background music for the user currently logged in. This header is known to be sent in the response for the [[WTVP/Processes/Retrieving settings|settings service]]. Value currently observed as &amp;lt;code&amp;gt;wtv-setup:/load-playlist&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-remove || Probably similar to wtv-backgroundmusic-add but for removing queued background music || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-boot-message-led-state || Sets the state of the message light. Value currently observed as &amp;quot;blinkSlow&amp;quot;. Need more documentation on this || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-boot-url || Value currently observed as &amp;lt;code&amp;gt;wtv-head-waiter:/login?&amp;lt;/code&amp;gt;. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-bypass-proxy || ??? || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-capability-flags || A hexadecimal string that [[Capability Flags|identifies the capabilities of a WebTV/MSN TV client]], and affects how the service functions on it. Need more documentation on this || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-ccs || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-challenge || A structured BLOB value that&#039;s sent by the server during the headwaiter login stage. Starts the [[WTVP/Processes/Headwaiter#Challenge/Response|challenge/response process]]. When decrypted, it contains random &amp;quot;challenge data&amp;quot; that has to be sent back in the challenge response, along with two sessions keys needed to facilitate &amp;lt;code&amp;gt;SECURE&amp;lt;/code&amp;gt; communication, among other data. || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-challenge-response || Used during the headwaiter [[WTVP/Processes/Headwaiter#Challenge/Response|challenge/response process]] to respond to the challenge with another structured BLOB value that is verified by the server. Sends back the &amp;quot;challenge data&amp;quot; from the wtv-challenge encrypted with the initial key. || BLOB || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-check-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-clickthru-redirect || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-address || Has an IP address of sorts, presumably of the box connecting to the server || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-bootrom-version || An integer that identifies... the boot ROM version? || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-date || Human-readable timestamp in GMT, most likely the date of when the subscriber/user successfully logged on. Need more documentation on this || timestamp || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-rom-type || Identifies the ROM type a WebTV/MSN TV box is running || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-serial-number || [[Silicon Serial ID|SSID]] of the WebTV/MSN TV box - identifies who is sending a WTVP request || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-time-zone || Time zone that corresponds to the user&#039;s current location, in both name and offset (e.g., &amp;quot;PDT -0700&amp;quot;). It is speculated that this value is determined on the service side by using the user&#039;s ANI number when a box dials into the toll-free access number || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-connection-timeout || Value currently observed as &amp;quot;90&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-connect-session-id || Some hexadecimal value we can&#039;t figure out the purpose of. Function unknown || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-country || Two-letter country code. Most of the time it&#039;s just set to &amp;quot;US&amp;quot; though. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-datadownload-checktimeoffset || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-datadownload-login-url || Contains the URL the box accesses when connecting for DataDownload. Value currently observed as wtv-head-waiter:/login?DataDownload=1. Also used to unlock TV Home on WebTV Plus boxes and change the offline home page on WebTV Dreamcast. || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-datadownload-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-disk:/download-list&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-demo-mode || Value currently observed as &amp;quot;0&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-doug || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-ca || Unknown function. Value observed as &amp;quot;0x0&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-receiver || Unknown function. Value observed as &amp;quot;R0022040763-84&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-rom || Unknown function. Value observed as &amp;quot;121PBWDA-F-100BBWDA&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-smartcard || Unknown function. Value observed as &amp;quot;S0004596155-62-DNASP003 Rev381&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-edit-addresses-url || Specifies the URL used for the &amp;quot;Edit Addresses&amp;quot; button in the Address panel. || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-element-logging || Sent in the post-login headwaiter response (for BPS/New Classic boxes at least). Unknown function. Value observed as &amp;lt;code&amp;gt;60 1&amp;lt;/code&amp;gt; || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; ||&lt;br /&gt;
|-&lt;br /&gt;
| wtv-enable-jellyscript || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-encrypted || Sent by the server most likely to tell the WebTV/MSN TV box if a response is encrypted || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-encryption || Tells the server if the WebTV/MSN TV box can understand encrypted communication (&amp;lt;code&amp;gt;SECURE&amp;lt;/code&amp;gt; method?). Resulting behavior unknown || boolean || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-execute-tellyscript-now || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-expire || Expires the specified page in the box&#039;s page cache. || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-expire-all ||  Similar to wtv-expire, but expires all assets for a page as well. Is also used to expire entire page types in some cases (e.g: wtv-expire-all: wtv-) || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-explanation-url || Only observed in error responses. Contains a service URL that so far is only known to point to the &amp;lt;code&amp;gt;wtv-guide&amp;lt;/code&amp;gt; service. Most likely used to give the subscriber/user a page describing the error they encountered || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-explore-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-explore2:/top&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-fader-timeout || Value currently observed as &amp;quot;900&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite-index-url || Contains a service URL related to the &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt; service. Used for the F keys on the keyboard. Value currently observed as &amp;lt;code&amp;gt;wtv-favorite:/favorite-index?&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorites-folders-url || Contains a service URL related to the &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt; service. Used for the list of favorites on the save panel. Value currently observed as &amp;lt;code&amp;gt;wtv-favorite:/list-folders&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite-url || Contains a service URL related to the &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt; service. This is used to define the Favorites page that should be used for the &amp;quot;Favs&amp;quot; button on the keyboard. Value currently observed as &amp;lt;code&amp;gt;wtv-favorite:/favorite&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-field-name || Appears to contain the name of another WTVP header or variable sent in a &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; request. Possibly used for detailing protocol errors. Need more documentation on this || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-filter || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-force-heavyweight-targets || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-force-lightweight-targets || Value currently observed as &amp;lt;code&amp;gt;webtv.net:/&amp;lt;/code&amp;gt;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-goto-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-home-url || Contains the service URL designated to be the service home page. Value currently observed as &amp;lt;code&amp;gt;wtv-home:/home&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-https-proxy || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-human-name || First and last name specified on a subscriber/user account || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-inactive-timeout || Value currently observed as &amp;quot;0&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-incarnation || A counter sent and incremented on each first connection to a frontend server. This is needed to create the encryption key for &amp;lt;code&amp;gt;SECURE&amp;lt;/code&amp;gt; communication. || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-initial-key || A small opaque, 8-byte BLOB sent during pre-registration. Facilitates [[WTVP/Processes/Headwaiter#Challenge/Response|challenge/response]] on the headwaiter. || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-input-timeout || Values currently observed are &amp;quot;86400&amp;quot; and &amp;quot;14400&amp;quot;. Function unknown || integer || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-irc-nick || IRC nickname defined on subscriber/user account for usage with WebTV/MSN TV IRC services || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-language-header || Value currently observed as &amp;quot;en-US,en&amp;quot;. Function unknown || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-link-transition-enabled || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-location || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-lockpage-override || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-login-timeout || Value currently observed as &amp;quot;7200&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logo-duration || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logo-input-interval || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logo-interval || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logon || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logout-url || Contains a service URL designated for logout probably. Value currently observed as &amp;lt;code&amp;gt;wtv-logon:/logout&amp;lt;/code&amp;gt;. Only seen when connecting through Microsoft TV services || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-log-url || Contains a service URL designated for usage logging services || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-lzpf || Observed in headers of encrypted/compressed responses. Usually has a value of 0. If present, the client uses the Huffman-based &amp;quot;LZPF&amp;quot; algorithm to decompress response data. || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-mail-count || Stores how many unread messages the user has. If a client accesses a headwaiter service without selecting an account to log into, this header contains the total of all unread mail for all users, otherwise it only has unread mail for the currently signed in user. This also controls the message light. || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-mail-url || Contains a service URL designated for mail service. Value currently observed as &amp;lt;code&amp;gt;wtv-mail:/listmail&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messagewatch-checktimeoffset || Offset in seconds since midnight for [[WTVP/Processes/MessageWatch|MessageWatch]] activation. || integer || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messagewatch-url || Contains a service URL for the client to log in to on MessageWatch connections. Value currently observed as &amp;lt;code&amp;gt;wtv-head-waiter:/login?MessageWatch=1&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-authorized || Tells the box if the subscriber/user is authorized to use the Messenger feature. 1 - authorized; 0 - not authorized || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-connect-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-enable || Tells the box if the subscriber/user has the Messenger feature enabled. 1 - enabled; 0 - disabled || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-login-url || Defines what service URL should be accessed for [[Services/Technical/Messenger#WTVP|Messenger login]]. Value currently observed as &amp;lt;code&amp;gt;wtv-passport:/messengerlogin&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-open-conversation-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-passportd-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-retry-timeout || Value currently observed as &amp;quot;20&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-server || Defines what hostname the client should use for accessing the [[Services/Technical/Messenger|Messenger service]]. The servers this would point to were a part of the MSN/Windows Live Messenger service, a completely different service that happened to be owned by Microsoft, and is completely separate from WebTV/MSN TV || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing || Enables or disables [[Metering protocol|metering services]] for a supported WebTV/MSN TV build || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing-interval || Sets the time interval in seconds that WebTV/MSN TV should wait in between contacting the Metering server || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing-sessionID || A 30-byte session ID WebTV/MSN TV should use when contacting the Metering server || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing-track-as-free || Related to metering. Function unknown || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-moviesearch-url || Contains a service URL designated for &amp;quot;moviesearch&amp;quot; - probably some ancillary and completely useless feature. Value currently observed as &amp;lt;code&amp;gt;wtv-content:/redirect?req-id=find-movie&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-msnchat-nick || The nickname used for accessing [https://en.wikipedia.org/wiki/MSN_Chat MSN Chat] services within WebTV/MSN TV. It appears to be similar to the value of the &amp;lt;code&amp;gt;wtv-irc-nick&amp;lt;/code&amp;gt; header but with a &amp;quot;&amp;amp;gt;&amp;quot; tacked onto the beginning of it (e.g., &amp;quot;&amp;amp;gt;wtv-nick&amp;quot;) || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-name-server || Defines an IP to use for DNS lookup. Probably not a command header, but multiple instances of this header can exist to define multiple DNS servers || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-next-reconnect-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-noads-targets || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-noback || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-noback-all || Similar to wtv-noback, but can be used to disallow all of one page type (e.g: &amp;lt;code&amp;gt;wtv-noback-all: wtv-&amp;lt;/code&amp;gt;). Value currently observed as &amp;quot;wtv-&amp;quot; || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-notifications-url || The URL that a box should contact when it receives a UDP notification from [[Mail Notify]]. Value currently observed as &amp;lt;code&amp;gt;wtv-notices:/notices&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-nvstorage-dump || URL to a WTVP service that saves a box&#039;s NVRAM (flash memory) data. When this header is present in a WTVP server response, the box will immediately POST to the service URL set in the header with a portion of data from NVRAM, which includes [[TellyScript]] data stored by the box. This header will only work on builds for Old Classic (bf0app) boxes. Original URL was likely &amp;lt;code&amp;gt;wtv-1800:/post-nvstorage-dump&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/wtv-offline-user-list|wtv-offline-user-list]] || Base64-encoded string. When decoded, it reveals an XML string containing a list of users a WebTV/MSN TV subscriber currently has, including their user ID, username, first/last name, password, and if they have access to mail services. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-open-access || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-open-isp-disabled || Value currently observed as &amp;quot;false&amp;quot;. Function unknown || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-phone-log-url || Contains a service URL. Values currently observed are &amp;lt;code&amp;gt;wtv-log:/phone-log&amp;lt;/code&amp;gt;  on successful login, and a URL along the lines of &amp;lt;code&amp;gt;wtv-1800:/post-phone-log?t-baggage-parms=ani-950000000000,ethernet-ani-4156145500,subscriber-id-14331444&amp;lt;/code&amp;gt;. It&#039;s been observed when the header is present in a response, on a WebTV Viewer at least, it will immediately query said service. Most likely used for usage logging || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-preregistration-number || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-printer-model || Value currently observed as &amp;quot;-1,-1&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-printer-pen || Value currently observed as &amp;quot;0,0,1,0&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-printer-setup || Value currently observed as &amp;quot;0,0,1,0&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-print-log-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-log:/log&amp;lt;/code&amp;gt;. Most likely used for usage logging || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-reconnect-url || Specifies the URL the box should access when reconnecting with the Reconnect panel. || URL || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-reload || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-reload-all || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-relogin-url || ??? || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-rename-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-request-rom-upgrade || ??? || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-request-type || Known values observed are &amp;quot;primary&amp;quot; and &amp;quot;prefetch&amp;quot;. Function unknown || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-script-id || Carries the &amp;quot;hash1&amp;quot; value from an installed [[TellyScript]] on the WebTV/MSN TV client, or defaults to 0 if one isn&#039;t present || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-script-mod || Carries the creation time (UNIX epoch) from an installed [[TellyScript]] on the WebTV/MSN TV client, or defaults to 0 if one isn&#039;t present || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-search-url || Contains a service URL most likely designated for the search page. Value currently observed as &amp;lt;code&amp;gt;wtv-center:/search-page&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-send-thumbnail-from || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-send-thumbnail-size || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-send-thumbnail-to || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/wtv-service|wtv-service]] || Defines the services supported by the WebTV/MSN TV service, the IP addresses and corresponding ports they resided on, property flags, and the maximum connections that can be made from a service || string || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-cookie || Sent by server on successful login. Also possibly sent by the client. Need more documentation on this || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-data || Appears to be an XML string with information on the user currently logged in. Only observed when logging on through Microsoft TV services || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-message || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-timeout || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-settings-url || Contains a service URL to the settings service, which sends the client the server-side settings for the currently logged-in user. Value currently observed as &amp;lt;code&amp;gt;wtv-setup:/get-settings&amp;lt;/code&amp;gt;. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-show-time || Values observed are &amp;quot;0&amp;quot; and &amp;quot;3&amp;quot;. Function unknown. Contrary to eMac&#039;s write-up, this header doesn&#039;t seem to appear in server responses, and so far has only been observed in service requests. || ??? || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-show-time-enabled || Value currently observed as &amp;quot;true&amp;quot;. Function unknown. || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-show-time-record || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-smartcard-inserted-message || Related to the (rarely utilized) WebTV/MSN TV smartcard feature. Value currently observed as &amp;quot;Contacting service&amp;quot;. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-smartcard-inserted-url || Related to the (rarely utilized) WebTV/MSN TV smartcard feature. Value currently observed as &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. WebTV Classic boxes require this header for inserted smartcards to function. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-smartcard-removed-url || Related to the (rarely utilized) WebTV/MSN TV smartcard feature. Value currently observed as &amp;lt;code&amp;gt;wtv-smartcard:/remove&amp;lt;/code&amp;gt;. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spotad-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-spot:/get-ad&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-clickthru-url || Contains a service URL. Values observed are &amp;lt;code&amp;gt;wtv-spot:/ad-clickthrough?ad-click-ref=%s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wtv-spot:/clkURL/%s&amp;lt;/code&amp;gt;. Function unknown || URL || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-directive || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-doze || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-duty-cycle || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-impression-time || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-minimum-time || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-purge-queue || Probably does something with the WebTV/MSN TV box cache. Need more documentation on this || integer || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-queue-add || Value currently observed as &amp;lt;code&amp;gt;queue=1&amp;amp;amp;adID=0000001102cbda8500000000&amp;amp;amp;creative=[xxxxx]&amp;lt;/code&amp;gt;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-spot:/spot&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-certs-checksum || Contains a checksum possibly related to the certificate download defined by the &amp;lt;code&amp;gt;wtv-ssl-certs-download-url&amp;lt;/code&amp;gt; header. Judging from the checksum length it&#039;s probably meant to be MD5. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-certs-download-url || Contains a service URL. Possibly used to allow the client to download new SSL root certificates. Value currently observed as &amp;lt;code&amp;gt;wtv-head-waiter:/download-ssl-certs&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-log-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-log:/log&amp;lt;/code&amp;gt;. Most likely used for usage logging || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-start-at-tourist-page || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-chipversion || ??? || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-cpuspeed || Probably has to do with CPU speed but if that&#039;s the case, it&#039;s not known how it&#039;s measured || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-sysconfig || ??? || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-version || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-tcp-log-url || Possibly related to the other &amp;quot;log-url&amp;quot; headers, but no known documentation of this header in particular is out in the wild || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ticket || An opaque blob value sent in WebTV/MSN TV service requests to verify sessions after login. Also known to be sent to a box during headwaiter login || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-title || Used to specify the title in files that don&#039;t normally have them. Can be used in the headers of a service response or as a query for a file (e.g: &amp;lt;code&amp;gt;http://somesite.com/midi.mid?wtv-title=sometitle)&amp;lt;/code&amp;gt; || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tmp-filesystem || Used to specify a location for a new ROMFS container to be downloaded by the client. This will be provided by the server when the client knows its ROMFS is damaged. || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tourist-active || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tourist-enabled || ??? || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition || Only observed in packet captures when browsing between service pages. Currently observed values are &amp;quot;light&amp;quot; and &amp;quot;none&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition-override || Values currently observed are &amp;quot;normal&amp;quot; and &amp;quot;off&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition-page || Value currently observed as &amp;lt;code&amp;gt;wtv-home:/shared/transition/en-US/pageWithAd.html&amp;lt;/code&amp;gt;. Function unknown || URL || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition-page-noad || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-trusted || Used to set trust on pages. For some reason, this header will distrust any page it gets sent with, regardless of if it&#039;s set to true or false. || boolean || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tvconnection-timeout || Value currently observed as &amp;quot;600&amp;quot;. Function unknown || integer || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tv-vbidisable || VBI = Vertical Blanking Interval? Function unknown || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tv-zipcode || Contains user&#039;s ZIP code, but probably isn&#039;t used by the service itself. Need more documentation on this || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-id || Probably similar to the &amp;lt;code&amp;gt;user-id&amp;lt;/code&amp;gt; header. Need more documentation on this || ??? || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-inactive-warning-time || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-name || Username associated with WebTV/MSN TV account || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-requested-upgrade || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-videoad-path || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-videoad-playid || Value currently observed as a hexadecimal string. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-videoad-playname || Value currently observed as a file name ending in &amp;quot;.mpg&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-visit || WTVP&#039;s own version of the HTTP &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt; header used mainly to route the WebTV/MSN TV box to other service URLs on non-3xx responses || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-zipcode || ZIP code of WebTV/MSN TV account || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Headers/List&amp;diff=628</id>
		<title>WTVP/Headers/List</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Headers/List&amp;diff=628"/>
		<updated>2023-08-11T20:51:23Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add Approx-Content-Length&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
List of known recorded WTVP headers. Most have been copied from http://web.archive.org/web/20041026232010/http://ubergeek03.mine.nu/WebTV/WebTVPHeaders.html, but we&#039;ve contributed some previously unknown headers we&#039;ve been able to observe, along with adding descriptions and command header classifications for all headers.&lt;br /&gt;
&lt;br /&gt;
Got any information you&#039;d like to contribute to this? [[Wanted|Send it over to us]] and it might be added onto here.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Header Name !! Description !! Type !! [[WTVP#Command_Headers|Command Header?]] !! Server? !! Client?&lt;br /&gt;
|-&lt;br /&gt;
| Accept-Language || Standard HTTP header || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Connection || Standard HTTP header. WTVP was designed with persistent connections in mind, but official WNI servers have been seen sending a &amp;lt;code&amp;gt;Keep-Alive&amp;lt;/code&amp;gt; Connection header in responses nonetheless || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| Content-length || Standard HTTP header || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Content-type || Standard HTTP header || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Date || Standard HTTP header. Probably only present when connecting through Microsoft TV services || timestamp || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| Expires || Standard HTTP header || timestamp || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| User-Agent || Standard HTTP header || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Approx-Content-Length || Sent in some responses from the WebTV/MSN TV web proxies. Contains the length of the original data for the queried resource before being sent as multipart data || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| mstv-checkurl-mode || Value currently observed as &amp;quot;1&amp;quot;. Only seen when connecting through Microsoft TV services. Function unknown || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| mstv-client-caps || Only seen when connecting through Microsoft TV services. Function unknown || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| mstv-listing-id || Value currently observed as &amp;quot;C1020&amp;quot;. Only seen when connecting through Microsoft TV services. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| smartcard-data || When connecting to the WebTV/MSN TV service with a compatible smart card inserted, a box will send this header in WTVP requests with the raw smart card data. || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| passport-domain || Domain name of the Passport account (now Microsoft account) linked to the current WebTV/MSN TV subscriber/user account || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| user-id || Appears to be a long string of numbers || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-addresses-url || Contains a service URL for listing all the user&#039;s stored addresses. Addresses are sent with the name, followed by a null byte, then the address with another null byte at the end. This is used for the Address panel. Value currently observed as &amp;lt;code&amp;gt;wtv-mail:/addresslist&amp;lt;/code&amp;gt;. || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ahuf || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-allow-dsc || Value currently observed as &amp;quot;true&amp;quot;. Function unknown || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-add || Specifies sound files as selected by the subscriber/user to add to the background music queue || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-clear || Apparently clears backlog of predefined background music to play. Value currently observed as &amp;quot;no_zits&amp;quot; || string || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-load-playlist || Sets a service URL for the client to query to get the list of background music for the user currently logged in. This header is known to be sent in the response for the [[WTVP/Processes/Retrieving settings|settings service]]. Value currently observed as &amp;lt;code&amp;gt;wtv-setup:/load-playlist&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-backgroundmusic-remove || Probably similar to wtv-backgroundmusic-add but for removing queued background music || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-boot-message-led-state || Sets the state of the message light. Value currently observed as &amp;quot;blinkSlow&amp;quot;. Need more documentation on this || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-boot-url || Value currently observed as &amp;lt;code&amp;gt;wtv-head-waiter:/login?&amp;lt;/code&amp;gt;. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-bypass-proxy || ??? || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-capability-flags || A hexadecimal string that [[Capability Flags|identifies the capabilities of a WebTV/MSN TV client]], and affects how the service functions on it. Need more documentation on this || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-ccs || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-challenge || A structured BLOB value that&#039;s sent by the server during the headwaiter login stage. Starts the [[WTVP/Processes/Headwaiter#Challenge/Response|challenge/response process]]. When decrypted, it contains random &amp;quot;challenge data&amp;quot; that has to be sent back in the challenge response, along with two sessions keys needed to facilitate &amp;lt;code&amp;gt;SECURE&amp;lt;/code&amp;gt; communication, among other data. || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-challenge-response || Used during the headwaiter [[WTVP/Processes/Headwaiter#Challenge/Response|challenge/response process]] to respond to the challenge with another structured BLOB value that is verified by the server. Sends back the &amp;quot;challenge data&amp;quot; from the wtv-challenge encrypted with the initial key. || BLOB || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-check-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-clickthru-redirect || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-address || Has an IP address of sorts, presumably of the box connecting to the server || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-bootrom-version || An integer that identifies... the boot ROM version? || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-date || Human-readable timestamp in GMT, most likely the date of when the subscriber/user successfully logged on. Need more documentation on this || timestamp || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-rom-type || Identifies the ROM type a WebTV/MSN TV box is running || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-serial-number || [[Silicon Serial ID|SSID]] of the WebTV/MSN TV box - identifies who is sending a WTVP request || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-client-time-zone || Time zone that corresponds to the user&#039;s current location, in both name and offset (e.g., &amp;quot;PDT -0700&amp;quot;). It is speculated that this value is determined on the service side by using the user&#039;s ANI number when a box dials into the toll-free access number || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-connection-timeout || Value currently observed as &amp;quot;90&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-connect-session-id || Some hexadecimal value we can&#039;t figure out the purpose of. Function unknown || string || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-country || Two-letter country code. Most of the time it&#039;s just set to &amp;quot;US&amp;quot; though. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-datadownload-checktimeoffset || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-datadownload-login-url || Contains the URL the box accesses when connecting for DataDownload. Value currently observed as wtv-head-waiter:/login?DataDownload=1. Also used to unlock TV Home on WebTV Plus boxes and change the offline home page on WebTV Dreamcast. || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-datadownload-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-disk:/download-list&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-demo-mode || Value currently observed as &amp;quot;0&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-doug || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-ca || Unknown function. Value observed as &amp;quot;0x0&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-receiver || Unknown function. Value observed as &amp;quot;R0022040763-84&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-rom || Unknown function. Value observed as &amp;quot;121PBWDA-F-100BBWDA&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-echostar-smartcard || Unknown function. Value observed as &amp;quot;S0004596155-62-DNASP003 Rev381&amp;quot; || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-edit-addresses-url || Specifies the URL used for the &amp;quot;Edit Addresses&amp;quot; button in the Address panel. || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-element-logging || Sent in the post-login headwaiter response (for BPS/New Classic boxes at least). Unknown function. Value observed as &amp;lt;code&amp;gt;60 1&amp;lt;/code&amp;gt; || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; ||&lt;br /&gt;
|-&lt;br /&gt;
| wtv-enable-jellyscript || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-encrypted || Sent by the server most likely to tell the WebTV/MSN TV box if a response is encrypted || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-encryption || Tells the server if the WebTV/MSN TV box can understand encrypted communication (&amp;lt;code&amp;gt;SECURE&amp;lt;/code&amp;gt; method?). Resulting behavior unknown || boolean || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-execute-tellyscript-now || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-expire || Expires the specified page in the box&#039;s page cache. || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-expire-all ||  Similar to wtv-expire, but expires all assets for a page as well. Is also used to expire entire page types in some cases (e.g: wtv-expire-all: wtv-) || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-explanation-url || Only observed in error responses. Contains a service URL that so far is only known to point to the &amp;lt;code&amp;gt;wtv-guide&amp;lt;/code&amp;gt; service. Most likely used to give the subscriber/user a page describing the error they encountered || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-explore-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-explore2:/top&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-fader-timeout || Value currently observed as &amp;quot;900&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite-index-url || Contains a service URL related to the &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt; service. Used for the F keys on the keyboard. Value currently observed as &amp;lt;code&amp;gt;wtv-favorite:/favorite-index?&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorites-folders-url || Contains a service URL related to the &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt; service. Used for the list of favorites on the save panel. Value currently observed as &amp;lt;code&amp;gt;wtv-favorite:/list-folders&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite-url || Contains a service URL related to the &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt; service. This is used to define the Favorites page that should be used for the &amp;quot;Favs&amp;quot; button on the keyboard. Value currently observed as &amp;lt;code&amp;gt;wtv-favorite:/favorite&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-field-name || Appears to contain the name of another WTVP header or variable sent in a &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; request. Possibly used for detailing protocol errors. Need more documentation on this || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-filter || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-force-heavyweight-targets || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-force-lightweight-targets || Value currently observed as &amp;lt;code&amp;gt;webtv.net:/&amp;lt;/code&amp;gt;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-goto-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-home-url || Contains the service URL designated to be the service home page. Value currently observed as &amp;lt;code&amp;gt;wtv-home:/home&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-https-proxy || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-human-name || First and last name specified on a subscriber/user account || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-inactive-timeout || Value currently observed as &amp;quot;0&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-incarnation || A counter sent and incremented on each first connection to a frontend server. This is needed to create the encryption key for &amp;lt;code&amp;gt;SECURE&amp;lt;/code&amp;gt; communication. || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-initial-key || A small opaque, 8-byte BLOB sent during pre-registration. Facilitates [[WTVP/Processes/Headwaiter#Challenge/Response|challenge/response]] on the headwaiter. || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-input-timeout || Values currently observed are &amp;quot;86400&amp;quot; and &amp;quot;14400&amp;quot;. Function unknown || integer || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-irc-nick || IRC nickname defined on subscriber/user account for usage with WebTV/MSN TV IRC services || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-language-header || Value currently observed as &amp;quot;en-US,en&amp;quot;. Function unknown || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-link-transition-enabled || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-location || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-lockpage-override || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-login-timeout || Value currently observed as &amp;quot;7200&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logo-duration || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logo-input-interval || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logo-interval || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logon || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-logout-url || Contains a service URL designated for logout probably. Value currently observed as &amp;lt;code&amp;gt;wtv-logon:/logout&amp;lt;/code&amp;gt;. Only seen when connecting through Microsoft TV services || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-log-url || Contains a service URL designated for usage logging services || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-lzpf || Observed in headers of encrypted/compressed responses. Usually has a value of 0. If present, the client uses the Huffman-based &amp;quot;LZPF&amp;quot; algorithm to decompress response data. || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-mail-count || Stores how many unread messages the user has. If a client accesses a headwaiter service without selecting an account to log into, this header contains the total of all unread mail for all users, otherwise it only has unread mail for the currently signed in user. This also controls the message light. || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-mail-url || Contains a service URL designated for mail service. Value currently observed as &amp;lt;code&amp;gt;wtv-mail:/listmail&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messagewatch-checktimeoffset || Offset in seconds since midnight for [[WTVP/Processes/MessageWatch|MessageWatch]] activation. || integer || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messagewatch-url || Contains a service URL for the client to log in to on MessageWatch connections. Value currently observed as &amp;lt;code&amp;gt;wtv-head-waiter:/login?MessageWatch=1&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-authorized || Tells the box if the subscriber/user is authorized to use the Messenger feature. 1 - authorized; 0 - not authorized || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-connect-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-enable || Tells the box if the subscriber/user has the Messenger feature enabled. 1 - enabled; 0 - disabled || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-login-url || Defines what service URL should be accessed for [[Services/Technical/Messenger#WTVP|Messenger login]]. Value currently observed as &amp;lt;code&amp;gt;wtv-passport:/messengerlogin&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-open-conversation-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-passportd-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-retry-timeout || Value currently observed as &amp;quot;20&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-messenger-server || Defines what hostname the client should use for accessing the [[Services/Technical/Messenger|Messenger service]]. The servers this would point to were a part of the MSN/Windows Live Messenger service, a completely different service that happened to be owned by Microsoft, and is completely separate from WebTV/MSN TV || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing || Enables or disables [[Metering protocol|metering services]] for a supported WebTV/MSN TV build || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing-interval || Sets the time interval in seconds that WebTV/MSN TV should wait in between contacting the Metering server || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing-sessionID || A 30-byte session ID WebTV/MSN TV should use when contacting the Metering server || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-metering-pricing-track-as-free || Related to metering. Function unknown || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-moviesearch-url || Contains a service URL designated for &amp;quot;moviesearch&amp;quot; - probably some ancillary and completely useless feature. Value currently observed as &amp;lt;code&amp;gt;wtv-content:/redirect?req-id=find-movie&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-msnchat-nick || The nickname used for accessing [https://en.wikipedia.org/wiki/MSN_Chat MSN Chat] services within WebTV/MSN TV. It appears to be similar to the value of the &amp;lt;code&amp;gt;wtv-irc-nick&amp;lt;/code&amp;gt; header but with a &amp;quot;&amp;amp;gt;&amp;quot; tacked onto the beginning of it (e.g., &amp;quot;&amp;amp;gt;wtv-nick&amp;quot;) || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-name-server || Defines an IP to use for DNS lookup. Probably not a command header, but multiple instances of this header can exist to define multiple DNS servers || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-next-reconnect-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-noads-targets || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-noback || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-noback-all || Similar to wtv-noback, but can be used to disallow all of one page type (e.g: &amp;lt;code&amp;gt;wtv-noback-all: wtv-&amp;lt;/code&amp;gt;). Value currently observed as &amp;quot;wtv-&amp;quot; || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-notifications-url || The URL that a box should contact when it receives a UDP notification from [[Mail Notify]]. Value currently observed as &amp;lt;code&amp;gt;wtv-notices:/notices&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-nvstorage-dump || URL to a WTVP service that saves a box&#039;s NVRAM (flash memory) data. When this header is present in a WTVP server response, the box will immediately POST to the service URL set in the header with a portion of data from NVRAM, which includes [[TellyScript]] data stored by the box. This header will only work on builds for Old Classic (bf0app) boxes. Original URL was likely &amp;lt;code&amp;gt;wtv-1800:/post-nvstorage-dump&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/wtv-offline-user-list|wtv-offline-user-list]] || Base64-encoded string. When decoded, it reveals an XML string containing a list of users a WebTV/MSN TV subscriber currently has, including their user ID, username, first/last name, password, and if they have access to mail services. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-open-access || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-open-isp-disabled || Value currently observed as &amp;quot;false&amp;quot;. Function unknown || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-phone-log-url || Contains a service URL. Values currently observed are &amp;lt;code&amp;gt;wtv-log:/phone-log&amp;lt;/code&amp;gt;  on successful login, and a URL along the lines of &amp;lt;code&amp;gt;wtv-1800:/post-phone-log?t-baggage-parms=ani-950000000000,ethernet-ani-4156145500,subscriber-id-14331444&amp;lt;/code&amp;gt;. It&#039;s been observed when the header is present in a response, on a WebTV Viewer at least, it will immediately query said service. Most likely used for usage logging || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-preregistration-number || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-printer-model || Value currently observed as &amp;quot;-1,-1&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-printer-pen || Value currently observed as &amp;quot;0,0,1,0&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-printer-setup || Value currently observed as &amp;quot;0,0,1,0&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-print-log-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-log:/log&amp;lt;/code&amp;gt;. Most likely used for usage logging || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-reconnect-url || Specifies the URL the box should access when reconnecting with the Reconnect panel. || URL || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-reload || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-reload-all || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-relogin-url || ??? || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-rename-url || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-request-rom-upgrade || ??? || ??? || ? ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-request-type || Known values observed are &amp;quot;primary&amp;quot; and &amp;quot;prefetch&amp;quot;. Function unknown || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-script-id || Carries the &amp;quot;hash1&amp;quot; value from an installed [[TellyScript]] on the WebTV/MSN TV client, or defaults to 0 if one isn&#039;t present || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-script-mod || Carries the creation time (UNIX epoch) from an installed [[TellyScript]] on the WebTV/MSN TV client, or defaults to 0 if one isn&#039;t present || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-search-url || Contains a service URL most likely designated for the search page. Value currently observed as &amp;lt;code&amp;gt;wtv-center:/search-page&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-send-thumbnail-from || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-send-thumbnail-size || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-send-thumbnail-to || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/wtv-service|wtv-service]] || Defines the services supported by the WebTV/MSN TV service, the IP addresses and corresponding ports they resided on, property flags, and the maximum connections that can be made from a service || string || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-cookie || Sent by server on successful login. Also possibly sent by the client. Need more documentation on this || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-data || Appears to be an XML string with information on the user currently logged in. Only observed when logging on through Microsoft TV services || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-message || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-service-timeout || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-settings-url || Contains a service URL to the settings service, which sends the client the server-side settings for the currently logged-in user. Value currently observed as &amp;lt;code&amp;gt;wtv-setup:/get-settings&amp;lt;/code&amp;gt;. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-show-time || Values observed are &amp;quot;0&amp;quot; and &amp;quot;3&amp;quot;. Function unknown. Contrary to eMac&#039;s write-up, this header doesn&#039;t seem to appear in server responses, and so far has only been observed in service requests. || ??? || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-show-time-enabled || Value currently observed as &amp;quot;true&amp;quot;. Function unknown. || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-show-time-record || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-smartcard-inserted-message || Related to the (rarely utilized) WebTV/MSN TV smartcard feature. Value currently observed as &amp;quot;Contacting service&amp;quot;. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-smartcard-inserted-url || Related to the (rarely utilized) WebTV/MSN TV smartcard feature. Value currently observed as &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. WebTV Classic boxes require this header for inserted smartcards to function. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-smartcard-removed-url || Related to the (rarely utilized) WebTV/MSN TV smartcard feature. Value currently observed as &amp;lt;code&amp;gt;wtv-smartcard:/remove&amp;lt;/code&amp;gt;. Need more documentation on this || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spotad-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-spot:/get-ad&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-clickthru-url || Contains a service URL. Values observed are &amp;lt;code&amp;gt;wtv-spot:/ad-clickthrough?ad-click-ref=%s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wtv-spot:/clkURL/%s&amp;lt;/code&amp;gt;. Function unknown || URL || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-directive || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-doze || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-duty-cycle || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-impression-time || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-minimum-time || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-purge-queue || Probably does something with the WebTV/MSN TV box cache. Need more documentation on this || integer || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-queue-add || Value currently observed as &amp;lt;code&amp;gt;queue=1&amp;amp;amp;adID=0000001102cbda8500000000&amp;amp;amp;creative=[xxxxx]&amp;lt;/code&amp;gt;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-spot-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-spot:/spot&amp;lt;/code&amp;gt;. Function unknown || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-certs-checksum || Contains a checksum possibly related to the certificate download defined by the &amp;lt;code&amp;gt;wtv-ssl-certs-download-url&amp;lt;/code&amp;gt; header. Judging from the checksum length it&#039;s probably meant to be MD5. Need more documentation on this || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-certs-download-url || Contains a service URL. Possibly used to allow the client to download new SSL root certificates. Value currently observed as &amp;lt;code&amp;gt;wtv-head-waiter:/download-ssl-certs&amp;lt;/code&amp;gt; || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-log-url || Contains a service URL. Value currently observed as &amp;lt;code&amp;gt;wtv-log:/log&amp;lt;/code&amp;gt;. Most likely used for usage logging || URL || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ssl-timeout || Value currently observed as &amp;quot;240&amp;quot;. Function unknown || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-start-at-tourist-page || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-chipversion || ??? || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-cpuspeed || Probably has to do with CPU speed but if that&#039;s the case, it&#039;s not known how it&#039;s measured || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-sysconfig || ??? || integer || No ||  || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-system-version || ??? || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-tcp-log-url || Possibly related to the other &amp;quot;log-url&amp;quot; headers, but no known documentation of this header in particular is out in the wild || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-ticket || An opaque blob value sent in WebTV/MSN TV service requests to verify sessions after login. Also known to be sent to a box during headwaiter login || BLOB || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| wtv-title || Used to specify the title in files that don&#039;t normally have them. Can be used in the headers of a service response or as a query for a file (e.g: &amp;lt;code&amp;gt;http://somesite.com/midi.mid?wtv-title=sometitle)&amp;lt;/code&amp;gt; || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tmp-filesystem || Used to specify a location for a new ROMFS container to be downloaded by the client. This will be provided by the server when the client knows its ROMFS is damaged. || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tourist-active || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tourist-enabled || ??? || boolean || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition || Only observed in packet captures when browsing between service pages. Currently observed values are &amp;quot;light&amp;quot; and &amp;quot;none&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition-override || Values currently observed are &amp;quot;normal&amp;quot; and &amp;quot;off&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition-page || Value currently observed as &amp;lt;code&amp;gt;wtv-home:/shared/transition/en-US/pageWithAd.html&amp;lt;/code&amp;gt;. Function unknown || URL || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-transition-page-noad || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-trusted || Used to set trust on pages. For some reason, this header will distrust any page it gets sent with, regardless of if it&#039;s set to true or false. || boolean || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tvconnection-timeout || Value currently observed as &amp;quot;600&amp;quot;. Function unknown || integer || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tv-vbidisable || VBI = Vertical Blanking Interval? Function unknown || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-tv-zipcode || Contains user&#039;s ZIP code, but probably isn&#039;t used by the service itself. Need more documentation on this || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-id || Probably similar to the &amp;lt;code&amp;gt;user-id&amp;lt;/code&amp;gt; header. Need more documentation on this || ??? || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-inactive-warning-time || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-name || Username associated with WebTV/MSN TV account || string || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-user-requested-upgrade || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-videoad-path || ??? || ??? || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-videoad-playid || Value currently observed as a hexadecimal string. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-videoad-playname || Value currently observed as a file name ending in &amp;quot;.mpg&amp;quot;. Function unknown || string || ? || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-visit || WTVP&#039;s own version of the HTTP &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt; header used mainly to route the WebTV/MSN TV box to other service URLs on non-3xx responses || URL || Yes || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-zipcode || ZIP code of WebTV/MSN TV account || integer || No || &amp;lt;center&amp;gt;X&amp;lt;/center&amp;gt; || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Services/wtv-customscript/URLs&amp;diff=627</id>
		<title>WTVP/Services/wtv-customscript/URLs</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Services/wtv-customscript/URLs&amp;diff=627"/>
		<updated>2023-08-11T18:13:19Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Correct description for benchmark-image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
URLs for wtv-customscript WTVP service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URL || Description || Methods Supported || wtv-token Present? || Notes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/vendatelly || &amp;quot;Vend-a-Telly&amp;quot; - offers services for generating and loading custom [[TellyScript|TellyScripts]]. Provides the options of pre-made TellyScripts or building one from scratch || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/tellyscript || Generates a custom TellyScript based on user-provided options. Need more documentation on this || GET || Yes || E.g., &amp;quot;wtv-customscript:/tellyscript-wtv-token-1648397422-47E5638DB31376C109EB94C94EFA169C?provider=cnc&amp;amp;amp;number=2522113&amp;quot; - generates a TellyScript that dials CNC from number 252-2113 (Lexington, KY)&lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/benchmark-image || Downloads a test image for benchmarking POP connection speeds. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/benchmark-test-result || Shows results of &amp;quot;benchmark-image&amp;quot; test. Need more documentation on this || ??? || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/poptour-guide || &amp;quot;Der PopTourSchnitzel&amp;quot; - stress tests POP numbers || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/poptour-choose-pop || Page to specify which POP number to &amp;quot;pummel to a bloody pulp&amp;quot; (stress test) || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/poptour-pound-selected-pop || ??? || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/jiffy-pop-o-rama || Phone number lookup. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/poptour || &amp;quot;Tour de POP&amp;quot; - stress tests 8,302(?) POP numbers, possibly more. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-customscript:/poptour?fixed=NNNN || Individual POP number test. Need more documentation on this || GET || Yes || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Services/wtv-favorite/URLs&amp;diff=626</id>
		<title>WTVP/Services/wtv-favorite/URLs</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Services/wtv-favorite/URLs&amp;diff=626"/>
		<updated>2023-08-11T18:08:43Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
URLs for wtv-favorite WTVP service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URL || Description || Methods Supported || wtv-token Present? || Notes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/list-folders || Sent in the &amp;lt;code&amp;gt;wtv-favorites-folders-url&amp;lt;/code&amp;gt; header in the [[WTVP/Processes/Headwaiter/Final Responses|final headwaiter response]]. Simple GET service that returns a sequence of NUL-terminated strings for the names of each favorite folder in the current user&#039;s account || GET || No || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/add || [[WTVP/Processes/Favorites#Adding favorites|Favorite add service]]. POST service that adds a website or service page as a favorite to a specified favorite folder on the current user&#039;s account. It also submits a thumbnail for the favorite encoded in a proprietary &amp;quot;wtv-bitmap&amp;quot; format || POST || No || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-folders || Favorites index. Lists all favorite folders a subscriber/user has || GET || ? || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-browser?favorite-folder-name=xxxxx || Shows favorites in a specified folder (&amp;quot;favorite-folder-name&amp;quot;) || GET || ? || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-add-folder-page || &amp;quot;Add a folder&amp;quot; page || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/commit-add-folder?new-folder-name=xxxxx || Adds a favorite folder. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-samples-page || Page that allow the subscriber/user to add predefined &amp;quot;sample&amp;quot; folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-rename-folders || Page that allows the subscriber/user to rename a favorite folder. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/commit-rename-folders || Renames favorite folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-discard-folders || Page that allow the subscriber/user to remove any favorite folder they currently have. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/commit-discard-folders || Removes favorite folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-organize-favorites?favorite-folder-name=xxxxx || Shows options page for managing favorites within a folder || GET || ? || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-discard-favorites?favorite-folder-name=xxxxx || Allows the subscriber/user to remove favorites within a folder || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-arrange-favorites?favorite-folder-name=xxxxx || Shows page that allows enabling/disabling of thumbnails when previewing favorites. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-move-favorites?favorite-folder-name=xxxxx || Shows page that allows subscriber/user to move favorites between folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-shortcuts-favorites?favorite-folder-name=xxxxx || Shows page that allows subscriber/user to assign shortcut keys to favorites. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-rename-favorites?favorite-folder-name=xxxxx || Shows page that allows subscriber/user to rename favorites. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/MyLinksMain?template=MyLinksMain.tmpl || Presents options to modify link sidebar on info Centers. Need more documentation on this || GET || No(?) || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Services/wtv-favorite/URLs&amp;diff=625</id>
		<title>WTVP/Services/wtv-favorite/URLs</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Services/wtv-favorite/URLs&amp;diff=625"/>
		<updated>2023-08-11T18:07:46Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add wtv-favorite:/list-folders and wtv-favorite:/add&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
URLs for wtv-favorite WTVP service.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URL || Description || Methods Supported || wtv-token Present? || Notes&lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/list-folders || Sent in the &amp;lt;code&amp;gt;wtv-favorites-folders-url&amp;lt;/code&amp;gt; header in the [[WTVP/Processes/Headwaiter/Final Responses|final headwaiter response]]. Simple GET service that returns a sequence of NUL-terminated strings for the names of each favorite folder in the current user&#039;s account || GET || No || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/add || [[WTVP/Processes/Favorites#Adding favorites|Favorite add service]]. POST service that adds a website or service page as a favorite to a specified favorite folder. It also submits a thumbnail for the favorite encoded in a proprietary &amp;quot;wtv-bitmap&amp;quot; format || POST || No || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-folders || Favorites index. Lists all favorite folders a subscriber/user has || GET || ? || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-browser?favorite-folder-name=xxxxx || Shows favorites in a specified folder (&amp;quot;favorite-folder-name&amp;quot;) || GET || ? || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-add-folder-page || &amp;quot;Add a folder&amp;quot; page || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/commit-add-folder?new-folder-name=xxxxx || Adds a favorite folder. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-samples-page || Page that allow the subscriber/user to add predefined &amp;quot;sample&amp;quot; folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-rename-folders || Page that allows the subscriber/user to rename a favorite folder. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/commit-rename-folders || Renames favorite folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-discard-folders || Page that allow the subscriber/user to remove any favorite folder they currently have. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/commit-discard-folders || Removes favorite folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-organize-favorites?favorite-folder-name=xxxxx || Shows options page for managing favorites within a folder || GET || ? || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-discard-favorites?favorite-folder-name=xxxxx || Allows the subscriber/user to remove favorites within a folder || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-arrange-favorites?favorite-folder-name=xxxxx || Shows page that allows enabling/disabling of thumbnails when previewing favorites. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-move-favorites?favorite-folder-name=xxxxx || Shows page that allows subscriber/user to move favorites between folders. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-shortcuts-favorites?favorite-folder-name=xxxxx || Shows page that allows subscriber/user to assign shortcut keys to favorites. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/serve-rename-favorites?favorite-folder-name=xxxxx || Shows page that allows subscriber/user to rename favorites. Need more documentation on this || GET || Yes || &lt;br /&gt;
|-&lt;br /&gt;
| wtv-favorite:/MyLinksMain?template=MyLinksMain.tmpl || Presents options to modify link sidebar on info Centers. Need more documentation on this || GET || No(?) || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Miscellaneous&amp;diff=624</id>
		<title>WTVP/Processes/Miscellaneous</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Miscellaneous&amp;diff=624"/>
		<updated>2023-08-11T03:36:38Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add request for splash-sync&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
Documentation for miscellaneous WTVP services utilized by WebTV/MSN TV.&lt;br /&gt;
&lt;br /&gt;
== Address list ==&lt;br /&gt;
&lt;br /&gt;
Simple WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; service hosted on a service URL defined in the [[WTVP/Processes/Headwaiter/Final Responses|final headwaiter response]] with the &amp;lt;code&amp;gt;wtv-addresses-url&amp;lt;/code&amp;gt; header. This service is usually hosted on a &amp;lt;code&amp;gt;wtv-mail&amp;lt;/code&amp;gt; server, and the original service URL used to host the service was &amp;lt;code&amp;gt;wtv-mail:/addresslist&amp;lt;/code&amp;gt;. This service returns a list of contacts in a user&#039;s address book, listing both the nickname and e-mail address for each contact. This service is called after the client receives the final headwaiter response during login, or when a user pulls up the Send panel from the Options bar to let them choose which contacts to send a page to through the WebTV/MSN TV Mail service.&lt;br /&gt;
&lt;br /&gt;
The response has a Content-Type of &amp;lt;code&amp;gt;x-wtv-addresses&amp;lt;/code&amp;gt;, and the body consists of one or more NUL-terminated string sequences that follow this format: &amp;lt;code&amp;gt;[Contact nickname][0x00][Contact e-mail address][0x00]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET wtv-mail:/addresslist\r\n&lt;br /&gt;
wtv-system-cpuspeed: 166164662\r\n&lt;br /&gt;
wtv-system-sysconfig: 3116068\r\n&lt;br /&gt;
wtv-disk-size: 8006\r\n&lt;br /&gt;
wtv-incarnation: 4\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
Content-Type: x-wtv-addresses\n&lt;br /&gt;
Content-length: {length of body}\n&lt;br /&gt;
\n&lt;br /&gt;
John Doe[0x00]johndoe@webtv.net[0x00]Jane Doe[0x00]janedoe@webtv.net[0x00]Joe Britt[0x00]joeb@webtv.net[0x00]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mail sync service ==&lt;br /&gt;
&lt;br /&gt;
Later in the WebTV/MSN TV service&#039;s life (by 2.9 at the latest), some pages started embedding a 1x1 GIF for the sole purpose of updating the message light on the current user&#039;s box to notify them of new mail sooner, if any. On the login splash screen, it embeds an image on &amp;lt;code&amp;gt;wtv-mail:/splash-sync&amp;lt;/code&amp;gt; to do this. This is another simple WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; service that returns a 43 byte GIF with minimal headers, including the &amp;lt;code&amp;gt;wtv-mail-count&amp;lt;/code&amp;gt; header to tell the box how many unread messages the current user has, and an &amp;lt;code&amp;gt;Expires&amp;lt;/code&amp;gt; header. Unlike most image files retrieved from the WTVP servers, the one sent by splash-sync is encrypted. Why it&#039;s encrypted is currently unclear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET wtv-mail:/splash-sync-wtv-token-2442596988-F4BAA3E63FAE9A29B47246A4024BF8A1\r\n&lt;br /&gt;
Referer: wtv-head-waiter:/login-stage-two-wtv-token-3978878462-9763BA920CF00DB580F18DB8A4069C74?new_registration=1\r\n&lt;br /&gt;
wtv-system-cpuspeed: 166164662\r\n&lt;br /&gt;
wtv-system-sysconfig: 3116068\r\n&lt;br /&gt;
wtv-disk-size: 8006\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
wtv-mail-count: {number of unread emails in user&#039;s inbox}\n&lt;br /&gt;
Expires: 60\n&lt;br /&gt;
Content-type: image/gif\n&lt;br /&gt;
Content-length: 43\n&lt;br /&gt;
\n&lt;br /&gt;
{GIF image data}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
47 49 46 38 39 61 02 00 02 00 80 00 00 2B 2B 2B   GIF89a....€..+++&lt;br /&gt;
00 00 00 21 F9 04 01 00 00 00 00 2C 00 00 00 00   ...!ù......,....&lt;br /&gt;
02 00 02 00 00 02 02 84 51 00                     ........Q.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It&#039;s believed that the service &amp;lt;code&amp;gt;wtv-mail:/update-light&amp;lt;/code&amp;gt; performs a similar function to splash-sync. What&#039;s believed to be its response also sends a 43 byte GIF image, but the only captures we&#039;ve seen of it are ones without any mail-related headers. Like splash-sync, the GIF is encrypted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
Content-type: image/gif\n&lt;br /&gt;
Content-length: 43\n&lt;br /&gt;
\n&lt;br /&gt;
{GIF image data}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Favorites&amp;diff=623</id>
		<title>WTVP/Processes/Favorites</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Favorites&amp;diff=623"/>
		<updated>2023-08-11T01:49:42Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Adding favorites */ Start writing documentation on favorite add service&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
== Folder list ==&lt;br /&gt;
When a WebTV/MSN TV client has to retrieve the list of favorite folders for the current user, it will make a WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; request to the service URL defined in the &amp;lt;code&amp;gt;wtv-favorites-folders-url&amp;lt;/code&amp;gt; header from the final headwaiter response. The service the URL points to is usually hosted on &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt;, and the service URL used by the original service was &amp;lt;code&amp;gt;wtv-favorite:/list-folders&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The response for the folder list service has a Content-Type of &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but the body data is a NUL-terminated sequence of strings representing the names of the favorite folders on the current user&#039;s account.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
wtv-lzpf: 0\n&lt;br /&gt;
Content-length: {length of body}\n&lt;br /&gt;
Content-type: text/html\n&lt;br /&gt;
\n&lt;br /&gt;
Personal[0x00]Recommended[0x00]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding favorites ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV have a panel for adding a site as a favorite to a designated favorite folder, which can be opened by selecting the &amp;quot;Save&amp;quot; button from the Options panel. When a user adds a site as a favorite, the client will make a &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; request to the service URL &amp;lt;code&amp;gt;wtv-favorite:/add&amp;lt;/code&amp;gt;, which sends a query string of the information for the favorite and which folder to put it in, along with an image type for the thumbnail. The thumbnail data is sent in the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-favorite:/add?favorite-category=Favorite+Folder+Name&amp;amp;favorite-title=Website+Title&amp;amp;favorite-thumbnail-type=image/wtv-bitmap&amp;amp;favorite-url=wtv-home%3A%2Fhome\r\n&lt;br /&gt;
wtv-system-cpuspeed: 166164662\r\n&lt;br /&gt;
wtv-system-sysconfig: 3116068\r\n&lt;br /&gt;
wtv-disk-size: 8006\r\n&lt;br /&gt;
wtv-incarnation: 32\r\n&lt;br /&gt;
Content-type: application/x-www-form-urlencoded\r\n&lt;br /&gt;
Content-length: {length of thumbnail data}\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO: Write up how favorite service works server-side&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| favorite-category&lt;br /&gt;
| The name of the favorite folder (category) to add the favorite to&lt;br /&gt;
|-&lt;br /&gt;
| favorite-name&lt;br /&gt;
| The name for the favorite (usually the page title)&lt;br /&gt;
|-&lt;br /&gt;
| favorite-thumbnail-type&lt;br /&gt;
| The file type for the favorite thumbnail to upload for the favorite. Currently, the only known value sent is &amp;lt;code&amp;gt;image/wtv-bitmap&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| favorite-url&lt;br /&gt;
| URL for the favorite to point to. This can be a service URL or a normal website URL&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Template:WTVPNav&amp;diff=622</id>
		<title>Template:WTVPNav</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Template:WTVPNav&amp;diff=622"/>
		<updated>2023-08-11T00:36:41Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add Favorites link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 200px; float: right; margin: 0 0 1em 1em; text-align: center&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-size: 20px&amp;quot; | WTVP&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP|Overview]] &amp;amp;bull; [[List of WTVP Services|List of WTVP Services]] &amp;amp;bull; [[WTVP-specific Content Types|WTVP-specific Content-Types]] &amp;amp;bull; [[WTVP Status Codes|Status Codes]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Concepts&lt;br /&gt;
|-&lt;br /&gt;
| [[Tokens|Tokens]] &amp;amp;bull; [[WTVP/Tickets|Tickets]] &amp;amp;bull; [[Capability Flags|Capability Flags]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Headers&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/List|Header List]] &amp;amp;bull; [[WTVP/Headers/Data Types|Data Types]] &amp;amp;bull; [[Common WTVP Request Headers|Common Request Headers]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Processes&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Processes/First-Time Registration|First-Time Registration]] &amp;amp;bull; [[WTVP/Processes/Headwaiter|Headwaiter (Login)]] &amp;amp;bull; [[Services/Technical/Messenger#WTVP|Messenger Services]] &amp;amp;bull; [[WTVP/Processes/Favorites|Favorites]] &amp;amp;bull; [[WTVP/Processes/MessageWatch|Checking for new mail]] &amp;amp;bull; [[WTVP/Processes/Retrieving settings|Retrieving settings]] &amp;amp;bull; [[WTVP/Processes/Obtaining a new wtv-ticket|Obtaining new wtv-tickets]] &amp;amp;bull; [[Smart Card]] &amp;amp;bull; [[WTVP/Processes/Miscellaneous|Miscellaneous]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | URLs for WTVP Services&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Services/wtv-1800/URLs|wtv-1800]] &amp;amp;bull; [[WTVP/Services/wtv-aroundtown/URLs|wtv-aroundtown]] &amp;amp;bull; [[WTVP/Services/wtv-author/URLs|wtv-author]] &amp;amp;bull; [[WTVP/Services/wtv-center/URLs|wtv-center]] &amp;amp;bull; [[WTVP/Services/wtv-chat/URLs|wtv-chat]] &amp;amp;bull; [[WTVP/Services/wtv-content/URLs|wtv-content]] &amp;amp;bull; [[WTVP/Services/wtv-cookie/URLs|wtv-cookie]] &amp;amp;bull; [[WTVP/Services/wtv-customscript/URLs|wtv-customscript]] &amp;amp;bull; [[WTVP/Services/wtv-disk/URLs|wtv-disk]] &amp;amp;bull; [[WTVP/Services/wtv-epguide/URLs|wtv-epguide]] &amp;amp;bull; [[WTVP/Services/wtv-favorite/URLs|wtv-favorite]] &amp;amp;bull; [[WTVP/Services/wtv-flashrom/URLs|wtv-flashrom]] &amp;amp;bull; [[WTVP/Services/wtv-guide/URLs|wtv-guide]] &amp;amp;bull; [[WTVP/Services/wtv-head-waiter/URLs|wtv-head-waiter]] &amp;amp;bull; [[WTVP/Services/wtv-home/URLs|wtv-home]] &amp;amp;bull; [[WTVP/Services/wtv-intro/URLs|wtv-intro]] &amp;amp;bull; [[WTVP/Services/wtv-log/URLs|wtv-log]] &amp;amp;bull; [[WTVP/Services/wtv-mail/URLs|wtv-mail]] &amp;amp;bull; [[WTVP/Services/wtv-news/URLs|wtv-news]] &amp;amp;bull; [[WTVP/Services/wtv-notices/URLs|wtv-notices]] &amp;amp;bull; [[WTVP/Services/wtv-partner/URLs|wtv-partner]] &amp;amp;bull; [[WTVP/Services/wtv-passport/URLs|wtv-passport]] &amp;amp;bull; [[WTVP/Services/wtv-register/URLs|wtv-register]] &amp;amp;bull; [[WTVP/Services/wtv-setup/URLs|wtv-setup]] &amp;amp;bull; [[WTVP/Services/wtv-smartcard/URLs|wtv-smartcard]] &amp;amp;bull; [[WTVP/Services/wtv-spot/URLs|wtv-spot]] &amp;amp;bull; [[WTVP/Services/wtv-star/URLs|wtv-star]] &amp;amp;bull; [[WTVP/Services/wtv-tricks/URLs|wtv-tricks]] &amp;amp;bull; [[WTVP/Services/wtv-tutorial/URLs|wtv-tutorial]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Favorites&amp;diff=621</id>
		<title>WTVP/Processes/Favorites</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Favorites&amp;diff=621"/>
		<updated>2023-08-11T00:31:17Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add initial WTVP favorites page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
== Folder list ==&lt;br /&gt;
When a WebTV/MSN TV client has to retrieve the list of favorite folders for the current user, it will make a WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; request to the service URL defined in the &amp;lt;code&amp;gt;wtv-favorites-folders-url&amp;lt;/code&amp;gt; header from the final headwaiter response. The service the URL points to is usually hosted on &amp;lt;code&amp;gt;wtv-favorite&amp;lt;/code&amp;gt;, and the service URL used by the original service was &amp;lt;code&amp;gt;wtv-favorite:/list-folders&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The response for the folder list service has a Content-Type of &amp;lt;code&amp;gt;text/html&amp;lt;/code&amp;gt;, but the body data is a NUL-terminated sequence of strings representing the names of the favorite folders on the current user&#039;s account.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
wtv-lzpf: 0\n&lt;br /&gt;
Content-length: {length of body}\n&lt;br /&gt;
Content-type: text/html\n&lt;br /&gt;
\n&lt;br /&gt;
Personal[0x00]Recommended[0x00]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding favorites ==&lt;br /&gt;
&#039;&#039;&#039;TBD&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Template:WTVPNav&amp;diff=620</id>
		<title>Template:WTVPNav</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Template:WTVPNav&amp;diff=620"/>
		<updated>2023-08-10T23:49:35Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add miscellaneous link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 200px; float: right; margin: 0 0 1em 1em; text-align: center&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-size: 20px&amp;quot; | WTVP&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP|Overview]] &amp;amp;bull; [[List of WTVP Services|List of WTVP Services]] &amp;amp;bull; [[WTVP-specific Content Types|WTVP-specific Content-Types]] &amp;amp;bull; [[WTVP Status Codes|Status Codes]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Concepts&lt;br /&gt;
|-&lt;br /&gt;
| [[Tokens|Tokens]] &amp;amp;bull; [[WTVP/Tickets|Tickets]] &amp;amp;bull; [[Capability Flags|Capability Flags]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Headers&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/List|Header List]] &amp;amp;bull; [[WTVP/Headers/Data Types|Data Types]] &amp;amp;bull; [[Common WTVP Request Headers|Common Request Headers]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Processes&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Processes/First-Time Registration|First-Time Registration]] &amp;amp;bull; [[WTVP/Processes/Headwaiter|Headwaiter (Login)]] &amp;amp;bull; [[Services/Technical/Messenger#WTVP|Messenger Services]] &amp;amp;bull; [[WTVP/Processes/MessageWatch|Checking for new mail]] &amp;amp;bull; [[WTVP/Processes/Retrieving settings|Retrieving settings]] &amp;amp;bull; [[WTVP/Processes/Obtaining a new wtv-ticket|Obtaining new wtv-tickets]] &amp;amp;bull; [[Smart Card]] &amp;amp;bull; [[WTVP/Processes/Miscellaneous|Miscellaneous]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | URLs for WTVP Services&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Services/wtv-1800/URLs|wtv-1800]] &amp;amp;bull; [[WTVP/Services/wtv-aroundtown/URLs|wtv-aroundtown]] &amp;amp;bull; [[WTVP/Services/wtv-author/URLs|wtv-author]] &amp;amp;bull; [[WTVP/Services/wtv-center/URLs|wtv-center]] &amp;amp;bull; [[WTVP/Services/wtv-chat/URLs|wtv-chat]] &amp;amp;bull; [[WTVP/Services/wtv-content/URLs|wtv-content]] &amp;amp;bull; [[WTVP/Services/wtv-cookie/URLs|wtv-cookie]] &amp;amp;bull; [[WTVP/Services/wtv-customscript/URLs|wtv-customscript]] &amp;amp;bull; [[WTVP/Services/wtv-disk/URLs|wtv-disk]] &amp;amp;bull; [[WTVP/Services/wtv-epguide/URLs|wtv-epguide]] &amp;amp;bull; [[WTVP/Services/wtv-favorite/URLs|wtv-favorite]] &amp;amp;bull; [[WTVP/Services/wtv-flashrom/URLs|wtv-flashrom]] &amp;amp;bull; [[WTVP/Services/wtv-guide/URLs|wtv-guide]] &amp;amp;bull; [[WTVP/Services/wtv-head-waiter/URLs|wtv-head-waiter]] &amp;amp;bull; [[WTVP/Services/wtv-home/URLs|wtv-home]] &amp;amp;bull; [[WTVP/Services/wtv-intro/URLs|wtv-intro]] &amp;amp;bull; [[WTVP/Services/wtv-log/URLs|wtv-log]] &amp;amp;bull; [[WTVP/Services/wtv-mail/URLs|wtv-mail]] &amp;amp;bull; [[WTVP/Services/wtv-news/URLs|wtv-news]] &amp;amp;bull; [[WTVP/Services/wtv-notices/URLs|wtv-notices]] &amp;amp;bull; [[WTVP/Services/wtv-partner/URLs|wtv-partner]] &amp;amp;bull; [[WTVP/Services/wtv-passport/URLs|wtv-passport]] &amp;amp;bull; [[WTVP/Services/wtv-register/URLs|wtv-register]] &amp;amp;bull; [[WTVP/Services/wtv-setup/URLs|wtv-setup]] &amp;amp;bull; [[WTVP/Services/wtv-smartcard/URLs|wtv-smartcard]] &amp;amp;bull; [[WTVP/Services/wtv-spot/URLs|wtv-spot]] &amp;amp;bull; [[WTVP/Services/wtv-star/URLs|wtv-star]] &amp;amp;bull; [[WTVP/Services/wtv-tricks/URLs|wtv-tricks]] &amp;amp;bull; [[WTVP/Services/wtv-tutorial/URLs|wtv-tutorial]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Miscellaneous&amp;diff=619</id>
		<title>WTVP/Processes/Miscellaneous</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Miscellaneous&amp;diff=619"/>
		<updated>2023-08-10T23:48:28Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add WTVPNav&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
Documentation for miscellaneous WTVP services utilized by WebTV/MSN TV.&lt;br /&gt;
&lt;br /&gt;
== Address list ==&lt;br /&gt;
&lt;br /&gt;
Simple WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; service hosted on a service URL defined in the [[WTVP/Processes/Headwaiter/Final Responses|final headwaiter response]] with the &amp;lt;code&amp;gt;wtv-addresses-url&amp;lt;/code&amp;gt; header. This service is usually hosted on a &amp;lt;code&amp;gt;wtv-mail&amp;lt;/code&amp;gt; server, and the original service URL used to host the service was &amp;lt;code&amp;gt;wtv-mail:/addresslist&amp;lt;/code&amp;gt;. This service returns a list of contacts in a user&#039;s address book, listing both the nickname and e-mail address for each contact. This service is called after the client receives the final headwaiter response during login, or when a user pulls up the Send panel from the Options bar to let them choose which contacts to send a page to through the WebTV/MSN TV Mail service.&lt;br /&gt;
&lt;br /&gt;
The response has a Content-Type of &amp;lt;code&amp;gt;x-wtv-addresses&amp;lt;/code&amp;gt;, and the body consists of one or more NUL-terminated string sequences that follow this format: &amp;lt;code&amp;gt;[Contact nickname][0x00][Contact e-mail address][0x00]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET wtv-mail:/addresslist\r\n&lt;br /&gt;
wtv-system-cpuspeed: 166164662\r\n&lt;br /&gt;
wtv-system-sysconfig: 3116068\r\n&lt;br /&gt;
wtv-disk-size: 8006\r\n&lt;br /&gt;
wtv-incarnation: 4\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
Content-Type: x-wtv-addresses\n&lt;br /&gt;
Content-length: {length of body}\n&lt;br /&gt;
\n&lt;br /&gt;
John Doe[0x00]johndoe@webtv.net[0x00]Jane Doe[0x00]janedoe@webtv.net[0x00]Joe Britt[0x00]joeb@webtv.net[0x00]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mail sync service ==&lt;br /&gt;
&lt;br /&gt;
Later in the WebTV/MSN TV service&#039;s life (by 2.9 at the latest), some pages started embedding a 1x1 GIF for the sole purpose of updating the message light on the current user&#039;s box to notify them of new mail sooner, if any. On the login splash screen, it embeds an image on &amp;lt;code&amp;gt;wtv-mail:/splash-sync&amp;lt;/code&amp;gt; to do this. This is another simple WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; service that returns a 43 byte GIF with minimal headers, including the &amp;lt;code&amp;gt;wtv-mail-count&amp;lt;/code&amp;gt; header to tell the box how many unread messages the current user has, and an &amp;lt;code&amp;gt;Expires&amp;lt;/code&amp;gt; header. Unlike most image files retrieved from the WTVP servers, the one sent by splash-sync is encrypted. Why it&#039;s encrypted is currently unclear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
wtv-mail-count: {number of unread emails in user&#039;s inbox}\n&lt;br /&gt;
Expires: 60\n&lt;br /&gt;
Content-type: image/gif\n&lt;br /&gt;
Content-length: 43\n&lt;br /&gt;
\n&lt;br /&gt;
{GIF image data}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
47 49 46 38 39 61 02 00 02 00 80 00 00 2B 2B 2B   GIF89a....€..+++&lt;br /&gt;
00 00 00 21 F9 04 01 00 00 00 00 2C 00 00 00 00   ...!ù......,....&lt;br /&gt;
02 00 02 00 00 02 02 84 51 00                     ........Q.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s believed that the service &amp;lt;code&amp;gt;wtv-mail:/update-light&amp;lt;/code&amp;gt; performs a similar function to splash-sync. What&#039;s believed to be its response also sends a 43 byte GIF image, but the only captures we&#039;ve seen of it are ones without any mail-related headers. Like splash-sync, the GIF is encrypted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
Content-type: image/gif\n&lt;br /&gt;
Content-length: 43\n&lt;br /&gt;
\n&lt;br /&gt;
{GIF image data}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Miscellaneous&amp;diff=618</id>
		<title>WTVP/Processes/Miscellaneous</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=WTVP/Processes/Miscellaneous&amp;diff=618"/>
		<updated>2023-08-10T23:48:03Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add miscellaneous page for WTVP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for miscellaneous WTVP services utilized by WebTV/MSN TV.&lt;br /&gt;
&lt;br /&gt;
== Address list ==&lt;br /&gt;
&lt;br /&gt;
Simple WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; service hosted on a service URL defined in the [[WTVP/Processes/Headwaiter/Final Responses|final headwaiter response]] with the &amp;lt;code&amp;gt;wtv-addresses-url&amp;lt;/code&amp;gt; header. This service is usually hosted on a &amp;lt;code&amp;gt;wtv-mail&amp;lt;/code&amp;gt; server, and the original service URL used to host the service was &amp;lt;code&amp;gt;wtv-mail:/addresslist&amp;lt;/code&amp;gt;. This service returns a list of contacts in a user&#039;s address book, listing both the nickname and e-mail address for each contact. This service is called after the client receives the final headwaiter response during login, or when a user pulls up the Send panel from the Options bar to let them choose which contacts to send a page to through the WebTV/MSN TV Mail service.&lt;br /&gt;
&lt;br /&gt;
The response has a Content-Type of &amp;lt;code&amp;gt;x-wtv-addresses&amp;lt;/code&amp;gt;, and the body consists of one or more NUL-terminated string sequences that follow this format: &amp;lt;code&amp;gt;[Contact nickname][0x00][Contact e-mail address][0x00]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET wtv-mail:/addresslist\r\n&lt;br /&gt;
wtv-system-cpuspeed: 166164662\r\n&lt;br /&gt;
wtv-system-sysconfig: 3116068\r\n&lt;br /&gt;
wtv-disk-size: 8006\r\n&lt;br /&gt;
wtv-incarnation: 4\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
Content-Type: x-wtv-addresses\n&lt;br /&gt;
Content-length: {length of body}\n&lt;br /&gt;
\n&lt;br /&gt;
John Doe[0x00]johndoe@webtv.net[0x00]Jane Doe[0x00]janedoe@webtv.net[0x00]Joe Britt[0x00]joeb@webtv.net[0x00]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mail sync service ==&lt;br /&gt;
&lt;br /&gt;
Later in the WebTV/MSN TV service&#039;s life (by 2.9 at the latest), some pages started embedding a 1x1 GIF for the sole purpose of updating the message light on the current user&#039;s box to notify them of new mail sooner, if any. On the login splash screen, it embeds an image on &amp;lt;code&amp;gt;wtv-mail:/splash-sync&amp;lt;/code&amp;gt; to do this. This is another simple WTVP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; service that returns a 43 byte GIF with minimal headers, including the &amp;lt;code&amp;gt;wtv-mail-count&amp;lt;/code&amp;gt; header to tell the box how many unread messages the current user has, and an &amp;lt;code&amp;gt;Expires&amp;lt;/code&amp;gt; header. Unlike most image files retrieved from the WTVP servers, the one sent by splash-sync is encrypted. Why it&#039;s encrypted is currently unclear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
wtv-mail-count: {number of unread emails in user&#039;s inbox}\n&lt;br /&gt;
Expires: 60\n&lt;br /&gt;
Content-type: image/gif\n&lt;br /&gt;
Content-length: 43\n&lt;br /&gt;
\n&lt;br /&gt;
{GIF image data}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
47 49 46 38 39 61 02 00 02 00 80 00 00 2B 2B 2B   GIF89a....€..+++&lt;br /&gt;
00 00 00 21 F9 04 01 00 00 00 00 2C 00 00 00 00   ...!ù......,....&lt;br /&gt;
02 00 02 00 00 02 02 84 51 00                     ........Q.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s believed that the service &amp;lt;code&amp;gt;wtv-mail:/update-light&amp;lt;/code&amp;gt; performs a similar function to splash-sync. What&#039;s believed to be its response also sends a 43 byte GIF image, but the only captures we&#039;ve seen of it are ones without any mail-related headers. Like splash-sync, the GIF is encrypted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
200 OK\n&lt;br /&gt;
Connection: Keep-Alive\n&lt;br /&gt;
wtv-encrypted: true\n&lt;br /&gt;
Content-type: image/gif\n&lt;br /&gt;
Content-length: 43\n&lt;br /&gt;
\n&lt;br /&gt;
{GIF image data}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Main_Page&amp;diff=617</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Main_Page&amp;diff=617"/>
		<updated>2023-08-10T00:50:49Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add Replacing WebTV (MSN TV) Hard Drives link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the WebTV/MSN TV Wiki! WebTV, later known as MSN TV, is an internet access device consisting of a set top box that utilized dial-up access (and later on, broadband), using a keyboard and remote for user input. It was also a specialized service complementing said devices that they would connect to for access to the general internet and WebTV/MSN TV&#039;s own online services. The product and service launched in 1996 as WebTV, and a year later the company behind this technology, WebTV Networks, was acquired by Microsoft. WebTV later became MSN TV circa 2001, and the entire service would eventually be discontinued on September 30, 2013. This wiki is &#039;&#039;&#039;NOT&#039;&#039;&#039; about the &amp;quot;WebTV for Windows&amp;quot; application bundled with Windows 98, which is essentially a souped up TV tuner, nor is this wiki about any video streaming services with &amp;quot;Web TV&amp;quot; in the name.&lt;br /&gt;
&lt;br /&gt;
What we are accomplishing with this wiki is to seek out, collect, and document as much information as we can gather on the WebTV/MSN TV internet product&#039;s hardware, services, protocols, and other subjects concerning it. Much to the surprise of many, WebTV/MSN TV did indeed already have people focused on learning about the product and how it worked, primarily in its hacking scene. Up until 2021, however, only surface level information about the product and service (especially in regards to its many vulnerabilities), or basic writeups about the technical portions of WebTV/MSN TV were available for public consumption, with most information about WebTV/MSN TV either remaining undocumented, poorly preserved, or in regards to some technical information, circulated privately by select people, never to see the light of day. We&#039;re here to make up for that and make all information on WebTV/MSN TV &amp;lt;u&amp;gt;centralized&amp;lt;/u&amp;gt;, &amp;lt;u&amp;gt;public&amp;lt;/u&amp;gt;, and &amp;lt;u&amp;gt;easily accessible&amp;lt;/u&amp;gt;, using information that we have been able to obtain from scene sites, from our own research, and in private from those who know a bit about the product/service. &#039;&#039;&#039;We are here to rip open the guts of the entire WebTV/MSN TV service and technology and make it known for all!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This wiki was originally run by an anonymous person, wtv-411, from early 2021 to September 2022. Ownership of the wiki has since been transferred to JarHead, and future updates to the wiki will be published here.&lt;br /&gt;
&lt;br /&gt;
For now, this wiki will mostly focus on the first generation of WebTV/MSN TV (pre-MSN TV 2) technologies and services, and try to make sense of how they worked. We hope to extend on other information we have though, especially with information concerning the MSN TV 2 seeing as information on that variant of the product and corresponding service specifically is extremely endangered, moreso than the first generation of WebTV/MSN TV products to our knowledge.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Do you or someone you know have any crucial WebTV-related information we&#039;re seeking to preserve? Check out our [[Wanted]] page.&lt;br /&gt;
&lt;br /&gt;
Interested in backing up your WebTV/UltimateTV/DishPlayer hard drives for any reason? Check out the guide we wrote on doing that: [[Backing Up WebTV (MSN TV) Hard Drives]].&lt;br /&gt;
&lt;br /&gt;
Need to replace the hard drive in your WebTV/MSN TV boxes? Check out [[Replacing WebTV (MSN TV) Hard Drives]]&lt;br /&gt;
&lt;br /&gt;
Want to install Linux on an MSN TV 2 box? Check out [[Installing Linux on the MSN TV 2 (RM4100)]].&lt;br /&gt;
&lt;br /&gt;
Join the [https://discord.gg/qke279EUa8 WebTV/MSN TV Discord server] to chat about anything WebTV/MSN TV with like minded people.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;UPDATE - 3/16/2023:&#039;&#039;&#039; Hello people. This is wtv-411. Bet you weren&#039;t expecting me to make another appearance after saying that I&#039;ve moved on, huh? To tell the truth, I was mostly just burnt out from being involved with the WebTV community, as well as just actively running and writing for the wiki at the time, although my activity since then has been more discrete and I mostly help out with things in the background when I can. While things have gone quiet since JarHead has taken the reigns, I have been blessed with the privilege of being a contributor yet again and I have been putting in what little free time and motivation I have with this into polishing and updating the information on this wiki. I have added some more info on the hardware used by WebTV, as well as adding some minor updates to the MSN TV 2 page and some other pages, but I don&#039;t think I&#039;ll be doing anything more major than that considering how much effort is needed to keep this wiki running. Oh, and also the site doesn&#039;t properly show up in Google search results and only Google&#039;s for some reason, possibly because of the haphazard domain migration from the old domain and also the weird dual HTTP-HTTPS setup this site has right now. Wonderful. I am looking into transferring the old webtvwiki.net domain to the holder of the wiki&#039;s current domain before the end of the year, which might not change things by much but it may help in keeping things consistent.&lt;br /&gt;
&lt;br /&gt;
On the flip side, I just got around to publishing the little info I have gathered and discovered on the MSN TV 2&#039;s service, as well as some info on the firmware, on a separate GitHub wiki since I feel that it is not only easier to manage, but will also allow more people to easily find it compared to a small obscure wiki that you can&#039;t even search for anymore. You can view it [https://github.com/wtv-411/msntv2-docs/wiki here]. It may not get consistent updates due to real life obligations as well as the nature of the thing the wiki is focused on, but I am definitely looking forward to working on that more than this.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT UPDATE - 9/11/2022:&#039;&#039;&#039; Hey everybody! I&#039;m JarHead, the new operator of this wiki from now on. Things have been a bit hectic the past few hours, so things might not be exactly correct just yet. Outside of domains just changing, I&#039;ll also be publishing my own knowledge about WebTV that I&#039;ve gained over the past 3 years I&#039;ve been working with WebTV, so I hope you can learn as much as I have.&lt;br /&gt;
&lt;br /&gt;
For older updates: [[Archived Updates]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[UltimateTV]]&lt;br /&gt;
* [[Microsoft TV]] &#039;&#039;&#039;NEW&#039;&#039;&#039;&lt;br /&gt;
* [[SNAP2 Corporation]]&lt;br /&gt;
* [[MAME]]&lt;br /&gt;
* [[Doom for WebTV]]&lt;br /&gt;
* [[Network]]&lt;br /&gt;
** [[Services]]&lt;br /&gt;
** [[Protocols]]&lt;br /&gt;
** [[Tokens]]&lt;br /&gt;
** [[Network Infrastructure|Infrastructure]]&lt;br /&gt;
** &amp;quot;[[The Great(er) Scroll of Dialing Wisdom|Greater Scroll of Dialing Wisdom]]&amp;quot;&lt;br /&gt;
* [[Data Formats]]&lt;br /&gt;
* [[Hardware]]&lt;br /&gt;
** [[Hardware Models|Models]]&lt;br /&gt;
** [[WebTV Memory Map]]&lt;br /&gt;
** [[Power-Off Codes]]&lt;br /&gt;
* [[ROM]]&lt;br /&gt;
* [[WebTV Viewer]]&lt;br /&gt;
* [[WebTV for Dreamcast]]&lt;br /&gt;
* [[Client Commands]]&lt;br /&gt;
* [[WebTV Upgrade History]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[MSN TV 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Further Links]]&lt;br /&gt;
* [[Wanted]]&lt;br /&gt;
* [[Community]]&lt;br /&gt;
* [[Thanks]]&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Template:WTVPNav&amp;diff=615</id>
		<title>Template:WTVPNav</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Template:WTVPNav&amp;diff=615"/>
		<updated>2023-08-05T20:53:53Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 200px; float: right; margin: 0 0 1em 1em; text-align: center&amp;quot;&lt;br /&gt;
! style=&amp;quot;font-size: 20px&amp;quot; | WTVP&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP|Overview]] &amp;amp;bull; [[List of WTVP Services|List of WTVP Services]] &amp;amp;bull; [[WTVP-specific Content Types|WTVP-specific Content-Types]] &amp;amp;bull; [[WTVP Status Codes|Status Codes]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Concepts&lt;br /&gt;
|-&lt;br /&gt;
| [[Tokens|Tokens]] &amp;amp;bull; [[WTVP/Tickets|Tickets]] &amp;amp;bull; [[Capability Flags|Capability Flags]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Headers&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Headers/List|Header List]] &amp;amp;bull; [[WTVP/Headers/Data Types|Data Types]] &amp;amp;bull; [[Common WTVP Request Headers|Common Request Headers]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | Processes&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Processes/First-Time Registration|First-Time Registration]] &amp;amp;bull; [[WTVP/Processes/Headwaiter|Headwaiter (Login)]] &amp;amp;bull; [[Services/Technical/Messenger#WTVP|Messenger Services]] &amp;amp;bull; [[WTVP/Processes/MessageWatch|Checking for new mail]] &amp;amp;bull; [[WTVP/Processes/Retrieving settings|Retrieving settings]] &amp;amp;bull; [[WTVP/Processes/Obtaining a new wtv-ticket|Obtaining new wtv-tickets]] &amp;amp;bull; [[Smart Card]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;font-size: 12px&amp;quot; | URLs for WTVP Services&lt;br /&gt;
|-&lt;br /&gt;
| [[WTVP/Services/wtv-1800/URLs|wtv-1800]] &amp;amp;bull; [[WTVP/Services/wtv-aroundtown/URLs|wtv-aroundtown]] &amp;amp;bull; [[WTVP/Services/wtv-author/URLs|wtv-author]] &amp;amp;bull; [[WTVP/Services/wtv-center/URLs|wtv-center]] &amp;amp;bull; [[WTVP/Services/wtv-chat/URLs|wtv-chat]] &amp;amp;bull; [[WTVP/Services/wtv-content/URLs|wtv-content]] &amp;amp;bull; [[WTVP/Services/wtv-cookie/URLs|wtv-cookie]] &amp;amp;bull; [[WTVP/Services/wtv-customscript/URLs|wtv-customscript]] &amp;amp;bull; [[WTVP/Services/wtv-disk/URLs|wtv-disk]] &amp;amp;bull; [[WTVP/Services/wtv-epguide/URLs|wtv-epguide]] &amp;amp;bull; [[WTVP/Services/wtv-favorite/URLs|wtv-favorite]] &amp;amp;bull; [[WTVP/Services/wtv-flashrom/URLs|wtv-flashrom]] &amp;amp;bull; [[WTVP/Services/wtv-guide/URLs|wtv-guide]] &amp;amp;bull; [[WTVP/Services/wtv-head-waiter/URLs|wtv-head-waiter]] &amp;amp;bull; [[WTVP/Services/wtv-home/URLs|wtv-home]] &amp;amp;bull; [[WTVP/Services/wtv-intro/URLs|wtv-intro]] &amp;amp;bull; [[WTVP/Services/wtv-log/URLs|wtv-log]] &amp;amp;bull; [[WTVP/Services/wtv-mail/URLs|wtv-mail]] &amp;amp;bull; [[WTVP/Services/wtv-news/URLs|wtv-news]] &amp;amp;bull; [[WTVP/Services/wtv-notices/URLs|wtv-notices]] &amp;amp;bull; [[WTVP/Services/wtv-partner/URLs|wtv-partner]] &amp;amp;bull; [[WTVP/Services/wtv-passport/URLs|wtv-passport]] &amp;amp;bull; [[WTVP/Services/wtv-register/URLs|wtv-register]] &amp;amp;bull; [[WTVP/Services/wtv-setup/URLs|wtv-setup]] &amp;amp;bull; [[WTVP/Services/wtv-smartcard/URLs|wtv-smartcard]] &amp;amp;bull; [[WTVP/Services/wtv-spot/URLs|wtv-spot]] &amp;amp;bull; [[WTVP/Services/wtv-star/URLs|wtv-star]] &amp;amp;bull; [[WTVP/Services/wtv-tricks/URLs|wtv-tricks]] &amp;amp;bull; [[WTVP/Services/wtv-tutorial/URLs|wtv-tutorial]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=Smart_Card&amp;diff=614</id>
		<title>Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=Smart_Card&amp;diff=614"/>
		<updated>2023-08-05T20:53:30Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Completely overhaul smart card page - write more proper documentation on version 2 format and WTVP side, and add client command for writing to smart cards&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
Smart cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO 7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string that has every 4-byte block of data byte swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; service aren&#039;t well known, what is known is that the server will redirect the box to a website specified by the smart card if it is a &amp;quot;Go To&amp;quot; card, and send an error page if the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will only cover the version 2 smart card format for the time being, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. While constrained by the 122-byte limit for smart cards, they can theoretically hold up to 256 bytes of data. TLVs follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| 1 byte&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Variable&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
Below is a list of TLVs known to be used by the version 2 smart card format. TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to set for the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Format Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=613</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=613"/>
		<updated>2023-08-05T20:50:22Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Final touches and fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO 7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string that has every 4-byte block of data byte swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; service aren&#039;t well known, what is known is that the server will redirect the box to a website specified by the smart card if it is a &amp;quot;Go To&amp;quot; card, and send an error page if the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will only cover the version 2 smart card format for the time being, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. While constrained by the 122-byte limit for smart cards, they can theoretically hold up to 256 bytes of data. TLVs follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| 1 byte&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Variable&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
Below is a list of TLVs known to be used by the version 2 smart card format. TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to set for the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Format Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=612</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=612"/>
		<updated>2023-08-05T19:55:58Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Format */ Remove TODO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO-7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; service aren&#039;t well known, what is known is that the server will redirect the box to a website specified by the smart card if it is a &amp;quot;Go To&amp;quot; card, and send an error page if the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. While constrained by the 122-byte limit for smart cards, they can theoretically hold up to 256 bytes of data. TLVs follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| 1 byte&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Variable&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Format Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;/code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=611</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=611"/>
		<updated>2023-08-05T19:55:31Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO-7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; service aren&#039;t well known, what is known is that the server will redirect the box to a website specified by the smart card if it is a &amp;quot;Go To&amp;quot; card, and send an error page if the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. While constrained by the 122-byte limit for smart cards, they can theoretically hold up to 256 bytes of data. TLVs follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| 1 byte&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Variable&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Format Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;/code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=610</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=610"/>
		<updated>2023-08-05T19:44:11Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Inserting a smart card */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO-7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; service aren&#039;t well known, what is known is that the server will redirect the box to a website specified by the smart card if it is a &amp;quot;Go To&amp;quot; card, and send an error page if the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;/code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=609</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=609"/>
		<updated>2023-08-05T19:43:44Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Inserting a smart card */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO-7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; service aren&#039;t well known, what is known is that the server will redirect the box to a website specified by the smart card if it is a &amp;quot;Go To&amp;quot; card, and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;/code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=608</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=608"/>
		<updated>2023-08-05T19:18:40Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Refine more stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the [https://en.wikipedia.org/wiki/ISO/IEC_7816 ISO-7816 standard]. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony WebTV Plus units) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix otherwise&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: The character &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony WebTV Plus smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;lt;code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;lt;/code&amp;gt;G&amp;lt;/code&amp;gt; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - pointed to &amp;lt;nowiki&amp;gt;http://www.svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=607</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=607"/>
		<updated>2023-08-05T19:02:56Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC. The actual algorithm used for this CRC is currently unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=606</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=606"/>
		<updated>2023-08-05T18:59:31Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add section to mention SaveToSmartCard client command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Inserting a smart card ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Client-Side ==&lt;br /&gt;
&lt;br /&gt;
WebTV and MSN TV boxes have the ability to write to compatible smart cards inserted into their smart card slot. This is done with the client command &amp;lt;code&amp;gt;client:SaveToSmartCard?data={data}&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;{data}&amp;lt;/code&amp;gt; being the raw smart card data, which can be URL encoded if necessary.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=605</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=605"/>
		<updated>2023-08-05T18:50:57Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Service Side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO -&amp;amp;gt; Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=604</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=604"/>
		<updated>2023-08-05T18:50:24Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Service Side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&amp;lt;/code&amp;gt; -&amp;amp;gt; &amp;lt;code&amp;gt;Mkf/dAtTb255IFZhbHVlIEcHaTk5OTk5OQ==&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=603</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=603"/>
		<updated>2023-08-05T18:47:24Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Re-arrange sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=602</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=602"/>
		<updated>2023-08-05T18:44:37Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Known TLVs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=601</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=601"/>
		<updated>2023-08-05T18:44:12Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Known Card Types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores multiple TLVs to run several card functions at one time&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=600</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=600"/>
		<updated>2023-08-05T18:42:00Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Known Card Types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card functions&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=599</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=599"/>
		<updated>2023-08-05T18:40:51Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under a specified type. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=598</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=598"/>
		<updated>2023-08-05T18:39:57Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart cards can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text that will be displayed as a title in a dialog box when the smart card is inserted into the WebTV/MSN TV box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=597</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=597"/>
		<updated>2023-08-05T18:32:57Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Example */ Remove links from svalue.com&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to &amp;lt;nowiki&amp;gt;http://svalue.com&amp;lt;/nowiki&amp;gt; on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=596</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=596"/>
		<updated>2023-08-05T18:32:16Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. A TLV performs one specific function based on the type specified and stores data in a specific way. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the smart card can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t set to deregistration or if it is set as a &amp;quot;multi&amp;quot; card, which can perform several functions at once.&lt;br /&gt;
&lt;br /&gt;
The general format for version 2 smart cards goes like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;code&amp;gt;http://svalue.com&amp;lt;/code&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to http://svalue.com on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=595</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=595"/>
		<updated>2023-08-05T18:28:07Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Known TLVs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP data separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;code&amp;gt;http://svalue.com&amp;lt;/code&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to http://svalue.com on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=594</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=594"/>
		<updated>2023-08-05T18:22:18Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type code&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP information separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;code&amp;gt;http://svalue.com&amp;lt;/code&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to http://svalue.com on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=593</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=593"/>
		<updated>2023-08-05T18:02:22Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* &amp;quot;O&amp;quot; (OpenISP) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP information separated with a tab character (0x09)&lt;br /&gt;
&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;code&amp;gt;http://svalue.com&amp;lt;/code&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to http://svalue.com on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=592</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=592"/>
		<updated>2023-08-05T18:00:40Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Version 2 */ Add example of data from official smart card and refine Go to TLV info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. The wtv-smartcard service would have taken care of redirecting the client to the specified site if it existed. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP information separated with a tab character (0x09)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
The following example shows a break down of the data from an official Sony INT-W200 smart card, which uses the version 2 smart card format and is a &amp;quot;Go to&amp;quot; card. The card would have originally sent to the service a site ID of 999999, which would redirect the user to the Sony-operated site &amp;lt;code&amp;gt;http://svalue.com&amp;lt;/code&amp;gt; (no longer run by Sony).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Version&lt;br /&gt;
| &amp;quot;2&amp;quot; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| CRC&lt;br /&gt;
| 0xFF (Ignore)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Type&lt;br /&gt;
| &amp;quot;t&amp;quot; (Title)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Length&lt;br /&gt;
| 0x0B&lt;br /&gt;
|-&lt;br /&gt;
| TLV #1 Value&lt;br /&gt;
| &amp;quot;Sony Value &amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Type&lt;br /&gt;
| &amp;quot;G&amp;quot; (Go to)&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Length&lt;br /&gt;
| 0x07&lt;br /&gt;
|-&lt;br /&gt;
| TLV #2 Value&lt;br /&gt;
| &amp;quot;i999999&amp;quot; (Server-side numeric ID 999999 - points to http://svalue.com on the original server)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411&amp;diff=591</id>
		<title>User:Wtv-411</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411&amp;diff=591"/>
		<updated>2023-08-05T17:18:58Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Former head honcho of the WebTV Wiki turned administrator. Also the resident WebTV/MSN TV tinkerer whenever I feel like it.&lt;br /&gt;
&lt;br /&gt;
This user page will mostly be used to host drafts of WIP or updates to pages.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=590</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=590"/>
		<updated>2023-08-05T17:14:39Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard. Smart cards can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: Structure. A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP information separated with a tab character (0x09)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=589</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=589"/>
		<updated>2023-08-05T17:13:31Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format that WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: Structure. A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP information separated with a tab character (0x09)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=588</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=588"/>
		<updated>2023-08-05T17:13:09Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Known TLVs */ Add info on the rest of the TLVs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;t&amp;quot; (Title) =====&lt;br /&gt;
* Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
* Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;A&amp;quot; (Affinity data) =====&lt;br /&gt;
* Description: Required for Affinity smart cards&lt;br /&gt;
* Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;G&amp;quot; (Go To data) =====&lt;br /&gt;
* Description: Data that defines a website the smart card will make the box access. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
* Value: Structure. A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;O&amp;quot; (OpenISP) =====&lt;br /&gt;
* Description: Data for setting up a predefined custom ISP to connect to WebTV/MSN TV with. Required for OpenISP smart cards&lt;br /&gt;
* Value: &amp;quot;1&amp;quot;, followed by the ISP information separated with a tab character (0x09)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
ISP information structure:&lt;br /&gt;
* ISP name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP login name - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* ISP password - String&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Primary modem number - 10-digit phone number&lt;br /&gt;
* 0x09 separator&lt;br /&gt;
* Backup modem number - 10-digit phone number. Optional&lt;br /&gt;
&lt;br /&gt;
===== &amp;quot;W&amp;quot; (Deregistration) =====&lt;br /&gt;
* Description: Data for de-registering a client. If this TLV is used, then the card type &#039;&#039;&#039;must&#039;&#039;&#039; be set to deregistration as well and no other TLVs may be added&lt;br /&gt;
* Value: Binary structure&lt;br /&gt;
&lt;br /&gt;
Deregistration data structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| Contains a specific sequence of bytes (in hex: &amp;lt;code&amp;gt;31 75 fa b0&amp;lt;/code&amp;gt;). Purpose for these is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| A UNIX timestamp for when the deregistration card expires. On the WebTV smart card factory pages, this is always set to 0xffffffff to set it to not expire&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| Variable&lt;br /&gt;
| Deregistration code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=587</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=587"/>
		<updated>2023-08-05T15:31:12Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: Add in documentation for V2 smart card TLVs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data, and follow this format:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Byte array&lt;br /&gt;
| Variable length value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity. This feature is currently undocumented, but involves an enrollment and program code&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
* M - Multi-card. Stores TLVs for different card types&lt;br /&gt;
&lt;br /&gt;
==== Known TLVs ====&lt;br /&gt;
TLVs will be listed by their type code&lt;br /&gt;
* 0x74 (&amp;quot;t&amp;quot;) - Title TLV&lt;br /&gt;
** Description: Specifies a title to give the smart card. Optional, but has to precede all other TLVs. This TLV can &#039;&#039;&#039;not&#039;&#039;&#039; be present in deregistration smart cards&lt;br /&gt;
** Value: The title for the smart card&lt;br /&gt;
&lt;br /&gt;
* 0x41 (&amp;quot;A&amp;quot;) - Affinity data&lt;br /&gt;
** Description: Required for Affinity smart cards&lt;br /&gt;
** Value: Structure. A byte for the version number (either &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for version 1 Affinity data or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; for version 2 Affinity data), followed by the actual data.&lt;br /&gt;
*** For version 2 Affinity data: The format is the program code, a tab character (0x09), and the enrollment code&lt;br /&gt;
*** For version 1 Affinity data: Just the enrollment code is added&lt;br /&gt;
&lt;br /&gt;
* 0x47 (&amp;quot;G&amp;quot;) - Go To data&lt;br /&gt;
** Description: Data that defines a website the smart card will make the box access. Required for &amp;quot;Go To&amp;quot; smart cards&lt;br /&gt;
** Value: Structure. A byte for the type of website to be accessed (&amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - Server-side numeric ID that will be translated by the WebTV/MSN TV service, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - HTTP URL, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; - HTTPS URL), followed by a numeric ID if the type is &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or the direct URL for the site without the &amp;quot;http(s)://&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;ll be focusing on Go To cards, as that&#039;s what we have info on.&lt;br /&gt;
&lt;br /&gt;
This is the data stored on a Go To Smart Card:&lt;br /&gt;
&amp;lt;code&amp;gt;2Gÿt�Sony Value G�i999999&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can break this data up into several parts to get all the data that the server decodes.&lt;br /&gt;
&lt;br /&gt;
The first byte is the Smart Card generation, which appears to always be 2 except for a special type of Go To card, which uses generation 1. &amp;quot;Generation&amp;quot; is assumed to refer to the data format for the card, not a different version of Smart Cards themselves.&lt;br /&gt;
&lt;br /&gt;
The second byte is the Smart Card type, which is (G)o To in this case. Other observed values include (O)penISP and (A)ffinity.&lt;br /&gt;
&lt;br /&gt;
ÿ appears to be a separator, which is followed by t�, which defines the start of the Smart Card title. &lt;br /&gt;
&lt;br /&gt;
G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around.&lt;br /&gt;
&lt;br /&gt;
So, to recap:&lt;br /&gt;
&lt;br /&gt;
 Card Generation: 2&lt;br /&gt;
 Card Type: G&lt;br /&gt;
 Card Title: Sony Value&lt;br /&gt;
 Card ID: 999999&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=586</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=586"/>
		<updated>2023-08-05T04:51:06Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TLVs are simple structures that store data under certain types. They can technically hold up to 256 bytes of data.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| uint8&lt;br /&gt;
| Type value&lt;br /&gt;
|-&lt;br /&gt;
| Length&lt;br /&gt;
| uint8&lt;br /&gt;
| 8-bit length of value&lt;br /&gt;
|-&lt;br /&gt;
| Value&lt;br /&gt;
| Variable&lt;br /&gt;
| Value data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
&lt;br /&gt;
==== TLVs ====&lt;br /&gt;
&#039;&#039;&#039;(ADD INFO ON TLV STRUCTURE HERE)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;ll be focusing on Go To cards, as that&#039;s what we have info on.&lt;br /&gt;
&lt;br /&gt;
This is the data stored on a Go To Smart Card:&lt;br /&gt;
&amp;lt;code&amp;gt;2Gÿt�Sony Value G�i999999&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can break this data up into several parts to get all the data that the server decodes.&lt;br /&gt;
&lt;br /&gt;
The first byte is the Smart Card generation, which appears to always be 2 except for a special type of Go To card, which uses generation 1. &amp;quot;Generation&amp;quot; is assumed to refer to the data format for the card, not a different version of Smart Cards themselves.&lt;br /&gt;
&lt;br /&gt;
The second byte is the Smart Card type, which is (G)o To in this case. Other observed values include (O)penISP and (A)ffinity.&lt;br /&gt;
&lt;br /&gt;
ÿ appears to be a separator, which is followed by t�, which defines the start of the Smart Card title. &lt;br /&gt;
&lt;br /&gt;
G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around.&lt;br /&gt;
&lt;br /&gt;
So, to recap:&lt;br /&gt;
&lt;br /&gt;
 Card Generation: 2&lt;br /&gt;
 Card Type: G&lt;br /&gt;
 Card Title: Sony Value&lt;br /&gt;
 Card ID: 999999&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=585</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=585"/>
		<updated>2023-08-05T03:27:02Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Known Card Types ====&lt;br /&gt;
* A - &#039;&#039;&#039;A&#039;&#039;&#039;ffinity&lt;br /&gt;
* F - &#039;&#039;&#039;F&#039;&#039;&#039;avorites&lt;br /&gt;
* W - Deregistration. Only the deregstration TLV can be present in the smart card data if this type is set&lt;br /&gt;
* O - &#039;&#039;&#039;O&#039;&#039;&#039;penISP (Use your own ISP)&lt;br /&gt;
* G - &#039;&#039;&#039;G&#039;&#039;&#039;o To (a website)&lt;br /&gt;
&lt;br /&gt;
==== TLVs ====&lt;br /&gt;
&#039;&#039;&#039;(ADD INFO ON TLV STRUCTURE HERE)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;ll be focusing on Go To cards, as that&#039;s what we have info on.&lt;br /&gt;
&lt;br /&gt;
This is the data stored on a Go To Smart Card:&lt;br /&gt;
&amp;lt;code&amp;gt;2Gÿt�Sony Value G�i999999&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can break this data up into several parts to get all the data that the server decodes.&lt;br /&gt;
&lt;br /&gt;
The first byte is the Smart Card generation, which appears to always be 2 except for a special type of Go To card, which uses generation 1. &amp;quot;Generation&amp;quot; is assumed to refer to the data format for the card, not a different version of Smart Cards themselves.&lt;br /&gt;
&lt;br /&gt;
The second byte is the Smart Card type, which is (G)o To in this case. Other observed values include (O)penISP and (A)ffinity.&lt;br /&gt;
&lt;br /&gt;
ÿ appears to be a separator, which is followed by t�, which defines the start of the Smart Card title. &lt;br /&gt;
&lt;br /&gt;
G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around.&lt;br /&gt;
&lt;br /&gt;
So, to recap:&lt;br /&gt;
&lt;br /&gt;
 Card Generation: 2&lt;br /&gt;
 Card Type: G&lt;br /&gt;
 Card Title: Sony Value&lt;br /&gt;
 Card ID: 999999&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=584</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=584"/>
		<updated>2023-08-05T02:50:51Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Data Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages from a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart card data can have one TLV at minimum for the main card data that corresponds to the card type in the header. If the card type is not a deregistration card, the data can also contain an optional title TLV, which has to precede all other TLVs and contains text for a title that will be displayed when the smart card is inserted into the box. Multiple TLVs in general can be added if the card type isn&#039;t deregistration or if it is set to be a &amp;quot;multi&amp;quot; card.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Version identifier. Always &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (0x32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| 1 byte&lt;br /&gt;
| Card type&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| 1 byte&lt;br /&gt;
| CRC value. This is an optional field and a value of 0xff can be specified to make WebTV/MSN TV ignore the CRC&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| Variable&lt;br /&gt;
| TLV data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== TLVs ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;ll be focusing on Go To cards, as that&#039;s what we have info on.&lt;br /&gt;
&lt;br /&gt;
This is the data stored on a Go To Smart Card:&lt;br /&gt;
&amp;lt;code&amp;gt;2Gÿt�Sony Value G�i999999&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can break this data up into several parts to get all the data that the server decodes.&lt;br /&gt;
&lt;br /&gt;
The first byte is the Smart Card generation, which appears to always be 2 except for a special type of Go To card, which uses generation 1. &amp;quot;Generation&amp;quot; is assumed to refer to the data format for the card, not a different version of Smart Cards themselves.&lt;br /&gt;
&lt;br /&gt;
The second byte is the Smart Card type, which is (G)o To in this case. Other observed values include (O)penISP and (A)ffinity.&lt;br /&gt;
&lt;br /&gt;
ÿ appears to be a separator, which is followed by t�, which defines the start of the Smart Card title. &lt;br /&gt;
&lt;br /&gt;
G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around.&lt;br /&gt;
&lt;br /&gt;
So, to recap:&lt;br /&gt;
&lt;br /&gt;
 Card Generation: 2&lt;br /&gt;
 Card Type: G&lt;br /&gt;
 Card Title: Sony Value&lt;br /&gt;
 Card ID: 999999&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
	<entry>
		<id>https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=583</id>
		<title>User:Wtv-411/Smart Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.webtv.zone/mediawiki/index.php?title=User:Wtv-411/Smart_Card&amp;diff=583"/>
		<updated>2023-08-05T01:21:07Z</updated>

		<summary type="html">&lt;p&gt;Wtv-411: /* Data Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WTVPNav}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WIP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Smart Cards were used on the WebTV and first-generation MSN TV service to take the user to a site, set up ISP options, etc. They were rarely utilized, and were removed on the MSN TV 2.&lt;br /&gt;
&lt;br /&gt;
WebTV/MSN TV boxes support smart cards that are compliant with the ISO-7816 standard, and can hold up to 122 bytes of data.&lt;br /&gt;
&lt;br /&gt;
== Data Structure ==&lt;br /&gt;
&amp;lt;!-- TODO: Redo this entire section to be less sucky - add proper technical info on smart card format and discuss more types --&amp;gt;&lt;br /&gt;
WebTV/MSN TV smart cards use a proprietary format to store data. There are two known versions of the format WebTV Networks developed: version 1 and version 2. The only smart card known to be produced for WebTV boxes (the Sony smart card bundled with Sony INT-W200 Internet Terminals) uses the version 2 format, though.&lt;br /&gt;
&lt;br /&gt;
Thanks to internal WebTV pages for a &amp;quot;smart card factory&amp;quot; service containing JavaScript that directly handled writing in both formats, these formats have been able to be reverse engineered to varying degrees of success. This page will currently only cover the version 2 smart card format though, since that is the format we have the most information on.&lt;br /&gt;
&lt;br /&gt;
=== Version 2 ===&lt;br /&gt;
Version 2 smart cards make use of a header and TLVs (type-length-value) to store data. Version 2 smart cards typically only have one TLV for the main card data that corresponds to the card type. &#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;ll be focusing on Go To cards, as that&#039;s what we have info on.&lt;br /&gt;
&lt;br /&gt;
This is the data stored on a Go To Smart Card:&lt;br /&gt;
&amp;lt;code&amp;gt;2Gÿt�Sony Value G�i999999&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can break this data up into several parts to get all the data that the server decodes.&lt;br /&gt;
&lt;br /&gt;
The first byte is the Smart Card generation, which appears to always be 2 except for a special type of Go To card, which uses generation 1. &amp;quot;Generation&amp;quot; is assumed to refer to the data format for the card, not a different version of Smart Cards themselves.&lt;br /&gt;
&lt;br /&gt;
The second byte is the Smart Card type, which is (G)o To in this case. Other observed values include (O)penISP and (A)ffinity.&lt;br /&gt;
&lt;br /&gt;
ÿ appears to be a separator, which is followed by t�, which defines the start of the Smart Card title. &lt;br /&gt;
&lt;br /&gt;
G�i appears to stand for &amp;quot;Go To ID&amp;quot;, which is the ID for the Go To card. The ID has a corresponding URL that is stored on the server. If the ID is unknown, then a message about the Smart Card being expired or not yet active is sent to the client. The reasoning for this approach appears to be due to the size limit of Smart Cards (around 25 bytes) and so malicious cards can&#039;t be spread around.&lt;br /&gt;
&lt;br /&gt;
So, to recap:&lt;br /&gt;
&lt;br /&gt;
 Card Generation: 2&lt;br /&gt;
 Card Type: G&lt;br /&gt;
 Card Title: Sony Value&lt;br /&gt;
 Card ID: 999999&lt;br /&gt;
&lt;br /&gt;
== Service Side ==&lt;br /&gt;
When a smart card is inserted into the WebTV/MSN TV receiver, it will show a message on the screen with the smart card name and a progress bar. In the background, the box will contact the URL from the &amp;lt;code&amp;gt;wtv-smartcard-inserted-url&amp;lt;/code&amp;gt; header sent from headwaiter, which is usually &amp;lt;code&amp;gt;wtv-smartcard:/insert&amp;lt;/code&amp;gt;. The box will &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; the raw data read from the card to the URL. While official clients can supposedly send the smart card data raw, it has only been documented to send the data as a Base64 encoded string with every 4 bytes swapped:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST wtv-smartcard:/insert\r\n&lt;br /&gt;
User-Agent: Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)\r\n&lt;br /&gt;
wtv-show-time-record: 4 &amp;lt;wtv-home:/home?&amp;gt;\r\n&lt;br /&gt;
wtv-request-type: primary\r\n&lt;br /&gt;
wtv-incarnation: 14\r\n&lt;br /&gt;
Content-type: application/octet-stream\r\n&lt;br /&gt;
Content-length: 36\r\n&lt;br /&gt;
\r\n&lt;br /&gt;
/fkMTtAd552bhZFIlVHbHcEI5kTa5kTO==QO&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server will unswap the bytes, decode the data into its raw binary form, and then parse it as smart card data to determine what to do with it. While the specifics of the &amp;lt;code&amp;gt;wtv-smartcard&amp;lt;/code&amp;gt; aren&#039;t well known, what is known is that the server will redirect the box to the website if the smart card data is for a &amp;quot;Go To&amp;quot; card and send an error page is the data is invalid.&lt;br /&gt;
&lt;br /&gt;
In some cases, the box will send an error header (e.g: &amp;quot;error=-68&amp;quot;) if something goes wrong.&lt;/div&gt;</summary>
		<author><name>Wtv-411</name></author>
	</entry>
</feed>