GdiSpy/pehack.cpp
// returns PIMAGE_IMPORT_DESCRIPTOR for an imported module
returns PIMAGE_IMPORT_DESCRIPTOR for an imported module
returns PIMAGE_IMPORT_DESCRIPTOR for an imported module
PIMAGE_IMPORT_DESCRIPTOR KPEFile::GetImportDescriptor(
	LPCSTR pDllName)
{
	PIMAGE_IMPORT_DESCRIPTOR pImport = (PIMAGE_IMPORT_DESCRIPTOR) 
		GetDirectory(IMAGE_DIRECTORY_ENTRY_IMPORT);
	if ( pImport==NULL )
		return NULL;
	while ( pImport->FirstThunk )
	{
		if ( stricmp(pDllName, RVA2Ptr(pImport->Name))==0 )
			return pImport;
		pImport ++;
	}
	return NULL;
}
PIMAGE_IMPORT_DESCRIPTOR KPEFile :: GetImportDescriptor ( LPCSTR pDllName ) { PIMAGE_IMPORT_DESCRIPTOR pImport = ( PIMAGE_IMPORT_DESCRIPTOR ) GetDirectory ( IMAGE_DIRECTORY_ENTRY_IMPORT ) ; if ( pImport == NULL ) return NULL ; while ( pImport -> FirstThunk ) { if ( stricmp ( pDllName , RVA2Ptr ( pImport -> Name ) ) == 0 ) return pImport ; pImport ++ ; } return NULL ; }
returns PIMAGE_IMPORT_DESCRIPTOR for an imported module
returns PIMAGE_IMPORT_DESCRIPTOR for an imported module
// first IMAGE_IMPORT_DESCRIPTOR // move to next imported module