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