OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
gutil.h
1/******
2
3GameSpy / GameMaster Utility Code
4
5Copyright 1998 Critical Mass Communications, LLC.
6
7Suite E-204
82900 Bristol Street
9Costa Mesa, CA 92626
10(714)549-7689
11Fax(714)549-0757
12
13
14******/
15
16typedef unsigned char uchar;
17
18/**********
19gs_encode: This function converts a binary buffer to printable text.
20It uses the base64 algorithm, which expands 3 byte pairs to 4 bytes.
21
22IN
23--
24ins: a pointer to the buffer of data you want to encode
25size: size of the buffer
26
27OUT
28---
29result: pointer to buffer to store result. Size should be (4 * size) / 3 + 1
30 result will be null terminated.
31**********/
32void gs_encode(uchar* ins, int size, uchar* result);
33
34/**********
35gs_encrypt: This functions encypts a buffer (in place) with a given
36key. The key is assumed to be a null terminated string.
37NOTE: Encypting the buffer a second time with the same key will
38decrypt it.
39
40
41IN
42--
43buffer_ptr: buffer to be encrypted
44buffer_len: size of the buffer
45key: null terminated string containing the key to encode with.
46
47OUT
48---
49buffer_ptr: buffer, encrypted in place
50**********/
51void gs_encrypt(uchar* key, int key_len, uchar* buffer_ptr, int buffer_len);