retdec
Public Member Functions | Private Member Functions | Private Attributes | List of all members
retdec::pdbparser::PDBFile Class Reference

#include <pdb_file.h>

Collaboration diagram for retdec::pdbparser::PDBFile:
Collaboration graph
[legend]

Public Member Functions

 PDBFile (void)
 
 ~PDBFile (void)
 
PDBFileState load_pdb_file (const char *filename)
 
void initialize (uint64_t image_base=0)
 
bool save_streams_to_files (void)
 
unsigned int get_version (void)
 
PDBStreamget_stream (unsigned int num)
 
const char * get_module_name (unsigned int num)
 
PDBTypesget_types_container (void)
 
PDBSymbolsget_symbols_container (void)
 
PDBFunctionAddressMapget_functions (void)
 
PDBGlobalVarAddressMapget_global_variables (void)
 
void print_pdb_file_info (void)
 
void print_modules (void)
 
void dump_FPO (void)
 
void dump_PE_sections (void)
 

Private Member Functions

bool stream_is_linear (PDB_DWORD *pages, int num_pages)
 
char * extract_stream (PDB_DWORD *pages, int num_pages)
 
PDBFileState load_pdb_v200 (void)
 
PDBFileState load_pdb_v700 (void)
 
void parse_modules (void)
 
void parse_sections (uint64_t image_base)
 

Private Attributes

bool pdb_loaded
 
bool pdb_initialized
 
const char * pdb_filename
 
unsigned int pdb_version
 
unsigned int page_size
 
unsigned int pdb_file_size
 
char * pdb_file_data
 
unsigned int num_streams
 
int pdb_fpo_num
 
int pdb_newfpo_num
 
int pdb_sec_num
 
PDB_HEADERpdb_header
 
PDB_ROOTpdb_root_dir
 
PDBInfo70pdb_info_v700
 
NewDBIHdrdbi_header_v700
 
PDBTypespdb_types
 
PDBSymbolspdb_symbols
 
PDBStreamsVec streams
 
PDBModulesVec modules
 
PDBSectionsVec sections
 

Constructor & Destructor Documentation

◆ PDBFile()

retdec::pdbparser::PDBFile::PDBFile ( void  )
inline

◆ ~PDBFile()

retdec::pdbparser::PDBFile::~PDBFile ( void  )

Destructor

Member Function Documentation

◆ dump_FPO()

void retdec::pdbparser::PDBFile::dump_FPO ( void  )

Dumps FPO stream. Can be called after initialize() was executed.

◆ dump_PE_sections()

void retdec::pdbparser::PDBFile::dump_PE_sections ( void  )

Dumps PE Sections stream. Can be called after initialize() was executed.

◆ extract_stream()

char * retdec::pdbparser::PDBFile::extract_stream ( PDB_DWORD pages,
int  num_pages 
)
private

Extracts non-linear stream into linear memory.

Parameters
pagesIndex of pages used by stream
num_pagesNumber of pages used by stream
Returns
Stream data in linear memory

◆ get_functions()

PDBFunctionAddressMap* retdec::pdbparser::PDBFile::get_functions ( void  )
inline

◆ get_global_variables()

PDBGlobalVarAddressMap* retdec::pdbparser::PDBFile::get_global_variables ( void  )
inline

◆ get_module_name()

const char* retdec::pdbparser::PDBFile::get_module_name ( unsigned int  num)
inline

◆ get_stream()

PDBStream* retdec::pdbparser::PDBFile::get_stream ( unsigned int  num)
inline

◆ get_symbols_container()

PDBSymbols* retdec::pdbparser::PDBFile::get_symbols_container ( void  )
inline

◆ get_types_container()

PDBTypes* retdec::pdbparser::PDBFile::get_types_container ( void  )
inline

◆ get_version()

unsigned int retdec::pdbparser::PDBFile::get_version ( void  )
inline

◆ initialize()

void retdec::pdbparser::PDBFile::initialize ( uint64_t  image_base = 0)

Processes all PDB file streams and fills data containers. Must be called after load_pdb_file() and before any getting and printing or dumping method. Can be called only once.

Parameters
image_baseBase address of program's virtual memory.

◆ load_pdb_file()

PDBFileState retdec::pdbparser::PDBFile::load_pdb_file ( const char *  filename)

Loads PDB file into memory and separates all streams. Must be called before using of any method. Can be called only once.

Parameters
filenameName of PDB file to load.
Returns
Loading status

◆ load_pdb_v200()

PDBFileState retdec::pdbparser::PDBFile::load_pdb_v200 ( void  )
private

Separates all streams from PDB file version 2.00. Vector "streams" is filled here.

Returns
State (OK or Invalid file)

◆ load_pdb_v700()

PDBFileState retdec::pdbparser::PDBFile::load_pdb_v700 ( void  )
private

Separates all streams from PDB file version 7.00. Vector "streams" is filled here.

Returns
State (OK or Invalid file)

◆ parse_modules()

void retdec::pdbparser::PDBFile::parse_modules ( void  )
private

Parses DBI stream and gets names of modules and their streams. Vector "modules" is filled here.

◆ parse_sections()

void retdec::pdbparser::PDBFile::parse_sections ( uint64_t  image_base)
private

Parses PE Sections stream and gets section name, virtual address and file address Vector "sections" is filled here.

◆ print_modules()

void retdec::pdbparser::PDBFile::print_modules ( void  )

Prints all modules names and their stream numbers Can be called after initialize() was executed

◆ print_pdb_file_info()

void retdec::pdbparser::PDBFile::print_pdb_file_info ( void  )

Prints basic PDB file information and list of streams Can be called after load_pdb_file() was executed

◆ save_streams_to_files()

bool retdec::pdbparser::PDBFile::save_streams_to_files ( void  )

Saves all streams into separate files. File names consist of input PDB file name and extension .xxx as stream number Can be called after load_pdb_file() was executed

Returns
Operation was successful

◆ stream_is_linear()

bool retdec::pdbparser::PDBFile::stream_is_linear ( PDB_DWORD pages,
int  num_pages 
)
private

Determines whether stream is stored linear in PDB file or not

Parameters
pagesIndex of pages used by stream
num_pagesNumber of pages used by stream
Returns
Stream is linear

Member Data Documentation

◆ dbi_header_v700

NewDBIHdr* retdec::pdbparser::PDBFile::dbi_header_v700
private

◆ modules

PDBModulesVec retdec::pdbparser::PDBFile::modules
private

◆ num_streams

unsigned int retdec::pdbparser::PDBFile::num_streams
private

◆ page_size

unsigned int retdec::pdbparser::PDBFile::page_size
private

◆ pdb_file_data

char* retdec::pdbparser::PDBFile::pdb_file_data
private

◆ pdb_file_size

unsigned int retdec::pdbparser::PDBFile::pdb_file_size
private

◆ pdb_filename

const char* retdec::pdbparser::PDBFile::pdb_filename
private

◆ pdb_fpo_num

int retdec::pdbparser::PDBFile::pdb_fpo_num
private

◆ pdb_header

PDB_HEADER* retdec::pdbparser::PDBFile::pdb_header
private

◆ pdb_info_v700

PDBInfo70* retdec::pdbparser::PDBFile::pdb_info_v700
private

◆ pdb_initialized

bool retdec::pdbparser::PDBFile::pdb_initialized
private

◆ pdb_loaded

bool retdec::pdbparser::PDBFile::pdb_loaded
private

◆ pdb_newfpo_num

int retdec::pdbparser::PDBFile::pdb_newfpo_num
private

◆ pdb_root_dir

PDB_ROOT* retdec::pdbparser::PDBFile::pdb_root_dir
private

◆ pdb_sec_num

int retdec::pdbparser::PDBFile::pdb_sec_num
private

◆ pdb_symbols

PDBSymbols* retdec::pdbparser::PDBFile::pdb_symbols
private

◆ pdb_types

PDBTypes* retdec::pdbparser::PDBFile::pdb_types
private

◆ pdb_version

unsigned int retdec::pdbparser::PDBFile::pdb_version
private

◆ sections

PDBSectionsVec retdec::pdbparser::PDBFile::sections
private

◆ streams

PDBStreamsVec retdec::pdbparser::PDBFile::streams
private

The documentation for this class was generated from the following files: