| // Copyright 2015 Google Inc. All Rights Reserved. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| #ifndef SYZYGY_MSF_MSF_CONSTANTS_H_ |
| #define SYZYGY_MSF_MSF_CONSTANTS_H_ |
| |
| #include <stdint.h> |
| |
| namespace msf { |
| |
| // This is the magic value found at the start of all MSF v7.00 files. |
| const size_t kMsfHeaderMagicStringSize = 32; |
| extern const uint8_t kMsfHeaderMagicString[kMsfHeaderMagicStringSize]; |
| |
| // The maximum number of root pages in the Multi-Stream Format (MSF) header. |
| // See http://code.google.com/p/pdbparser/wiki/MSF_Format |
| const uint32_t kMsfMaxDirPages = 73; |
| |
| // We typically see 1024-byte page sizes generated by the MSVS linker, but this |
| // in turn has a maximum file size of 1GB. The compiler generates PDBs with |
| // 4KB page sizes which has a maximum file size of 2GB. Presumably this could be |
| // any power of 2 in size, but we've only ever seen 1024 and 4096. This is |
| // found in bytes 32 through 35 (little endian) of any PDB file. We use 4KB |
| // pages so that we can handle PDBs up to 2GB without problems (we regularly |
| // exceed 1GB when dealing with Chrome). |
| const uint32_t kMsfPageSize = 4096; |
| |
| } // namespace msf |
| |
| #endif // SYZYGY_MSF_MSF_CONSTANTS_H_ |