
Season7 -- MS-DOS VideoCrypt smart card emulator
------------------------------------------------

1996-08-07 -- Markus Kuhn


This software allows you to connect your PC to a VideoCrypt I pay-TV
decoder. Season7 can perform two operations:

  - listen passively to the data traffic between a card and a decoder
  - act like a VideoCrypt I card

New in version 3.2:

  - BIOS independed delay code that uses the 8253 hardware timer directly
    is used in economy mode (option -e). I have not replaced the old
    BIOS code for normal mode, because the new code causes unexplained
    failures (YOUR CARD IS INVALID) every few minutes on my system.
    Any ideas on this problem are very welcome!

  - Timer support for automated VCL recordings (options -c, -l, -n, -r).

  - Old 07 and 09 cryptographic code has been removed (only of academic
    interest today).

  - Screensaver function (deactivated option by -s).

  - VBL files can be recorded (option -b, -B).

  - New filename scheme for VCL und VBL files based on week number,
    that allows easier to select weekly shows in a long list of files.
    (old names available via -M).

  - Many VCL files can be loaded at once (just specify several filenames
    after -i), and much larger VCL files can be handeled now.

  - Command line options should now be used prefixed by a hyphen so that
    variable length options (like -i and -n) can be used.

  - Linux support. Passive mode should work fine under Linux, but
    card emulation is not functional, because the Linux 1.3 serial port
    driver lacks real-time properties and does not seem to allow the
    precision timing required for VideoCrypt card emulation.

  - Various other technical improvements and bugfixes. Source code
    has become considerably more obscure and unreadable since the
    last published version. :-)

Earlier versions of this software also implemented the hash function
and the secret key that was used in the 07 and 09 series card used by
British Sky Broadcasting on the Astra satellites in 1993, 1994 and
early 1995. It was possible to watch these channels without a Sky card
using Season7.

At the moment, the new hash function used in the BSkyB 10 cards is not
yet publicly known and therefore not implemented in Season7. The
Season7 software is however still useful. You can watch a few selected
programs by downloading VCL files from a server. VCL files contain the
values of the secret hash function that have been used during the
broadcast of one program. Season7 can produce VCL files, VBL files, and
ASCII log dumps.

In order to use this software, you will need a VideoCrypt decoder with
a card slot (costs about 200-400 DEM), an IBM AT compatible PC with at
least a 12 MHz i286 processor, a serial RS-232 port and DOS 3.3 or
higher and you will have to build a small interface circuit as
described in the file ADAPTER.TXT. This interface may be operated in
three modes:

  a) A PC listens to data traffic between a card an a decoder
  b) A PC talks to a decoder without a card and acts like a card
  c) A PC talks to a card without a decoder and acts like a decoder

Season7 only supports mode a) and b), but the file ADAPTER.TXT also
describes the additional circuitry (clock generator) necessary for mode
c) operation. The file decoem.c, which is available separately,
contains some demonstration C code which shows how to use mode c).

You can use Season7 to record the data traffic between a card and a
decoder for a certain program. If you make this recording available to
someone else in the form of a VCL file, then it will be possible for
this person to replay the data to the decoder with Season7 and to
descramble the same program later if it has been recorded in encrypted
from on a VCR. The VCL Videocrypt logfile format supported by Season7
is especially designed for this purpose, because it only contains the
part of the exchanged data needed to descramble the image. Other
exchanged data like the card serial number is not stored in a VCL file.
Technical details of the Videocrypt card protocol and the VCL file
format are explained in the file DETAILS.TXT.

Season7 allows also to produce VBL files which contain all the data
sent to the card. Someone who can produce VCL files can do this either
directly by recording the card<->decoder traffic during the broadcast
of a program or alternatively he/she can replay the messages to the
card from the data provided in a VBL file by someone else and store the
answers of the card in a VCL file using suitable software.

IMPORTANT: It is illegal to watch pay-TV programs without a subscription
           in the countries in which a regular subscription is available
           (for the BSkyB channels, these are currently Great Britain and
           Northern Ireland). The legal situation in other countries
           is unclear, but as it is likely, that legislation will change
           soon and that watching pay-TV without a subscription will
           also be illegal in other countries next year. There should be
           no problem if you have already a regular subscription for the
           channels and want to use this software only for educational
           purposes. THE AUTHOR OF THIS SOFTWARE TAKES NO RESPONSIBILITY
           FOR THE LEGALITY OF USING AND DISTRIBUTING THIS SOFTWARE.


How do you use Season7
----------------------

You have to build an electrical interface between the decoder's card
slot and a serial port of your PC. The file ADAPTER.TXT that comes with
this package gives you more technical information about how to do this.
Then start SEASON7.EXE and give as a command line argument the port
number to which you connected your interface (default is COM2 if you
don't give a number).

E.g. enter

	SEASON7 -1

if your interface is connected to COM1. If the text 'RESET' or
'Decoding ...' doesn't appear after a few seconds or if your decoder
displays 'YOUR CARD IS INVALID', then please switch to an unscrambled
channel for at least 3 seconds in order to cause a card reset in the
decoder. This software has currently only been tested with a PACE VC100
decoder, but it is expected to work with all other decoders, too.
Without further options, Season7 acts like a deactivated BSkyB card.

You can leave the program by pressing either q, x, or ESC and you can
activate and deactivate a debugging mode by pressing d. In the
debugging mode, all data packets exchanged between the card and the
decoder are listed. By pressing l you can write the last (up to 400)
crypto messages to file VCLOG.

Setting the time zone: As the log file time stamps and the VBL/VCL
filenames are supposed to be based on Universal Time (UTC, formerly
known as Greenwich Mean Time), you should indicate your local time zone
in the environment variable TZ, so that Season7 can calculate Universal
Time correctly. For example, put one of the following lines into your
autoexec.bat file, depending on where you live:

  West European Time (e.g., United Kingdom, Ireland, Portugal):

    set TZ=WET0WEST,M3.5.0/1,M10.5.0/2

  Central European Time (e.g., Spain, France, Germany, Italy, Poland):

    set TZ=CET-1CEST,M3.5.0/2,M10.5.0/3

  East European Time (e.g., Finland, Greece):

    set TZ=EET-2EEST,M3.5.0/3,M10.5.0/4

The many numbers describe only, when summer time starts (last Sunday in
March) and ends (last Sunday in October). Check the POSIX.1 standard
(section 8.1.1) for details. On startup, Season7 will show you the
current Universal Time. Please check whether it is correct, especially
if you want to provide VCL files for other peoples. A correctly set TZ
variable is also required by many other programs (e-mail, PGP, etc.).

On slow computers (e.g., an i286 processor with 12 MHz is slow enough),
the time needed for the debugging output might already be too long and
the decoder will get a timeout and send a RESET signal. As the protocol
is quite time critical, try to use only simple DOS (no DOS
compatibility box in a multitasking operating system or something like
this) and if you still have problems, remove unnecessary TSR programms
that might steal time and interrupts from Season7 and try the -e
option.

If you want to replay a VCL file, just specify the COM port and after
option -i one or several VCL file names, as in

  season7 -1 -i 18714a08.vcl

Season7 understands several command line options:

	-h		Print a brief list of command line options.

	-d		This activates the debugging mode which will
                        print all data exchanged with the decoder on
			screen. Debugging mode can also be (de-)activated
			by pressing d while the program runs.

	-p		In the passive mode, Season 7 doesn't send any
			bytes, but listens only to the data traffic
			between a decoder and a real card. E.g. use
			'season7 pd >logfile' in order to record to
			a file what's happening between a card and
			a decoder.

	-o		Write a VCL file that allows other peoples later
			to descramble the same program from a VCR.
			Season7 generates a filename using the current
                        week number, the day of the week (1=Mon, 7=Sun),
                        the time (hour rounded up by 5 minutes),
			satellite name and transponder number (wwdhhstt.vcl).
			Season7 will ask you about the satellite, the
			transponder number and what you are recording
			and stores this information together with the
			time in the VCL file header. The '-o' option
			automatically activates the passive mode, so
			you'll have to connect a real card to the adapter
			(mode a), because Season7 only listens. Make sure
			you have set the system clock and environment
			variable TZ correctly.
	-O <file>	Like -o, with with a manually selected filename.

	-b, -B <file>	Like -o and -O, but a VBL file is used instead.
                        These two options do not automatically activate
                        passive mode, because people recording VBL files
                        usually do not have a smartcard.

	-i <files>	Instead of emulating a dead BSkyB card, use the
			specified VCL file in order to answer the queries
			of the decoder and descramble a program (mode b).
			Useful only for video cassette recorded program.

	-e		In the economy mode, no time consuming screen
			output and data log activities take place in the
			main loop. This allows to use Season7 on some very
			slow systems. You might want to try this option
			together with options wb0 and wa0. 

	-m		This option suppresses the on-screen message
			with the Season7 version number, the time and the
			channel name.

        -s		Deactivate the screensafer function that normally
			clears the monitor display after a few minutes.

	-wa <number>	Allows you to specify the number of microseconds
			wait time between a reset impulse from the decoder
			and Season7's answer to reset (default: 30000 = 
			30 ms).

	-wb <number>	Allows you to specify the number of microseconds
			wait time between the bytes sent to the decoder
                        (default: 500). This value can be modified while
			Season7 runs by pressing + and -.

The following functions are useful for unsuperwised VCL recordings:

        -c <time>	Delay the start of the recording until the
			specified time in hh:mm notation.

        -l <number>	Finish the recording after the specified number
			of minutes.

        -n <text>	Specify the name of the recorded program that will
			be mentioned in the VCL header. If this option
			is used, Season7 will not ask interactively for
			satellite, transponder, and program name.

        -r <number>     Specify the number of the Astra transponder that
                        will be mentined in the VCL file.

Assume, you want to record "Star Trek DS9" (60 min) later this day
starting on 15:00 local time from COM1, then use a command line like

  season7 -1 -c 15:00 -l 60 -n Star Trek DS9 -r 08 -o

If you want to record several VCL files automatically, then write
several commands like the above one into a batch file. Make sure that
the -o is the last option in the command line.

The optimum -wa and -wb values haven't been determined yet for all
possible processors and decoders, so please play around with -wa in
case of reset problems and with -wb in case of unstable operation after
a  successful reset.

In VCL replay mode (option -i), you'll only see at which position in
the VCL file the current answer for the decoder query has been found.
If the numbers bore you, better switch off the PC monitor in order to
save power while watching TV. Without option -s, Season7 will clear the
screen after a few minutes anyway in order to protect your monitor from
burning and in order to activate a monitor power-off in modern monitors
which detect blank screens.

I wrote Season7 just for fun as a hobby project and I have no
commercial intentions. Many other Videocrypt hobby experts and I
periodically read the USENET group alt.satellite.tv.crypt, so please
post there a message if you have problems, questions, etc. regarding
this software. Please do *not* contact me directly unless you have new
technical information, and please understand that I do not have the
time and energy to give technical support to unexperienced first time
Season7 users. I wish to thank the members of the tv-crypt mailing list
for their valuable help.

I consider this code to be Freeware. You may freely use and
redistribute it, as long as you do not try to make money out of it and
as long as you do give proper credit to the author. This software
version contains absolutely no algorithms or data on which News Datacom
or BSkyB might have any intellectual property rights.

Season7 uses a public domain interrupt driven serial port assembler
routine which has been published by David Kessner <dkessner@vigra.com>
some time ago. Ask him, if you are interested in the latest version of
this serial port code. David Kessner was not involved otherwise in the
development of Season7, so please do not ask him Season7 related
questions e-mail that do not involve his serial port assembler code.
