Harlequin RIP SDK

Example implementation of the font decoder filter. More...

#include <stdio.h>
#include <string.h>
#include "skinkit.h"
#include "ripthread.h"
#include "swdevice.h"
#include "skindevs.h"
#include "devutils.h"

Data Structures

struct  _fd_state
 Encapsulates the state of the font decryption device. More...
 

Typedefs

typedef struct _fd_state FD_STATE
 Encapsulates the state of the font decryption device.
 

Functions

static int32 FDread (FD_STATE *FDSTATE)
 Called from FDGetc when needs more data.
 

Variables

DEVICETYPE FontNDcrypt_Device_Type
 Device type structure for the font decryption device.
 

Detailed Description

Example implementation of the font decoder filter.

If you wish to test font encoding as well as decoding, define the symbol TEST_ENCRYPTFONT instead of TEST_DECRYPTFONT. There are two algorithms supported by this code, showing how to implement multiple strategies.

The following code is the encryption algorithm that we're testing for:

void encrypt_string_algorithm1( slist , slen )
{
int32 xorchar = 0x00 ;
while ((--slen) >= 0 ) {
slist[ 0 ] ^= xorchar ;
xorchar += slist[ 0 ] ;
slist++ ;
}
}
void encrypt_string_algorithm2( slist , slen )
{
int32 xorchar = 0x00 ;
while ((--slen) >= 0 ) {
slist[ 0 ] ^= xorchar ;
xorchar += slist[ 0 ] ;
xorchar += 0x10 ;
slist++ ;
}
}
int32_t int32
32-bit signed integer
Definition: hqtypes.h:91

These encryptions cannot be pre-verified, so the code here will not return DeviceIOError to say "this isn't in my code," most most other features of the filter will be exercised.