Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
DllLoader Class Reference

#include <DllLoader.h>

Inheritance diagram for DllLoader:
CoffLoader LibraryLoader

Public Member Functions

 DllLoader (const char *dll, bool track=false, bool bSystemDll=false, bool bLoadSymbols=false, Export *exports=NULL)
 
 ~DllLoader () override
 
bool Load () override
 
void Unload () override
 
int ResolveExport (const char *, void **ptr, bool logging=true) override
 
int ResolveOrdinal (unsigned long ordinal, void **ptr) override
 
bool HasSymbols () override
 
bool IsSystemDll () override
 
HMODULE GetHModule () override
 
ExportGetExportByFunctionName (const char *sFunctionName)
 
ExportGetExportByOrdinal (unsigned long ordinal)
 
- Public Member Functions inherited from CoffLoader
 CoffLoader ()
 
virtual ~CoffLoader ()
 
int ParseCoff (FILE *fp)
 
int ParseHeaders (void *hModule)
 
- Public Member Functions inherited from LibraryLoader
 LibraryLoader (const std::string &libraryFile)
 
virtual ~LibraryLoader ()
 
const char * GetName () const
 
const char * GetFileName () const
 
const char * GetPath () const
 
int IncrRef ()
 
int DecrRef ()
 
int GetRef ()
 

Protected Member Functions

int Parse ()
 
int ResolveImports ()
 
void AddExport (unsigned long ordinal, void *function, void *track_function=NULL)
 
void AddExport (char *sFunctionName, unsigned long ordinal, void *function, void *track_function=NULL)
 
void AddExport (char *sFunctionName, void *function, void *track_function=NULL)
 
void SetExports (Export *exports)
 
void PrintImportLookupTable (unsigned long ImportLookupTable_RVA)
 
void PrintImportTable (ImportDirTable_t *ImportDirTable)
 
void PrintExportTable (ExportDirTable_t *ExportDirTable)
 
int ResolveOrdinal (const char *, unsigned long, void **)
 
int ResolveName (const char *, char *, void **)
 
const char * ResolveReferencedDll (const char *dll)
 
int LoadExports ()
 
void LoadSymbols ()
 
- Protected Member Functions inherited from CoffLoader
void PrintStringTable (void)
 
void PrintSymbolTable (void)
 
int LoadCoffHModule (FILE *fp)
 
int LoadSymTable (FILE *fp)
 
int LoadStringTable (FILE *fp)
 
int LoadSections (FILE *fp)
 
int RVA2Section (unsigned long RVA)
 
voidRVA2Data (unsigned long RVA)
 
unsigned long Data2RVA (void *address)
 
char * GetStringTblIndex (int index)
 
char * GetStringTblOff (int Offset)
 
char * GetSymbolName (SymbolTable_t *sym)
 
char * GetSymbolName (int index)
 
void PerformFixups (void)
 

Static Protected Member Functions

static void UnloadSymbols ()
 
- Static Protected Member Functions inherited from CoffLoader
static void PrintFileHeader (COFF_FileHeader_t *FileHeader)
 
static void PrintWindowsHeader (WindowsHeader_t *WinHdr)
 
static void PrintOptionHeader (OptionHeader_t *OptHdr)
 
static void PrintSection (SectionHeader_t *ScnHdr, char *data)
 

Protected Attributes

ImportDirTable_tImportDirTable
 
ExportDirTable_tExportDirTable
 
bool m_bTrack
 
bool m_bSystemDll
 
bool m_bLoadSymbols
 
bool m_bUnloadSymbols
 
ExportEntrym_pExportHead
 
Exportm_pStaticExports
 
LoadedListm_pDlls
 
- Protected Attributes inherited from CoffLoader
SymbolTable_tSymTable
 
char * StringTable
 
char ** SectionData
 
unsigned long EntryAddress
 
int NumberOfSymbols
 
int SizeOfStringTable
 
int NumOfDirectories
 
int NumOfSections
 
int FileHeaderOffset
 

Additional Inherited Members

- Public Attributes inherited from CoffLoader
voidhModule
 
COFF_FileHeader_tCoffFileHeader
 
OptionHeader_tOptionHeader
 
WindowsHeader_tWindowsHeader
 
Image_Data_Directory_tDirectory
 
SectionHeader_tSectionHeader
 

Constructor & Destructor Documentation

◆ DllLoader()

DllLoader::DllLoader ( const char *  dll,
bool  track = false,
bool  bSystemDll = false,
bool  bLoadSymbols = false,
Export exports = NULL 
)

◆ ~DllLoader()

DllLoader::~DllLoader ( )
override

Member Function Documentation

◆ AddExport() [1/3]

void DllLoader::AddExport ( char *  sFunctionName,
unsigned long  ordinal,
void function,
void track_function = NULL 
)
protected

◆ AddExport() [2/3]

void DllLoader::AddExport ( char *  sFunctionName,
void function,
void track_function = NULL 
)
protected

◆ AddExport() [3/3]

void DllLoader::AddExport ( unsigned long  ordinal,
void function,
void track_function = NULL 
)
protected

◆ GetExportByFunctionName()

Export * DllLoader::GetExportByFunctionName ( const char *  sFunctionName)

◆ GetExportByOrdinal()

Export * DllLoader::GetExportByOrdinal ( unsigned long  ordinal)

◆ GetHModule()

HMODULE DllLoader::GetHModule ( )
inlineoverridevirtual

Implements LibraryLoader.

◆ HasSymbols()

bool DllLoader::HasSymbols ( )
inlineoverridevirtual

Implements LibraryLoader.

◆ IsSystemDll()

bool DllLoader::IsSystemDll ( )
inlineoverridevirtual

Implements LibraryLoader.

◆ Load()

bool DllLoader::Load ( )
overridevirtual

Implements LibraryLoader.

◆ LoadExports()

int DllLoader::LoadExports ( )
protected
Todo:
Validate all pointers are valid. Is a zero RVA valid or not? I'd guess not as it would point to the coff file header, thus not right.

◆ LoadSymbols()

void DllLoader::LoadSymbols ( )
protected

◆ Parse()

int DllLoader::Parse ( )
protected

◆ PrintExportTable()

void DllLoader::PrintExportTable ( ExportDirTable_t ExportDirTable)
protected

◆ PrintImportLookupTable()

void DllLoader::PrintImportLookupTable ( unsigned long  ImportLookupTable_RVA)
protected

◆ PrintImportTable()

void DllLoader::PrintImportTable ( ImportDirTable_t ImportDirTable)
protected

◆ ResolveExport()

int DllLoader::ResolveExport ( const char *  sName,
void **  ptr,
bool  logging = true 
)
overridevirtual

Implements LibraryLoader.

◆ ResolveImports()

int DllLoader::ResolveImports ( void  )
protected

◆ ResolveName()

int DllLoader::ResolveName ( const char *  sName,
char *  sFunction,
void **  fixup 
)
protected

◆ ResolveOrdinal() [1/2]

int DllLoader::ResolveOrdinal ( const char *  sName,
unsigned long  ordinal,
void **  fixup 
)
protected

◆ ResolveOrdinal() [2/2]

int DllLoader::ResolveOrdinal ( unsigned long  ordinal,
void **  ptr 
)
overridevirtual

Reimplemented from LibraryLoader.

◆ ResolveReferencedDll()

const char * DllLoader::ResolveReferencedDll ( const char *  dll)
protected

◆ SetExports()

void DllLoader::SetExports ( Export exports)
inlineprotected

◆ Unload()

void DllLoader::Unload ( )
overridevirtual

Implements LibraryLoader.

◆ UnloadSymbols()

void DllLoader::UnloadSymbols ( )
staticprotected

Member Data Documentation

◆ ExportDirTable

ExportDirTable_t* DllLoader::ExportDirTable
protected

◆ ImportDirTable

ImportDirTable_t* DllLoader::ImportDirTable
protected

◆ m_bLoadSymbols

bool DllLoader::m_bLoadSymbols
protected

◆ m_bSystemDll

bool DllLoader::m_bSystemDll
protected

◆ m_bTrack

bool DllLoader::m_bTrack
protected

◆ m_bUnloadSymbols

bool DllLoader::m_bUnloadSymbols
protected

◆ m_pDlls

LoadedList* DllLoader::m_pDlls
protected

◆ m_pExportHead

ExportEntry* DllLoader::m_pExportHead
protected

◆ m_pStaticExports

Export* DllLoader::m_pStaticExports
protected

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