
//---------------------------------------------------------------------
// $VER: example_abort.c 1.0 (16.6.98)
//
// RETURN_ABORT example
//---------------------------------------------------------------------

#include <misc/spirit.h>
#include <proto/exec.h>

#define KEY_LENGTH 512

//---------------------------------------------------------------------
// KeyModule Tags
//---------------------------------------------------------------------

char ver[]="$VER: ExampleAbort_keymodule 1.0 (16.6.98)\r\n";

struct TagItem KeyModTags[]={
               SPT_Name,(ULONG)"!ExampleAbort",
               SPT_Version,(ULONG)"1.0",
               SPT_Cracker,(ULONG)"Sunbeam",
               SPT_Group,(ULONG)"DC",
               SPT_Date,(ULONG)"16.6.98",
               SPT_KeyLength,KEY_LENGTH,
               SPT_KeyName,(ULONG)"never_used_key",
               SPT_KeyPath,(ULONG)"never_needed_dir",
               SPT_Encrypt,(ULONG)encrypt,
               SPT_Anno,NULL,				// yep ZERO!
               SPT_SpiritVer,SPIRITVERSION,
               TAG_DONE};

//---------------------------------------------------------------------
// Encrypt Routine
//---------------------------------------------------------------------

#define TOSVER 1998					// the lib ver
#define mstosname "ms-tos.library"

__asm void main(keyargs)
{

 static ULONG argarray[]={(ULONG)mstosname,TOSVER};
 struct Library *mstlib;

  if (mstlib = OpenLibrary(mstosname, TOSVER))
  {
   KeyModTags[9].ti_Data = (ULONG)"Do you really have the %s %ld? WOW :-)";
   CloseLibrary(mstlib);
  } else KeyModTags[9].ti_Data = (ULONG)"Sorry but you need '%s' V%ld or higher to use this keymodule!";

  spreturn(RETURN_ABORT, (long)argarray);

}
