Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.7 KiB

  1. //***************************************************************************
  2. // Copy protect header
  3. //
  4. //***************************************************************************
  5. #ifndef __CCPP_H__
  6. #define __CCPP_H__
  7. #include "ksmedia.h"
  8. #define CG_INDEX 0xc0
  9. #define CG_DATA 0xc1
  10. #define COM 0x00
  11. #define CNT_1 0x01
  12. #define CNT_2 0x02
  13. #define SD_STS 0x03
  14. #define DETP_L 0x04
  15. #define DETP_M 0x05
  16. #define VER 0x0f
  17. #define ETKG1 0x10
  18. #define ETKG2 0x11
  19. #define ETKG3 0x12
  20. #define ETKG4 0x13
  21. #define ETKG5 0x14
  22. #define ETKG6 0x15
  23. #define ACC 0x20
  24. #define CHGG1 0x30
  25. #define CHGG2 0x31
  26. #define CHGG3 0x32
  27. #define CHGG4 0x33
  28. #define CHGG5 0x34
  29. #define CHGG6 0x35
  30. #define CHGG7 0x36
  31. #define CHGG8 0x37
  32. #define CHGG9 0x38
  33. #define CHGG10 0x39
  34. #define RSPG1 0x40
  35. #define RSPG2 0x41
  36. #define RSPG3 0x42
  37. #define RSPG4 0x43
  38. #define RSPG5 0x44
  39. #define CMD_NOP 0x00
  40. #define CMD_DEC_RAND 0x12
  41. #define CMD_DEC_DKY 0x15
  42. #define CMD_DRV_AUTH 0x17
  43. #define CMD_DEC_AUTH 0x18
  44. #define CMD_DEC_DTK 0x25
  45. #define CMD_DEC_DT 0x23
  46. #define CNT2_DEFAULT 0xf2
  47. typedef enum
  48. {
  49. NO_GUARD,
  50. GUARD
  51. } CPPMODE;
  52. class Cpp
  53. {
  54. private:
  55. PUCHAR ioBase;
  56. void cpp_outp( UCHAR index, UCHAR data );
  57. UCHAR cpp_inp( UCHAR index );
  58. void wait( ULONG msec );
  59. BOOLEAN cmd_wait_loop( void );
  60. public:
  61. void init( const PDEVICE_INIT_INFO pDevInit );
  62. BOOLEAN reset( CPPMODE mode );
  63. BOOLEAN decoder_challenge( PKS_DVDCOPY_CHLGKEY r1 );
  64. BOOLEAN drive_bus( PKS_DVDCOPY_BUSKEY fsr1 );
  65. BOOLEAN drive_challenge( PKS_DVDCOPY_CHLGKEY r2 );
  66. BOOLEAN decoder_bus( PKS_DVDCOPY_BUSKEY fsr2 );
  67. BOOLEAN DiscKeyStart();
  68. BOOLEAN DiscKeyEnd();
  69. BOOLEAN TitleKey( PKS_DVDCOPY_TITLEKEY tk );
  70. };
  71. #endif // __CCPP_H__