我照着书上写了一串代码:但是DLL名称没有枚举出来,想问一下大家知道怎么回事吗?
#include "iostream"
#include "windows.h"
#include "stdio.h"
using namespace std;
void main()
{
DWORD *PEB=NULL,
*LDR=NULL,
*Flink=NULL,
*p=NULL,
*BaseAddr=NULL,
*DLLNameAddr=NULL;
__asm
{
mov eax,fs:[0x30]
mov PEB,eax
}
LDR=*((DWORD**)((unsigned char*)PEB+0xc));
Flink=*((DWORD**)((unsigned char*)LDR+0x14));
p=Flink;
p=*((DWORD**)p);
for(;p!=Flink;)
{
BaseAddr=*((DWORD**)((unsigned char*)p+0x10));
DLLNameAddr=*((DWORD**)((unsigned char*)p+0x20));
if(BaseAddr==NULL)
{
break;
}
printf("地址 : %08x",BaseAddr);
cout<<endl;
printf("名称 : %s",DLLNameAddr);
putchar(10);
p=*((DWORD**)p);
}
for(;;);
}