User Tools

Site Tools


release:zzt_enhancer:craig_notes_signing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

release:zzt_enhancer:craig_notes_signing [2021/06/26 19:56] – created asierelease:zzt_enhancer:craig_notes_signing [2021/06/26 20:00] (current) – created asie
Line 1: Line 1:
 ====== Craig Boston on ZZT Enhancer signing ====== ====== Craig Boston on ZZT Enhancer signing ======
  
-Resource file format:+Converted from .TXT file.
  
 +===== Resource file format =====
 +
 +<code>
 Position Type  Description Position Type  Description
 ------------------------------------------- -------------------------------------------
 0  UINT  NumEntries 0  UINT  NumEntries
 +</code>
  
 Directory Entries: Directory Entries:
  
 +<code>
 Position Type  Description Position Type  Description
 ------------------------------------------- -------------------------------------------
Line 14: Line 19:
 X+2  ULONG  File position X+2  ULONG  File position
 X+6  ULONG  File length X+6  ULONG  File length
 +</code>
  
 (files go here) (files go here)
  
 +<code>
 Position Type  Description Position Type  Description
 ------------------------------------------- -------------------------------------------
Line 23: Line 30:
 EOF-2  UBYTE  CRC CER EOF-2  UBYTE  CRC CER
 EOF-1  UBYTE  CXR CER EOF-1  UBYTE  CXR CER
 +</code>
  
 Okay, this will need a little explaining.  To get CRC ZZT, simply add up all of the bytes of the game's .ZZT file % 256 (or && 255 however you want to do it).  To get CXR ZZT, XOR all of the bytes of the .ZZT file together.  Then XOR the result of this with CRC ZZT. Okay, this will need a little explaining.  To get CRC ZZT, simply add up all of the bytes of the game's .ZZT file % 256 (or && 255 however you want to do it).  To get CXR ZZT, XOR all of the bytes of the .ZZT file together.  Then XOR the result of this with CRC ZZT.
Line 31: Line 39:
  
  
-How EZZT detects a valid game+===== How EZZT detects a valid game =====
-------------------------------+
  
 First of all, here's how the structure of the CER's numeric ID system works: First of all, here's how the structure of the CER's numeric ID system works:
  
-slot 0 -  always nonexistant +  * slot 0 -  always nonexistant 
-slot 1 -  game's LST file (see below) +  slot 1 -  game's LST file (see below) 
-slot 2 -  raw 984-byte screen data containing a 41x12 size text block with the image that's shown as EZZT initializes (I use TheDraw to make them) +  slot 2 -  raw 984-byte screen data containing a 41x12 size text block with the image that's shown as EZZT initializes (I use TheDraw to make them) 
-slots 3-9  Reserved for future use +  slots 3-9  Reserved for future use 
-slots 10-64999  For use by game programmer +  slots 10-64999  For use by game programmer 
-slots 65000-65535 Reserved for future use+  slots 65000-65535 Reserved for future use
  
-Structure of the LST file+===== Structure of the LST file =====
-------------------------------+
  
 The LST file is just a plain ASCII file: The LST file is just a plain ASCII file:
  
-Line 1 - Name (in all caps) of the game file without the ZZT extention.  This is used both in the superencryption (I'll talk about that later) and for EZZT to verify by reading it off of the ZZT status bar. +  * Line 1 - Name (in all caps) of the game file without the ZZT extention.  This is used both in the superencryption (I'll talk about that later) and for EZZT to verify by reading it off of the ZZT status bar. 
-Line 2 - Encyption Key #1 - A 32-digit hex number.  This is made up by the game programmer and should be unique for each game. (this is also described later) +  Line 2 - Encyption Key #1 - A 32-digit hex number.  This is made up by the game programmer and should be unique for each game. (this is also described later) 
-Line 3 - Name of the game to be shown under the picture on the init screen. +  Line 3 - Name of the game to be shown under the picture on the init screen. 
-Line 4 - Can be either the number 0, 1, or 2. (possible more values in the future)+  Line 4 - Can be either the number 0, 1, or 2. (possible more values in the future)
  
 If Line 4 is 0, the file ends there.  If Line 4 is 1, slot 3 in the CER must contain an ASCII file with the global object program (NOTE: I scrapped the global object idea in version 0.25 and while it still works for now it is not guaranteed to be supported in the future and will remain undocumented).  If Line 4 is 2, there will be an extra line in the LST file (Line 5) with the filename of a DLM to be loaded. If Line 4 is 0, the file ends there.  If Line 4 is 1, slot 3 in the CER must contain an ASCII file with the global object program (NOTE: I scrapped the global object idea in version 0.25 and while it still works for now it is not guaranteed to be supported in the future and will remain undocumented).  If Line 4 is 2, there will be an extra line in the LST file (Line 5) with the filename of a DLM to be loaded.
  
-SUPERENCRYPTION(R) +===== SUPERENCRYPTION(R) =====
-------------------------------+
  
 SuperEncryption is my method to make absolutely sure that EZZT games can't be created until I'm sure EZZT is ready for it [...].  When EZZT first starts, none of the commands are available -- it works just like normal ZZT.  Only one command can be used and is the first command executed by and EZZT game, ']enhance.  The format of the enhance command is this: SuperEncryption is my method to make absolutely sure that EZZT games can't be created until I'm sure EZZT is ready for it [...].  When EZZT first starts, none of the commands are available -- it works just like normal ZZT.  Only one command can be used and is the first command executed by and EZZT game, ']enhance.  The format of the enhance command is this:
  
 +<code>
 ']enhance <code> ']enhance <code>
 +</code>
  
-<code> is Key #2 of the superencrpytion key pair.  It is generated by a program (the source to which is included later in this message) and is based on Key #1, the name of the game from Line 1 of the LST file, the phase of the moon, etc.  *IF* and only if: 1) The CRC/CXR pairs check out, 2) The game name displayed on the ZZT status bar is correct, and 3) ']enhance is executed with the proper Key #2, then EZZT will spring into action and start processing commands (this sequence is somewhat different when loading saved games, but it is still secure).  If you load a different game, even a properly set up EZZT-based game, EZZT will shut down and return to normal ZZT mode.  Thus, you can only play the game that you started from the command line.+''%%<code>%%'' is Key #2 of the superencrpytion key pair.  It is generated by a program (the source to which is included later in this message) and is based on Key #1, the name of the game from Line 1 of the LST file, the phase of the moon, etc.  *IF* and only if: 1) The CRC/CXR pairs check out, 2) The game name displayed on the ZZT status bar is correct, and 3) ']enhance is executed with the proper Key #2, then EZZT will spring into action and start processing commands (this sequence is somewhat different when loading saved games, but it is still secure).  If you load a different game, even a properly set up EZZT-based game, EZZT will shut down and return to normal ZZT mode.  Thus, you can only play the game that you started from the command line.
  
 Here's the superencryption program: Here's the superencryption program:
  
 +<code>
 ---------Cut Here--------- ---------Cut Here---------
 /* Patented super-encryption technology.  NOBODY can break this code. */ /* Patented super-encryption technology.  NOBODY can break this code. */
Line 212: Line 220:
   }   }
 ---------Cut Here--------- ---------Cut Here---------
 +</code>
  
 You really don't need superdecrypt, but I included it for completeness.  superencrypt() takes two arguments: code is a pointer to the 32-digit (and null terminated) Key #1 from the LST file, and name is a pointer to the null-terminated name of the game (minus the .ZZT extention).  Make sure that code is in lower-case and name is in all capitals.  It returns a pointer to another 32-digit hex number, Key #2 (the one that should be used in the ']enhance command).  If you use this directly, you should free() the returned pointer yourself when you're done with it. You really don't need superdecrypt, but I included it for completeness.  superencrypt() takes two arguments: code is a pointer to the 32-digit (and null terminated) Key #1 from the LST file, and name is a pointer to the null-terminated name of the game (minus the .ZZT extention).  Make sure that code is in lower-case and name is in all capitals.  It returns a pointer to another 32-digit hex number, Key #2 (the one that should be used in the ']enhance command).  If you use this directly, you should free() the returned pointer yourself when you're done with it.
release/zzt_enhancer/craig_notes_signing.1624737416.txt.gz · Last modified: 2021/06/26 19:56 by asie