vfs: check userland buffers before reading them.
[haiku.git] / headers / private / storage / Pef.h
blob73ffff7317772a1a6699fbda774edff6a98194b7
1 // Pef.h
3 #ifndef _PEF_H
4 #define _PEF_H
6 #include <SupportDefs.h>
8 typedef char PefOSType[4];
10 // container header
11 struct PEFContainerHeader {
12 PefOSType tag1;
13 PefOSType tag2;
14 PefOSType architecture;
15 uint32 formatVersion;
16 uint32 dateTimeStamp;
17 uint32 oldDefVersion;
18 uint32 oldImpVersion;
19 uint32 currentVersion;
20 uint16 sectionCount;
21 uint16 instSectionCount;
22 uint32 reservedA;
25 const char kPEFFileMagic1[4] = { 'J', 'o', 'y', '!' };
26 const char kPEFFileMagic2[4] = { 'p', 'e', 'f', 'f' };
27 const char kPEFArchitecturePPC[4] = { 'p', 'w', 'p', 'c' };
28 const char kPEFContainerHeaderSize = 40;
30 // section header
31 struct PEFSectionHeader {
32 int32 nameOffset;
33 uint32 defaultAddress;
34 uint32 totalSize;
35 uint32 unpackedSize;
36 uint32 packedSize;
37 uint32 containerOffset;
38 uint8 sectionKind;
39 uint8 shareKind;
40 uint8 alignment;
41 uint8 reservedA;
44 const uint32 kPEFSectionHeaderSize = 28;
46 #endif // _PEF_H