2 * Copyright (c) 2018 Virtuozzo International GmbH
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
18 unsigned char Data4
[8];
26 typedef struct PDB_DS_HEADER
{
36 typedef struct PDB_DS_TOC
{
38 uint32_t file_size
[1];
41 typedef struct PDB_DS_ROOT
{
43 uint32_t TimeDateStamp
;
50 typedef struct PDB_TYPES_OLD
{
59 typedef struct PDB_TYPES
{
71 uint32_t search_offset
;
73 uint32_t unknown_offset
;
77 typedef struct PDB_SYMBOL_RANGE
{
82 uint32_t characteristics
;
87 typedef struct PDB_SYMBOL_RANGE_EX
{
92 uint32_t characteristics
;
97 } PDB_SYMBOL_RANGE_EX
;
99 typedef struct PDB_SYMBOL_FILE
{
101 PDB_SYMBOL_RANGE range
;
104 uint32_t symbol_size
;
105 uint32_t lineno_size
;
112 typedef struct PDB_SYMBOL_FILE_EX
{
114 PDB_SYMBOL_RANGE_EX range
;
117 uint32_t symbol_size
;
118 uint32_t lineno_size
;
122 uint32_t reserved
[2];
124 } PDB_SYMBOL_FILE_EX
;
126 typedef struct PDB_SYMBOL_SOURCE
{
132 typedef struct PDB_SYMBOL_IMPORT
{
135 uint32_t TimeDateStamp
;
140 typedef struct PDB_SYMBOLS_OLD
{
145 uint32_t module_size
;
146 uint32_t offset_size
;
148 uint32_t srcmodule_size
;
151 typedef struct PDB_SYMBOLS
{
159 uint32_t module_size
;
160 uint32_t offset_size
;
162 uint32_t srcmodule_size
;
163 uint32_t pdbimport_size
;
165 uint32_t stream_index_size
;
166 uint32_t unknown2_size
;
179 } PDB_STREAM_INDEXES_OLD
;
193 } PDB_STREAM_INDEXES
;
195 union codeview_symbol
{
211 #define S_PUB_V3 0x110E
213 typedef struct pdb_seg
{
215 } __attribute__ ((packed
)) pdb_seg
;
217 #define IMAGE_FILE_MACHINE_I386 0x014c
218 #define IMAGE_FILE_MACHINE_AMD64 0x8664
224 PDB_DS_HEADER
*header
;
228 uint32_t file_used
[1024];
229 PDB_SYMBOLS
*symbols
;
230 PDB_STREAM_INDEXES sidx
;
236 int pdb_init_from_file(const char *name
, struct pdb_reader
*reader
);
237 void pdb_exit(struct pdb_reader
*reader
);
238 uint64_t pdb_resolve(uint64_t img_base
, struct pdb_reader
*r
, const char *name
);
239 uint64_t pdb_find_public_v3_symbol(struct pdb_reader
*reader
, const char *name
);