1 : // Copyright 2012 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : #ifndef SYZYGY_PDB_PDB_CONSTANTS_H_
15 : #define SYZYGY_PDB_PDB_CONSTANTS_H_
16 :
17 : #include "base/basictypes.h"
18 :
19 m : namespace pdb {
20 :
21 : // The index of the Pdb old directory stream.
22 m : const size_t kPdbOldDirectoryStream = 0;
23 :
24 : // The index of the Pdb info header stream.
25 m : const size_t kPdbHeaderInfoStream = 1;
26 :
27 : // The version we've observed in the Pdb info header.
28 m : const uint32 kPdbCurrentVersion = 20000404;
29 :
30 : // The signature we've observed in the section contribs substream of the Pdb Dbi
31 : // stream.
32 m : const uint32 kPdbDbiSectionContribsSignature = 0xF12EBA2D;
33 :
34 : // The signature we've observed for the string tables of the Pdb.
35 m : const uint32 kPdbStringTableSignature = 0xEFFEEFFE;
36 :
37 : // The version we've observed for the string tables of the Pdb.
38 m : const uint32 kPdbStringTableVersion = 1;
39 :
40 : // The index of the Tpi (Type info) stream.
41 m : const size_t kTpiStream = 2;
42 :
43 : // The version we've observed for the Tpi stream.
44 m : const uint32 kTpiStreamVersion = 0x0131CA0B;
45 :
46 : // The index of the first user-defined type.
47 : // Indexes in range 0x0-0xFFF are reserved.
48 : // See http://www.openwatcom.org/ftp/devel/docs/CodeView.pdf, section 5.
49 m : const uint32 kTpiStreamFirstUserTypeIndex = 0x1000;
50 :
51 : // The values we've observed for the hash key and hash buckets fields in the
52 : // header of an empty Tpi stream. See the pdb::TypeInfoHashHeader struct.
53 m : const uint32 kTpiStreamEmptyHashKey = 0x4;
54 m : const uint32 kTpiStreamEmptyHashBuckets = 0x8003;
55 :
56 : // The index of the Dbi info stream.
57 m : const size_t kDbiStream = 3;
58 :
59 : // The version we've observed for the Dbi stream.
60 m : const uint32 kDbiStreamVersion = 0x01310977;
61 :
62 : // The signature we've observed in the header of the public stream.
63 m : const uint32 kPublicStreamSignature = 0xF12F091A;
64 :
65 : // This is the magic value found at the start of all MSF v7.00 files.
66 m : const size_t kPdbHeaderMagicStringSize = 32;
67 m : extern const uint8 kPdbHeaderMagicString[kPdbHeaderMagicStringSize];
68 :
69 : // The maximum number of root pages in the Multi-Stream Format (MSF) header.
70 : // See http://code.google.com/p/pdbparser/wiki/MSF_Format
71 m : const uint32 kPdbMaxDirPages = 73;
72 :
73 : // We typically see 1024-byte page sizes generated by the MSVS linker, but this
74 : // in turn has a maximum file size of 1GB. The compiler generates PDBs with
75 : // 4KB page sizes which has a maximum file size of 2GB. Presumably this could be
76 : // any power of 2 in size, but we've only ever seen 1024 and 4096. This is
77 : // found in bytes 32 through 35 (little endian) of any PDB file. We use 4KB
78 : // pages so that we can handle PDBs up to 2GB without problems (we regularly
79 : // exceed 1GB when dealing with Chrome).
80 m : const uint32 kPdbPageSize = 4096;
81 :
82 : // The named PDB stream containing the history of Syzygy transformations applied
83 : // to an image. This consists of a sequence of Metadata objects.
84 m : extern const char kSyzygyHistoryStreamName[];
85 :
86 : // The version of the Syzygy history stream. This needs to be incremented
87 : // whenever the format of the stream has changed.
88 m : const uint32 kSyzygyHistoryStreamVersion = 0;
89 :
90 : // The named PDB stream containing the serialized BlockGraph of an image.
91 m : extern const char kSyzygyBlockGraphStreamName[];
92 :
93 : // The version of the Syzygy BlockGraph data stream. This needs to be
94 : // incremented whenever the format of the stream has changed.
95 m : const uint32 kSyzygyBlockGraphStreamVersion = 1;
96 :
97 m : } // namespace pdb
98 :
99 : #endif // SYZYGY_PDB_PDB_CONSTANTS_H_
|