
                         SPIRIT - DEVELOPER DOCUMENTION
                         ==============================

« Introduction »
================
 Every key module are saved as normal executable file on your
 harddisk. It will be loaded with dos/LoadSeg().
 The first hunk must start with the KEYHEAD macro. Or it cannot
 be added to the module list.
 This tags must be defined:
  SPT_KeyLength
  SPT_KeyName
  SPT_KeyPath
  SPT_Encrypt
  SPT_Name
  SPT_Version
 All other tags are optional but usefull. See in the example.asm
 source to see how it works. Lets say a bit about the SPT_Encrypt
 tag:
 On the encrypt call A5 contains the KeyBase strcuture.
 In this structure you can find all the needed stuff for your
 keyfile. The encrypt routine must quit with two return codes.
 The first one is D0. Here you must set the RETURN_ERR,NOERR
 equates. The second one is D1. Here you can modify the key save
 length. For example you have allocated a 512 bytes keybuffer but
 the key have a dynamic length now it's possible the save only 64
 bytes by settings this as returncode.
 Please set the FLG,DYNAMIC in SPT_Flags! This is only for Info
 window!

« Tags »
========
 SPT_Name: The program name for which the key is it.
           Don't set the version number here!

 SPT_Version: This is just the version number of the program.
              Please enter it without the 'V'.

 SPT_Cracker: The name of the key routine cracker. Should be your name :^)

 SPT_Group: Your/or the crackers group.

 SPT_Date: This is the creation date of the key module.
           In style: dd.mm.yy (2.3.98).

 SPT_KeyLength: What it says.

 SPT_KeyName: The keyfile name only w/o the path(s)!

 SPT_KeyPath: Here you have to set the full path to the key directory.
              If the key must be copied to the progam dir of the program
              set PROGDIR:!

 SPT_Encrypt: Should point to your makekey routine.

 SPT_TempBuff: By setting this tag you can allocate a tempory
               buffer. Set the length (e.g. 512) and kb_TempBuffer
               points to this buffer.

 SPT_Flags: Here you can set some flags to pre-handle the keyfile.
            See in spirit.i!

 SPT_KeyAnno: Before saving you can display a message.
              Linefeeds are allowed.

 SPT_#?Len: Here you have to set the max. lengths of the string gadgets.
            By setting this length higher then zero the gadget will be
            enabled.

« KeyBase Structure »
=====================
 A5 contains this structure on the SPT_Encrypt call.

 kb_SerialDEC/HEX:
  Be sure you are using only a small SPT_SerialLen (8 should be enough)!
  Possible the buffer (the ULONG) will overflow. I don't check this!!
  If you set FLGF_HEXSER the kb_SerialHEX ULONG contains only the decimal
  parts of the serial number!

 kb_SaveFile:
  This is a function to save an extra file. The save routine uses a file
  requester!

  i: d1=filename+path,d2=length,d3=buffer
  r: d0=error

  To call this function do this:
  move.l   kb_SaveFile(a5),a0
  jsr      (a0)
  tst.l    d0
  bne.s    Error
  ;all ok

  D0.l is zero if all ok or -1 if sth. wrong (e.g. file requester aborted).

« RTS »
