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 name tables of the Pdb.
35 m : const uint32 kPdbNameTableSignature = 0xEFFEEFFE;
36 :
37 : // The version we've observed for the name tables of the Pdb.
38 m : const uint32 kPdbNameTableVersion = 1;
39 :
40 : // The index of the Tpi (Type info) stream.
41 m : const size_t kTpiStream = 2;
42 :
43 : // The index of the Dbi info stream.
44 m : const size_t kDbiStream = 3;
45 :
46 : // This is the magic value found at the start of all MSF v7.00 files.
47 m : const size_t kPdbHeaderMagicStringSize = 32;
48 m : extern const uint8 kPdbHeaderMagicString[kPdbHeaderMagicStringSize];
49 :
50 : // The maximum number of root pages in the Multi-Stream Format (MSF) header.
51 : // See http://code.google.com/p/pdbparser/wiki/MSF_Format
52 m : const uint32 kPdbMaxDirPages = 73;
53 :
54 : // This is the Multi-Stream Format (MSF) page size generally used for PDB
55 : // files. Check bytes 32 through 35 (little endian) of any PDB file.
56 : // TODO(chrisha): Make this configurable. We've seen 1024 or 4096, depending on
57 : // the specifics of the file. Plausibly this could be any power of two
58 : // greater than or equal to 512, but 2048 seems to actually be disallowed
59 : // by the MS tools.
60 m : const uint32 kPdbPageSize = 1024;
61 :
62 : // The named PDB stream containing the history of Syzygy transformations applied
63 : // to an image. This consists of a sequence of Metadata objects.
64 m : extern const char kSyzygyHistoryStreamName[];
65 :
66 : // The version of the Syzygy history stream. This needs to be incremented
67 : // whenever the format of the stream has changed.
68 m : const uint32 kSyzygyHistoryStreamVersion = 0;
69 :
70 : // The named PDB stream containing the serialized BlockGraph of an image.
71 m : extern const char kSyzygyBlockGraphStreamName[];
72 :
73 : // The version of the Syzygy BlockGraph data stream. This needs to be
74 : // incremented whenever the format of the stream has changed.
75 m : const uint32 kSyzygyBlockGraphStreamVersion = 1;
76 :
77 m : } // namespace pdb
78 :
79 : #endif // SYZYGY_PDB_PDB_CONSTANTS_H_
|