-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathPDBExtractor.h
98 lines (74 loc) · 1.6 KB
/
PDBExtractor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#pragma once
#include "PDBSymbolSorterBase.h"
#include "PDBHeaderReconstructor.h"
#include "PDBSymbolVisitor.h"
#include "UdtFieldDefinition.h"
#include <memory>
#include <string>
// From ntimage.h
#ifndef IMAGE_FILE_MACHINE_CHPE_X86
#define IMAGE_FILE_MACHINE_CHPE_X86 0x3A64
#endif
#define PDBEX_VERSION_MAJOR 0
#define PDBEX_VERSION_MINOR 18
#define PDBEX_VERSION_STRING "0.18"
class PDBExtractor
{
public:
struct Settings
{
PDBHeaderReconstructor::Settings PdbHeaderReconstructorSettings;
UdtFieldDefinition::Settings UdtFieldDefinitionSettings;
std::string SymbolName;
std::string PdbPath;
const char* OutputFilename = nullptr;
const char* TestFilename = nullptr;
bool PrintReferencedTypes = true;
bool PrintHeader = true;
bool PrintDeclarations = true;
bool PrintDefinitions = true;
bool PrintFunctions = false;
bool PrintPragmaPack = true;
bool Sort = false;
};
int Run(
int argc,
char** argv
);
private:
void
PrintUsage();
void
ParseParameters(
int argc,
char** argv
);
void
OpenPDBFile();
void
PrintTestHeader();
void
PrintTestFooter();
void
PrintPDBHeader();
void
PrintPDBDeclarations();
void
PrintPDBDefinitions();
void
PrintPDBFunctions();
void
DumpAllSymbols();
void
DumpOneSymbol();
void
DumpAllSymbolsOneByOne();
void
CloseOpenFiles();
private:
PDB m_PDB;
Settings m_Settings;
std::unique_ptr<PDBSymbolSorterBase> m_SymbolSorter;
std::unique_ptr<PDBHeaderReconstructor> m_HeaderReconstructor;
std::unique_ptr<PDBSymbolVisitor<UdtFieldDefinition>> m_SymbolVisitor;
};