/ghost/bnlsprotocol.h

http://ghostcb.googlecode.com/ · C Header · 84 lines · 48 code · 11 blank · 25 comment · 0 complexity · 514be813e458b60a4bfa776cf51ad94e MD5 · raw file

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