Store_Keys.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
- #ifndef _STORE_KEYS_H
- #define _STORE_KEYS_H
- #include "Config.h" // Global Configuration - do not remove!
- #include "IncludeSysdefs.h"
- #define STORE_KEYS_HEADER 0x12345678
- #define SCRAMBLE_KEYS_SIZE_IN_BYTE 6
- #define KEY_SELECT_VECTOR_SIZE_IN_BYTE 5
- //HDCP
- #define HDCP_KEYS_SIZE_IN_BYTE 280
- //#define IS_HDCP_KEYS_VALID ( HDCP_keys_struct->HDCP_keys_header == STORE_KEYS_HEADER )
- typedef DWORD _HDCP_KEYS_HEAD;
- typedef struct {
- BYTE Scramble_keys[SCRAMBLE_KEYS_SIZE_IN_BYTE];
- BYTE Key_Select_Vector[KEY_SELECT_VECTOR_SIZE_IN_BYTE];
- BYTE HDCP_keys[HDCP_KEYS_SIZE_IN_BYTE];
- }_HDCP_KEYS_ST;
- typedef struct {
- _HDCP_KEYS_HEAD HDCP_keys_header;
- _HDCP_KEYS_ST HDCP_keys_st;
- } _HDCP_KEYS_STRUCT;
- //DVDA
- #define DVDA_KEYS_SIZE_IN_BYTE 192
- //#define IS_DVDA_KEYS_VALID ( HDCP_keys_struct->HDCP_keys_header == STORE_KEYS_HEADER )
- typedef DWORD _DVDA_KEYS_HEAD;
- typedef struct {
- BYTE DVDA_Type;
- BYTE DVDA_Keys[DVDA_KEYS_SIZE_IN_BYTE];
- }_DVDA_KEYS_ST;
- typedef struct {
- _DVDA_KEYS_HEAD DVDA_keys_header;
- _DVDA_KEYS_ST DVDA_keys_st;
- } _DVDA_KEYS_STRUCT;
- //DVDVR
- #define DVDVR_KEYS_SIZE_IN_BYTE 192
- typedef DWORD _DVDVR_KEYS_HEAD;
- typedef struct {
- BYTE DVDVR_Type;
- BYTE DVDVR_Keys[DVDVR_KEYS_SIZE_IN_BYTE];
- }_DVDVR_KEYS_ST;
- typedef struct {
- _DVDVR_KEYS_HEAD DVDVR_keys_header;
- _DVDVR_KEYS_ST DVDVR_keys_st;
- } _DVDVR_KEYS_STRUCT;
- typedef enum
- {
- KEY_TYPE_HDCP = 0x00,
- KEY_TYPE_DVDA = 0x10,
- KEY_TYPE_DVDA_CPRM_TYPE_A = 0x10,
- KEY_TYPE_DVDA_CPRM_TYPE_B = 0x11,
- KEY_TYPE_DVDA_CPRM_TYPE_C = 0x12,
- KEY_TYPE_DVDVR = 0x20,
- }KEY_TYPE;
- #define STORE_KEYS_START_OFFSET 0
- #define HDCP_KEYS_OFFSET STORE_KEYS_START_OFFSET
- #ifdef STORE_HDCP_KEYS
- #define HDCP_KEYS_STORE_SIZE sizeof(_HDCP_KEYS_STRUCT)
- #define HDCP_KEYS_NUM 1
- #else
- #define HDCP_KEYS_STORE_SIZE 0
- #define HDCP_KEYS_NUM 0
- #endif
- #define DVDA_KEYS_OFFSET (HDCP_KEYS_OFFSET + HDCP_KEYS_STORE_SIZE)
- #ifdef STORE_DVDA_KEYS
- #define DVDA_KEYS_STORE_SIZE sizeof(_DVDA_KEYS_STRUCT)
- #define DVDA_KEYS_NUM 1
- #else
- #define DVDA_KEYS_STORE_SIZE 0
- #define DVDA_KEYS_NUM 0
- #endif
- #define DVDVR_KEYS_OFFSET (DVDA_KEYS_OFFSET + DVDA_KEYS_STORE_SIZE)
- #ifdef STORE_DVDVR_KEYS
- #define DVDVR_KEYS_STORE_SIZE sizeof(_DVDVR_KEYS_STRUCT)
- #define DVDVR_KEYS_NUM 1
- #else
- #define DVDVR_KEYS_STORE_SIZE 0
- #define DVDVR_KEYS_NUM 0
- #endif
- #define STORE_KEYS_END_OFFSET (DVDVR_KEYS_OFFSET + DVDVR_KEYS_STORE_SIZE)
- #define STORE_KEYS_NUM (HDCP_KEYS_NUM + DVDA_KEYS_NUM + DVDVR_KEYS_NUM)
- #define MK_FP(seg,ofs) ((void __seg *)(seg) + (void __near *)(ofs))
- #define STORE_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, STORE_KEYS_START_OFFSET)
- #define HDCP_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, HDCP_KEYS_OFFSET)
- #define DVDA_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, DVDA_KEYS_OFFSET)
- #define DVDVR_KEYS_START_ADDRESS MK_FP(STORE_KEYS_SEG, DVDVR_KEYS_OFFSET)
- typedef struct{
- BYTE Keys_type;
- int Keys_length;
- WORD Keys_offset;
- DWORD Keys_store_address;
- }KEYS_STORE_STRUCT;
- #endif