PageRenderTime 27ms CodeModel.GetById 14ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/ghost-legacy/bnlsprotocol.h

http://ghostcb.googlecode.com/
C++ Header | 84 lines | 48 code | 11 blank | 25 comment | 0 complexity | 514be813e458b60a4bfa776cf51ad94e MD5 | raw file
 1/*
 2
 3   Copyright [2008] [Trevor Hogan]
 4
 5   Licensed under the Apache License, Version 2.0 (the "License");
 6   you may not use this file except in compliance with the License.
 7   You may obtain a copy of the License at
 8
 9       http://www.apache.org/licenses/LICENSE-2.0
10
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16
17   CODE PORTED FROM THE ORIGINAL GHOST PROJECT: http://ghost.pwner.org/
18
19*/
20
21#ifndef BNLSPROTOCOL_H
22#define BNLSPROTOCOL_H
23
24//
25// CBNLSProtocol
26//
27
28class CBNLSProtocol
29{
30public:
31	enum Protocol {
32		BNLS_NULL					= 0x00,
33		BNLS_CDKEY					= 0x01,
34		BNLS_LOGONCHALLENGE			= 0x02,
35		BNLS_LOGONPROOF				= 0x03,
36		BNLS_CREATEACCOUNT			= 0x04,
37		BNLS_CHANGECHALLENGE		= 0x05,
38		BNLS_CHANGEPROOF			= 0x06,
39		BNLS_UPGRADECHALLENGE		= 0x07,
40		BNLS_UPGRADEPROOF			= 0x08,
41		BNLS_VERSIONCHECK			= 0x09,
42		BNLS_CONFIRMLOGON			= 0x0a,
43		BNLS_HASHDATA				= 0x0b,
44		BNLS_CDKEY_EX				= 0x0c,
45		BNLS_CHOOSENLSREVISION		= 0x0d,
46		BNLS_AUTHORIZE				= 0x0e,
47		BNLS_AUTHORIZEPROOF			= 0x0f,
48		BNLS_REQUESTVERSIONBYTE		= 0x10,
49		BNLS_VERIFYSERVER			= 0x11,
50		BNLS_RESERVESERVERSLOTS		= 0x12,
51		BNLS_SERVERLOGONCHALLENGE	= 0x13,
52		BNLS_SERVERLOGONPROOF		= 0x14,
53		BNLS_RESERVED0				= 0x15,
54		BNLS_RESERVED1				= 0x16,
55		BNLS_RESERVED2				= 0x17,
56		BNLS_VERSIONCHECKEX			= 0x18,
57		BNLS_RESERVED3				= 0x19,
58		BNLS_VERSIONCHECKEX2		= 0x1a,
59		BNLS_WARDEN					= 0x7d
60	};
61
62public:
63	CBNLSProtocol( );
64	~CBNLSProtocol( );
65
66	// receive functions
67
68	BYTEARRAY RECEIVE_BNLS_WARDEN( BYTEARRAY data );
69
70	// send functions
71
72	BYTEARRAY SEND_BNLS_NULL( );
73	BYTEARRAY SEND_BNLS_WARDEN_SEED( uint32_t cookie, uint32_t seed );
74	BYTEARRAY SEND_BNLS_WARDEN_RAW( uint32_t cookie, BYTEARRAY raw );
75	BYTEARRAY SEND_BNLS_WARDEN_RUNMODULE( uint32_t cookie );
76
77	// other functions
78
79private:
80	bool AssignLength( BYTEARRAY &content );
81	bool ValidateLength( BYTEARRAY &content );
82};
83
84#endif