3 #ifndef _DEF_RESOURCES_H
4 #define _DEF_RESOURCES_H
6 #include <SupportDefs.h>
8 // x86 resource file constants
9 const char kX86ResourceFileMagic
[4] = { 'R', 'S', 0, 0 };
10 const uint32 kX86ResourcesOffset
= 0x00000004;
12 // PPC resource file constants
13 const char kPPCResourceFileMagic
[4] = { 'r', 'e', 's', 'f' };
14 const uint32 kPPCResourcesOffset
= 0x00000028;
16 // ELF file related constants
17 const uint32 kELFMinResourceAlignment
= 32;
19 // the unused data pattern
20 const uint32 kUnusedResourceDataPattern
[3] = {
21 0xffffffff, 0x000003e9, 0x00000000
25 // the resources header
26 struct resources_header
{
27 uint32 rh_resources_magic
;
28 uint32 rh_resource_count
;
29 uint32 rh_index_section_offset
;
30 uint32 rh_admin_section_size
;
34 const uint32 kResourcesHeaderMagic
= 0x444f1000;
35 const uint32 kResourceIndexSectionOffset
= 0x00000044;
36 const uint32 kResourceIndexSectionAlignment
= 0x00000600;
37 const uint32 kResourcesHeaderSize
= 68;
40 // the header of the index section
41 struct resource_index_section_header
{
42 uint32 rish_index_section_offset
;
43 uint32 rish_index_section_size
;
44 uint32 rish_unused_data1
;
45 uint32 rish_unknown_section_offset
;
46 uint32 rish_unknown_section_size
;
47 uint32 rish_unused_data2
[25];
48 uint32 rish_info_table_offset
;
49 uint32 rish_info_table_size
;
50 uint32 rish_unused_data3
;
53 const uint32 kUnknownResourceSectionSize
= 0x00000168;
54 const uint32 kResourceIndexSectionHeaderSize
= 132;
57 // an entry of the index table
58 struct resource_index_entry
{
64 const uint32 kResourceIndexEntrySize
= 12;
68 struct resource_info
{
75 const uint32 kMinResourceInfoSize
= 10;
78 // a resource info block
79 struct resource_info_block
{
81 resource_info rib_info
[1];
84 const uint32 kMinResourceInfoBlockSize
= 4 + kMinResourceInfoSize
;
87 // the structure separating resource info blocks
88 struct resource_info_separator
{
93 const uint32 kResourceInfoSeparatorSize
= 8;
96 // the end of the info table
97 struct resource_info_table_end
{
98 uint32 rite_check_sum
;
99 uint32 rite_terminator
;
102 const uint32 kResourceInfoTableEndSize
= 8;
105 #endif // _DEF_RESOURCES_H