-
-
[求助]再次向大家请教一个问题
-
发表于:
2008-4-13 16:21
4048
-
跟刚才请教的拿个问题差不多,晕,,,,,,
PCSTR Ntdll_Func_Name[320];------------------>>>>>关键一,全局
VOID ListNtdllFunction(IN PVOID Addr)
{
HANDLE hMod;
IMAGE_DOS_HEADER * dosheader;
IMAGE_OPTIONAL_HEADER * opthdr;
PIMAGE_EXPORT_DIRECTORY exports;
ULONG addr, i;
PUCHAR pFuncName = NULL;
PULONG pAddressOfNames;
hMod=Addr;
dosheader = (IMAGE_DOS_HEADER *)hMod;
opthdr =(IMAGE_OPTIONAL_HEADER *) ((BYTE*)hMod+dosheader->e_lfanew+24);
exports = (PIMAGE_EXPORT_DIRECTORY)((BYTE*)dosheader+ opthdr->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
pAddressOfNames=(ULONG*)((BYTE*)hMod+exports->AddressOfNames);
for (i = 0; i < exports->NumberOfNames; i++)
{
int u=0;
pFuncName = (PUCHAR)( (BYTE*)hMod + pAddressOfNames[i]);
if ( 'N' == pFuncName[0] && 't' == pFuncName[1] )
{
Ntdll_Func_Name
=pFuncName;
DbgPrint(" %s \n",Ntdll_Func_Name);---------->>>>关键二.输出正常
u++;
}
}
DbgPrint(" %s \n",Ntdll_Func_Name[1]);-------->>>>问题:输出是NULL,为什么??
}
今天被此类问题搞晕了,以前好像没遇到过....菜啊!!!!!
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!