Decryption

The specified file is decrypted with the specified key and written to the buffer "pDest".

long decode_cnc_file (unsigned char *pDest, char *pName, long offset,
         long length, char *decryption_key,
         char *err_buffer)

Parameter

Name

Type

Meaning

pDest

unsigned char*

Buffer for output

pName

char*

Name for input file

offset

long

Offset for reading in the input file

length

long

Read length

decryption_key

char*

Key

err_buffer

char*

Buffer for the following error messages:

"Key is longer than 56 characters"

"No key defined"

"File offset was negative"

"File length was negative"

If a blank string is entered, no error occurred. A maximum of 256 characters can be transmitted.

Return values

Value

Meaning

-4

Maximum key length exceeded.

-3

Offset parameter is negative.

-2

Length parameter is negative.

-1

Key missing.

0<x

Decryption of x characters successful.