xref: /OK3568_Linux_fs/external/rkupdate/RKBoot.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 #ifndef RKBOOT_HEADER
2 #define RKBOOT_HEADER
3 #include "DefineHeader.h"
4 
5 
6 #define  BOOT_RESERVED_SIZE 57
7 #pragma pack(1)
8 typedef struct
9 {
10     UINT uiTag;
11     USHORT usSize;
12     DWORD  dwVersion;
13     DWORD  dwMergeVersion;
14     STRUCT_RKTIME stReleaseTime;
15     ENUM_RKDEVICE_TYPE emSupportChip;
16     UCHAR uc471EntryCount;
17     DWORD dw471EntryOffset;
18     UCHAR uc471EntrySize;
19     UCHAR uc472EntryCount;
20     DWORD dw472EntryOffset;
21     UCHAR uc472EntrySize;
22     UCHAR ucLoaderEntryCount;
23     DWORD dwLoaderEntryOffset;
24     UCHAR ucLoaderEntrySize;
25     UCHAR ucSignFlag;
26     UCHAR ucRc4Flag;
27     UCHAR reserved[BOOT_RESERVED_SIZE];
28 } STRUCT_RKBOOT_HEAD, *PSTRUCT_RKBOOT_HEAD;
29 
30 typedef struct
31 {
32     UCHAR ucSize;
33     ENUM_RKBOOTENTRY emType;
34     WCHAR szName[20];
35     DWORD dwDataOffset;
36     DWORD dwDataSize;
37     DWORD dwDataDelay;//����Ϊ��λ
38 } STRUCT_RKBOOT_ENTRY, *PSTRUCT_RKBOOT_ENTRY;
39 
40 
41 #pragma pack()
42 class CRKBoot
43 {
44 public:
45     bool GetRc4DisableFlag();
46     property<CRKBoot, bool, READ_ONLY> Rc4DisableFlag;
47     bool GetSignFlag();
48     property<CRKBoot, bool, READ_ONLY> SignFlag;
49     UINT GetVersion();
50     property<CRKBoot, UINT, READ_ONLY> Version;
51     UINT GetMergeVersion();
52     property<CRKBoot, UINT, READ_ONLY> MergeVersion;
53     STRUCT_RKTIME GetReleaseTime();
54     property<CRKBoot, STRUCT_RKTIME, READ_ONLY> ReleaseTime;
55     ENUM_RKDEVICE_TYPE GetSupportDevice();
56     property<CRKBoot, ENUM_RKDEVICE_TYPE, READ_ONLY> SupportDevice;
57     unsigned char GetEntry471Count();
58     property<CRKBoot, unsigned char, READ_ONLY> Entry471Count;
59     unsigned char GetEntry472Count();
60     property<CRKBoot, unsigned char, READ_ONLY> Entry472Count;
61     unsigned char GetEntryLoaderCount();
62     property<CRKBoot, unsigned char, READ_ONLY> EntryLoaderCount;
63     bool CrcCheck();
64     bool SaveEntryFile(ENUM_RKBOOTENTRY type, UCHAR ucIndex, tstring fileName);
65     bool GetEntryProperty(ENUM_RKBOOTENTRY type, UCHAR ucIndex, DWORD &dwSize, DWORD &dwDelay, tchar *pName = NULL);
66     CHAR GetIndexByName(ENUM_RKBOOTENTRY type, tchar *pName);
67     bool GetEntryData(ENUM_RKBOOTENTRY type, UCHAR ucIndex, PBYTE lpData);
68     bool IsNewIDBFlag();
69     CRKBoot(PBYTE lpBootData, DWORD dwBootSize, bool &bCheck);
70     ~CRKBoot();
71 protected:
72 private:
73     bool m_bRc4Disable;
74     bool m_bSignFlag;
75     DWORD m_version;
76     DWORD m_mergeVersion;
77     STRUCT_RKTIME m_releaseTime;
78     ENUM_RKDEVICE_TYPE m_supportDevice;
79     DWORD m_471Offset;
80     UCHAR m_471Size;
81     UCHAR m_471Count;
82     DWORD m_472Offset;
83     UCHAR m_472Size;
84     UCHAR m_472Count;
85     DWORD m_loaderOffset;
86     UCHAR m_loaderSize;
87     UCHAR m_loaderCount;
88     BYTE  m_crc[4];
89     PBYTE m_BootData;
90     DWORD m_BootSize;
91     USHORT m_BootHeadSize;
92     bool m_NewIDBFlag;
93     void WCHAR_To_char(WCHAR *src, char *dst, int len);
94 };
95 
96 #endif