2 wodexiaobaitu wodexiaobaitu 于 2014.10.10 17:32 提问

PE编程,关于输入表,无法取得输入表的名称

HANDLE hFile;

HANDLE hMapping;

LPVOID ImageBase;
PIMAGE_IMPORT_DESCRIPTOR pImportDesc;
PIMAGE_OPTIONAL_HEADER pOptionHeader;
hFile = CreateFile(szFilePath,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
hMapping = CreateFileMapping(hFile,NULL,PAGE_READONLY,0,0,NULL);
ImageBase = MapViewOfFile(hMapping,FILE_MAP_READ,0,0,0); pOptionHeader=GetOptionalHeader(ImageBase);
pImportDesc=(PIMAGE_IMPORT_DESCRIPTOR)((byte*)ImageBase+pOptionHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
char dllName=(char)((byte*)ImageBase+pImportDesc->Name);
dllName的不对,是乱码,是哪里出了问题,求帮助,谢谢

Csdn user default icon
上传中...
上传图片
插入图片