Sierra Copy Protection and Kyroflux

All questions about how to use KryoFlux go here.
robbo007
Posts: 58
Joined: Wed May 23, 2012 2:56 pm
Location: Valencia, Spain

Sierra Copy Protection and Kyroflux

Post by robbo007 » Sun Jan 05, 2014 9:39 pm

Hi guys,
Just trying to get my head around all the different types of IBM Pc copy protection they used back in the 1980's and 1990's. From what I understand Kyroflux should be able to dump copy-protected disks with no problems right?

So something like this protection that Sierra used for their AGI games should be abled to be dumped to image files exactly like the original floppy?


Sectors 2 through 8 must have a nonstandard sector size of 1024 bytes per sector (a normal DOS sector has 512 bytes).

Sector 1 must have a nonstandard sector size of 8192 bytes per sector. This sector contains the decryption key.

Sector 1 *must* have a CRC error. (BTW: This is what prevents the copy-protection from working under Windows 98, because Win98's Int13 handler returns incorrect error codes (0Ah instead of 10h for CRC error))

All sectors on track 6 must overlap, i.e. the data for sector 2 also contains the beginning of sector 3, and so on. The data from sector 1 contains *all* the following sectors.

The checksum of the first 128 bytes from sector 1 must match a certain value (1Ch or something like that).
1), 2) and 5) can be reproduced with an advanced diskcopy program, like copyiipc or Teledisk. 3) and 4) can NOT be reproduced, because the PC's floppy controller doesn't allow you to write "bad" sectors (with CRC errors) on purpose, and it doesn't allow you to write overlapping sectors (it wouldn't make any sense, except of course for copy-protection purposes,) so, you cannot make a backup copy from these disks because this copy-protection without special hardware, such as the old Copy2PC option board (if you could even find one nowadays, or let alone a PC which takes ISA cards.)

Thanks,
Rob

robbo007
Posts: 58
Joined: Wed May 23, 2012 2:56 pm
Location: Valencia, Spain

Re: Sierra Copy Protection and Kyroflux

Post by robbo007 » Mon Jan 06, 2014 1:51 am

I've just tested an image file created from my original disk.

Under DOSBOX it freezes. Know problem.

Under PCE-Emulator it asks me to insert the original disk. Either Kryoflux does not like Sierra's copy protection and does not create the image file correctly (including copy protection) or PCE does not support the type of copy protection sierra uses???

Any ideas?

Thanks,
Rob

User avatar
IFW
Posts: 3079
Joined: Mon Nov 08, 2010 2:42 pm

Re: Sierra Copy Protection and Kyroflux

Post by IFW » Mon Jan 06, 2014 11:23 am

A sector dump does not contain any-sort of context data, such as copy-protection.
So if you have your stream files, then yes, the copy-protection is there and should work (and you should keep the stream files!), but since you are using a sector image file it won't work.

robbo007
Posts: 58
Joined: Wed May 23, 2012 2:56 pm
Location: Valencia, Spain

Re: Sierra Copy Protection and Kyroflux

Post by robbo007 » Mon Jan 06, 2014 11:28 am

ok great thanks its clear. Couple more questions if I may?

So is there anyway to convert stream files to image files?
Can I write back MFM stream files to 3.5" floppies disks? That way I could create original disks again :D
Cheers,
Rob

User avatar
mr.vince
Posts: 2119
Joined: Tue Oct 05, 2010 5:48 pm

Re: Sierra Copy Protection and Kyroflux

Post by mr.vince » Mon Jan 06, 2014 9:24 pm

We are working on this; there will soon be an official announcement in regard to roadmap etc.

robbo007
Posts: 58
Joined: Wed May 23, 2012 2:56 pm
Location: Valencia, Spain

Re: Sierra Copy Protection and Kyroflux

Post by robbo007 » Mon Jan 06, 2014 9:53 pm

This would be the biggest thing since sliced bread!!!

That way we could start backing up all IBM software...

Ps. I gather there is no way to convert stream to image without loosing info?

User avatar
IFW
Posts: 3079
Joined: Mon Nov 08, 2010 2:42 pm

Re: Sierra Copy Protection and Kyroflux

Post by IFW » Tue Jan 07, 2014 2:01 am

Converting to any kind of sector image is always a lossy conversion - all context information gets lost, even very basic things like disk geometry can only be guessed based on file size or user defined parameters or for some platforms using fixed values later on.
However, for your own disks, the content is normally the only thing you want to recover - and sector images are perfectly fine for that purpose.

robbo007
Posts: 58
Joined: Wed May 23, 2012 2:56 pm
Location: Valencia, Spain

Re: Sierra Copy Protection and Kyroflux

Post by robbo007 » Tue Jan 07, 2014 12:08 pm

ok thanks for the update. I'll be awaiting your roadmap for MFM writeback to disks :)

cheers,
Rob

robbo007
Posts: 58
Joined: Wed May 23, 2012 2:56 pm
Location: Valencia, Spain

Re: Sierra Copy Protection and Kyroflux

Post by robbo007 » Wed Jan 08, 2014 9:52 am

Hello,
I've managed to get the Kyroflux stream files from my original SpaceQuest one disk converted to to PSI images which retain all the copy protected info and thus can be mounted and used in PCEmulator. :D Rocking....

Here's the details. Many thanks to Hampa and his PCE project. (http://www.hampa.ch/pce/download.html)

You can find the latest version of PCE with Kryoflux (and some
other) patches applied here:

http://www.hampa.ch/pub/pce/pre/pce-201 ... -win32.zip
http://www.hampa.ch/pub/pce/pre/pce-201 ... pfi.tar.gz

In particular, you need the pfi.exe, pri.exe and psi.exe
utilities found in the first archive in the bin directory (I'm
assuming your doing this under Windows).

First we convert the Kryoflux raw streams to a PFI file:

$ pfi sq1-00.0.raw disk1.pfi

Note that I had to rename the files you sent me. Files like
sq100.0.raw won't work because pfi.exe will assume that this
is track 100, side 0. Also note that you need to run this
command just once, with any one of the raw streams as first
parameter.

Now we have a PFI file. This contains basically the same
information as the Kryoflux raw streams, but in a more
convenient format. You can inspect the contents like this:

$ pfi disk1.pfi -l
TRACK 0/0: DATA=249820 CLK=24027428 LEN=24076837 IDX=6 RPM=299.3844
TRACK 0/1: DATA=255339 CLK=24027428 LEN=24077243 IDX=6 RPM=299.3793
TRACK 1/0: DATA=227983 CLK=24027428 LEN=24077246 IDX=6 RPM=299.3793
TRACK 1/1: DATA=243318 CLK=24027428 LEN=24077389 IDX=6 RPM=299.3775
...
TRACK 79/0: DATA=236877 CLK=24027428 LEN=24078030 IDX=6 RPM=299.3695
TRACK 79/1: DATA=243508 CLK=24027428 LEN=24077312 IDX=6 RPM=299.3785
TRACK 80/0: DATA=200830 CLK=24027428 LEN=24077605 IDX=6 RPM=299.3748
TRACK 80/1: DATA=195465 CLK=24027428 LEN=24077916 IDX=6 RPM=299.3709
...

Here you can see that the image contains 5 revolutions for each
track (resulting in 6 indices). The image was made with an 80
track drive at 300 rpm.

pfi.exe can also do some simple (very simple) analysis of the
disk contents:

$ pfi disk1.pfi -p analyse
Track 0/0: MFM 495 KHz
Track 0/1: MFM 496 KHz
Track 1/0: MFM 494 KHz
Track 1/1: MFM 492 KHz
...
Track 79/0: MFM 500 KHz
Track 79/1: MFM 494 KHz
Track 80/0: FM 201 KHz
Track 80/1: FM 195 KHz

This shows you what pfi.exe thinks is on each tracks. As you
can see, all tracks up to 79 are detected as MFM at (about) 500
KHz. This is as it should be. Tracks 80-83 are unformatted and
produce random results.

Next we convert the PFI image to PRI:

$ pfi disk1.pfi -R 1 -r 500000 -p decode pri disk1.pri

PRI images contain raw bits, basically the same content as a
PFI but with the flux reversal pulses converted to bits. The
above command does this at 500 KHz for the first revolution (-R
1).

Finally, we convert the PRI image to PSI:

$ pri disk1.pri -p decode mfm disk1.psi

PSI images contain the disk content at the sector level,
basically the same information as a common raw dump like the
one you included in the archive you sent me, but with extra
information about irregularities. This PSI image is what PCE
can use. You can inspect the contents like this:

$ psi disk1.psi -L
0 0 0 0 0 1 512 MFM POS=1286
0 0 1 0 0 2 512 MFM POS=6518
0 0 2 0 0 3 512 MFM POS=11747
0 0 3 0 0 4 512 MFM POS=16976
0 0 4 0 0 5 512 MFM POS=22184
0 0 5 0 0 6 512 MFM POS=27433
0 0 6 0 0 7 512 MFM POS=32680
0 0 7 0 0 8 512 MFM POS=37905
0 0 8 0 0 9 512 MFM POS=43144
...
6 0 0 6 0 1 8192 MFM CRC-DATA POS=1288
6 0 1 6 0 2 1024 MFM CRC-DATA POS=7048
6 0 2 6 0 3 1024 MFM CRC-DATA POS=12808
6 0 3 6 0 4 1024 MFM CRC-DATA POS=18568
6 0 4 6 0 5 1024 MFM CRC-DATA POS=24328
6 0 5 6 0 6 1024 MFM CRC-DATA POS=30088
6 0 6 6 0 7 1024 MFM CRC-DATA POS=35848
6 0 7 6 0 8 1024 MFM CRC-DATA POS=41608
...

As you can see, there's weirdness on track 6/0. The game checks
this track to verify the disk.

I have just done the steps above and the resulting image works
perfectly for me.
Attachments
PastedGraphic-1.png
Space Quest 1
PastedGraphic-1.png (27.85 KiB) Viewed 5040 times

rcade
Posts: 118
Joined: Mon Nov 21, 2011 5:21 pm

Re: Sierra Copy Protection and Kyroflux

Post by rcade » Thu Jan 09, 2014 4:31 am

This is great news in PC emulation development...
-
Pete Rittwage
C64 Preservation Project
http://c64preservation.com

Post Reply