⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cp_api.h

📁 SAMSUNG 5009的源代码
💻 H
字号:
/******************************************************************************
 *   Filename    : Cp_api.h                                                   *
 *   Start date  :                                                            *
 *   By          :                                                            *             
 *   Contact     :                                                            *
 *   Description : low level api headers.(for only high level api)            *
 *                                                                            *
 ******************************************************************************
 */
#ifndef	_CP_API_H_
#define	_CP_API_H_

#ifdef __cplusplus
extern "C" {
#endif

/*
	change disc key recover algorithm for <Contact>(Funai)
	by CKLee. 2005.11.25
*/
#define _NEW_DKEY_RECOVER

/********************************************* 
 *   Define
 *********************************************/

#define        GET_CSS_AGID                                        0
#define        CHALLENGE_KEY                                       1
#define        KEY_1                                               2
#define        KEY_2                                               3
#define        TITLE_KEY                                           4
#define        GET_ASF                                             5
#define        REGION                                              6
#define        GET_CPRM_AGID                                       7

/* initialize complete or not */
#define CP_CSS_DK_ON	0x1		/* CSS DiscInit complete */
#define CP_CSS_ON		0x2		/* CSS TitleInit complete */

#define CP_CPPM_DK_ON	0x4		/* CPPM DK callback function complete */
#define CP_CPPM_ON		0x8		/* CPPM initialize complete */

#define CP_CPRM_DK_ON	0x10	/* CPRM DK callback function complete */
#define CP_CPRM_ON		0x20	/* CPRM initialize complete */

/* current descramble mode */
#define CP_CSS_MODE		0x100		/* CSS descrambler on */
#define CP_CPPM_MODE	0x200		/* CPPM descrambler on */
#define CP_CPRM_MODE	0x400		/* CPRM descrambler on */
#define CP_NONE_MODE	0x800		/* all descrambler off */

/* needed key change */
#define CP_CSS_TK_NEED	0x10000		/* CSS Title Key Init Needed */

#define CP_MODE_CLEAR	0xFFFF00FF

typedef enum {
    CP_SUCCESS=0,
    CP_AUTHORIZATION_FAIL
} CP_Ret_t;

/********************************************* 
 *   Functions Define
 *********************************************/
/*this is secret functions of the 4C Entity, LLC.*/
extern VOID CP_C2e(BYTE1 key[7], BYTE4 *inout);
extern VOID CP_C2d(BYTE1 key[7], BYTE4 *inout);
extern VOID CP_C2g(BYTE1 key[7], BYTE4 *inout);
extern VOID CP_C2h(BYTE1 Hash_h[8], BYTE4 *inout, SINT length);
extern VOID CP_C2ecbc(CONST BYTE1 key[7], BYTE4 *inout, SINT length);
extern VOID CP_C2dcbc(CONST BYTE1 key[7], BYTE4 *inout, SINT length);

#ifdef _SUPPORT_CSS
CP_Ret_t CP_DKeyRecover  ( BYTE1 *DecDKey,BYTE1 *albumid);
CP_Ret_t CP_TKeyRecover  ( BYTE1 *DecDKey, BYTE1 *DecTKey);

CP_Ret_t CP_CssDescrambleSector( UCHAR* p_sec );

#endif

#ifdef _FE_IS_ATAPI
CP_Ret_t CP_CheckCpType  ( BYTE2 *cp_type );
CP_Ret_t CP_GetCssAgid   ( BYTE1 *agid_p );
CP_Ret_t CP_GetCprmAgid  ( BYTE1 *agid_p );
CP_Ret_t CP_SetRegion    ( BYTE1 region_p );
CP_Ret_t CP_GetDKey      ( BYTE1 *d_key_p );
CP_Ret_t CP_GetTKey      ( BYTE1 *t_key_p, LBA lba );
CP_Ret_t CP_GetMKB       ( BYTE1 *mkb_p, BYTE4 *pack_length);
CP_Ret_t CP_GetMediaID   ( BYTE1 *media_id_p );
CP_Ret_t CP_GetAlbumID   ( BYTE1 *album_id_p );
#endif

#ifdef _SUPPORT_CPPM
CP_Ret_t CP_ProcessMkbCppm( BYTE1 *MediaKey , SINT mkb_lba);
#endif

#ifdef _SUPPORT_CPRM
CP_Ret_t CP_ProcessMkbCprm( BYTE1 *MediaKey , BYTE1* Mkb);
CP_Ret_t CP_GetCprmTitleKey( UCHAR *kte, UCHAR *kmu, UCHAR *kt);
#endif

#if (defined(_SUPPORT_CPPM)||defined(_SUPPORT_CPRM))
CP_Ret_t CP_GetAlbumUniqueKey( UCHAR *album_id, UCHAR *mediakey, UCHAR *album_unique_key );
CP_Ret_t CP_SnakeKeyDecrypt( UCHAR *input, UCHAR *output);
#endif

#ifdef __cplusplus
}
#endif

#endif /* _CP_API_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -