Click here to Skip to main content
15,906,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: how to know cd presence in CD Drive Pin
Nelek17-Oct-07 5:33
protectorNelek17-Oct-07 5:33 
GeneralRe: how to know cd presence in CD Drive Pin
ThatsAlok17-Oct-07 20:39
ThatsAlok17-Oct-07 20:39 
AnswerRe: how to know cd presence in CD Drive Pin
Iain Clarke, Warrior Programmer17-Oct-07 2:53
Iain Clarke, Warrior Programmer17-Oct-07 2:53 
QuestionMenu Pin
nitin316-Oct-07 20:19
nitin316-Oct-07 20:19 
AnswerRe: Menu Pin
Hamid_RT16-Oct-07 21:09
Hamid_RT16-Oct-07 21:09 
GeneralRe: Menu Pin
chandu00416-Oct-07 22:18
chandu00416-Oct-07 22:18 
GeneralRe: Menu Pin
Hamid_RT16-Oct-07 23:00
Hamid_RT16-Oct-07 23:00 
QuestionRetrieving PE file's import module names Pin
serimcc16-Oct-07 20:14
serimcc16-Oct-07 20:14 
Hi I am trying to get list of import module names from PE file. But i can not find the solution.
This is my code:

CString CPE::GetImportModuleNames(CString str_SectionHdrName)<br />
{<br />
	CString c;<br />
<br />
<br />
	IMAGE_DOS_HEADER * dosheader=(IMAGE_DOS_HEADER *)g_pMappedFileBase;<br />
    IMAGE_OPTIONAL_HEADER * opthdr =(IMAGE_OPTIONAL_HEADER *) <br />
                     ((BYTE*)dosheader+dosheader->e_lfanew+24);<br />
<br />
    IMAGE_IMPORT_DESCRIPTOR * descriptor=(IMAGE_IMPORT_DESCRIPTOR *)<br />
     ((BYTE*)dosheader+ <br />
     opthdr->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);<br />
<br />
	// (?)<br />
<br />
	return c;<br />
}


In Documentation, it says:

" The IMAGE_IMPORT_DESCRIPTOR struct consists of five fields :

Union {
DWORD Characteristics;
PIMAGE_THUNK_DATA OriginalFirstThunk;
};
DWORD TimeDateStamp;
DWORD ForwarderChain;
DWORD Name;
PIMAGE_THUNK_DATA FirstThunk;"
...
"Name contains the a pointer (RVA) to the ASCII name of the DLL."
How can i retrieve the name of modules from that pointer(RVA).
Now i think i must write a loop and get the names but i couldn't do the the last step.

while(?)
{
descriptor->Name (?)
}

Could you please help me.
Thank you.
AnswerRe: Retrieving PE file's import module names Pin
Jeffrey Walton16-Oct-07 20:38
Jeffrey Walton16-Oct-07 20:38 
GeneralRe: Retrieving PE file's import module names Pin
serimcc16-Oct-07 20:45
serimcc16-Oct-07 20:45 
AnswerRe: Retrieving PE file's import module names Pin
Hamid_RT17-Oct-07 2:18
Hamid_RT17-Oct-07 2:18 
QuestionRead and Write Raw Sectors Pin
Jeffrey Walton16-Oct-07 19:59
Jeffrey Walton16-Oct-07 19:59 
AnswerRe: Read and Write Raw Sectors Pin
Jeffrey Walton16-Oct-07 20:41
Jeffrey Walton16-Oct-07 20:41 
QuestionGetting the length of a string of a buffer Pin
steve_rm16-Oct-07 19:55
steve_rm16-Oct-07 19:55 
AnswerRe: Getting the length of a string of a buffer Pin
Jeffrey Walton16-Oct-07 20:03
Jeffrey Walton16-Oct-07 20:03 
AnswerRe: Getting the length of a string of a buffer Pin
Roger Broomfield16-Oct-07 20:23
Roger Broomfield16-Oct-07 20:23 
GeneralRe: Getting the length of a string of a buffer Pin
steve_rm16-Oct-07 21:30
steve_rm16-Oct-07 21:30 
GeneralRe: Getting the length of a string of a buffer Pin
David Crow17-Oct-07 3:03
David Crow17-Oct-07 3:03 
AnswerRe: Getting the length of a string of a buffer Pin
chandu00416-Oct-07 20:52
chandu00416-Oct-07 20:52 
GeneralRe: Getting the length of a string of a buffer Pin
Jeffrey Walton16-Oct-07 21:22
Jeffrey Walton16-Oct-07 21:22 
GeneralRe: Getting the length of a string of a buffer Pin
chandu00416-Oct-07 21:54
chandu00416-Oct-07 21:54 
GeneralRe: Getting the length of a string of a buffer Pin
Jeffrey Walton16-Oct-07 21:59
Jeffrey Walton16-Oct-07 21:59 
QuestionResizing child windows Pin
kk.tvm16-Oct-07 19:51
kk.tvm16-Oct-07 19:51 
AnswerRe: Resizing child windows Pin
Nibu babu thomas16-Oct-07 20:05
Nibu babu thomas16-Oct-07 20:05 
AnswerRe: Resizing child windows Pin
Hamid_RT16-Oct-07 21:03
Hamid_RT16-Oct-07 21:03 

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.