Click here to Skip to main content
15,917,568 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Double Datatype and .NET [modified] Pin
Dave Kreskowiak15-May-07 10:43
mveDave Kreskowiak15-May-07 10:43 
GeneralRe: Double Datatype and .NET Pin
Ray Kinsella15-May-07 11:19
Ray Kinsella15-May-07 11:19 
GeneralRe: Double Datatype and .NET Pin
Dave Kreskowiak15-May-07 12:58
mveDave Kreskowiak15-May-07 12:58 
GeneralRe: Double Datatype and .NET Pin
Not Active15-May-07 15:04
mentorNot Active15-May-07 15:04 
GeneralRe: Double Datatype and .NET Pin
Ray Kinsella15-May-07 11:18
Ray Kinsella15-May-07 11:18 
QuestionSerialPort.Open() question... Pin
SirTreveyan15-May-07 3:13
SirTreveyan15-May-07 3:13 
AnswerRe: SerialPort.Open() question... Pin
pbraun18-May-07 16:47
pbraun18-May-07 16:47 
QuestionImageDirectoryEntryToDataEx() not working Pin
priyank_ldce15-May-07 0:22
priyank_ldce15-May-07 0:22 
Hi All,

I am trying to make tool like PE viewer in VC++.NET 2005. After enumerating process module I am using ImageDirectoryEntryToData() function to get Import section. It is working fine but this function has been superseded by ImageDirectoryEntryToDataEx() function. I am able to get import section using ImageDirectoryEntryToData() but not using ImageDirectoryEntryToDataEx(). It gives me NULL every time. Here is my code for getting Import Section of the process.

DWORD aProcesses[1024], cbNeeded;
unsigned int i;
HMODULE hMods[1024];
char modName[255];
PIMAGE_IMPORT_DESCRIPTOR pImportDesc;
PIMAGE_SECTION_HEADER pImageHeader;
PSTR pszModName;
ULONG ulSize;

if(EnumProcessModules(::GetCurrentProcess(), hMods, sizeof(hMods), &cbNeeded))
{
	for ( i = 0; i < (cbNeeded / sizeof(HMODULE)); i++ )
	{
		::GetModuleFileNameA(hMods[i], modName, 255);

ImageDirectoryEntryToDataEx(hMods[i], TRUE, 
         IMAGE_DIRECTORY_ENTRY_IMPORT, &ulSize, &pImageHeader);

	if(pImageHeader)
{
		while (pImageHeader->Name)
		{
			pszModName = (PSTR) pImageHeader->Name;
			pImageHeader++;
		} // while
}

/*if(pImportDesc = (PIMAGE_IMPORT_DESCRIPTOR) ImageDirectoryEntryToData(hMods[i], TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &ulSize))
{
	while (pImportDesc->Name)
	{
		pszModName = (PSTR)((PBYTE) hMods[i] + pImportDesc->Name);
		pImportDesc++;
	} // while
}*/
	}
}


Can I know what is the problem with ImageDirectoryEntryToDataEx() function?

Thanks,
Priyank
Questionurgent help Pin
shruthis914-May-07 21:19
shruthis914-May-07 21:19 
AnswerRe: urgent help Pin
Colin Angus Mackay15-May-07 2:00
Colin Angus Mackay15-May-07 2:00 
AnswerRe: urgent help Pin
Dave Kreskowiak15-May-07 4:39
mveDave Kreskowiak15-May-07 4:39 
AnswerRe: urgent help Pin
Pete O'Hanlon15-May-07 9:13
mvePete O'Hanlon15-May-07 9:13 
AnswerRe: urgent help Pin
Navneet Hegde15-May-07 18:49
Navneet Hegde15-May-07 18:49 
QuestionOOPS Pin
Navneet Hegde14-May-07 18:47
Navneet Hegde14-May-07 18:47 
AnswerRe: OOPS Pin
Giorgi Dalakishvili14-May-07 23:06
mentorGiorgi Dalakishvili14-May-07 23:06 
JokeRe: OOPS Pin
Pete O'Hanlon15-May-07 0:32
mvePete O'Hanlon15-May-07 0:32 
AnswerRe: OOPS [modified] Pin
Jaiprakash M Bankolli15-May-07 2:39
Jaiprakash M Bankolli15-May-07 2:39 
GeneralRe: OOPS Pin
Giorgi Dalakishvili15-May-07 8:20
mentorGiorgi Dalakishvili15-May-07 8:20 
Questioncreating setup file Pin
balakpn13-May-07 22:41
balakpn13-May-07 22:41 
AnswerRe: creating setup file Pin
Christian Graus13-May-07 23:37
protectorChristian Graus13-May-07 23:37 
GeneralRe: creating setup file Pin
balakpn14-May-07 0:00
balakpn14-May-07 0:00 
GeneralRe: creating setup file Pin
kubben14-May-07 4:53
kubben14-May-07 4:53 
GeneralRe: creating setup file Pin
kubben14-May-07 4:55
kubben14-May-07 4:55 
Questionlicensing date control Pin
Michael Demeersseman13-May-07 21:36
Michael Demeersseman13-May-07 21:36 
AnswerRe: licensing date control Pin
balakpn13-May-07 22:59
balakpn13-May-07 22:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.