#pragma once #include "../include/Types.h" #include <3rd_party/DIA/dia2.h> #include #include #include #include namespace blackbone { class PDBHelper { public: PDBHelper(); ~PDBHelper(); /// /// Initialize symbols for target file /// /// Fully qualified path to target PE file /// Base ptr to add to RVAs /// Status code HRESULT Init( const std::wstring& file, ptr_t base = 0 ); /// /// Get symbol RVA /// /// Symbol name /// Resulting RVA /// Status code HRESULT GetSymAddress( const std::wstring& symName, ptr_t& result ); private: /// /// Initialize DIA /// /// Status code HRESULT CoCreateDiaDataSource(); /// /// Build module symbol map /// /// Status code HRESULT PopulateSymbols(); private: // DIA interfaces CComPtr _source; CComPtr _session; CComPtr _global; uint64_t _base = 0; // Base ptr to add to RVAs std::wstring _sympath; // Symbol cache directory std::unordered_map _cache; // Symbol name <--> RVA map }; }