pe.h
上传用户:yll456
上传日期:2022-03-08
资源大小:19064k
文件大小:1k
源码类别:

钩子与API截获

开发平台:

Visual C++

  1. #include "windows.h"
  2. #ifndef _PE_H_
  3. #define _PE_H_
  4. typedef struct _MAP_FILE_STRUCT
  5. {
  6. HANDLE hFile;
  7. HANDLE hMapping;
  8. LPVOID ImageBase;
  9. }  MAP_FILE_STRUCT,* PMAP_FILE_STRUCT;
  10.  
  11. BOOL LoadFileR(LPTSTR lpFilename,PMAP_FILE_STRUCT pstMapFile);
  12. void UnLoadFile(PMAP_FILE_STRUCT pstMapFile);
  13. BOOL IsPEFile(LPVOID ImageBase);
  14. PIMAGE_NT_HEADERS      GetNtHeaders(LPVOID ImageBase);
  15. PIMAGE_FILE_HEADER     GetFileHeader(LPVOID ImageBase);
  16. PIMAGE_OPTIONAL_HEADER GetOptionalHeader(LPVOID ImageBase);
  17. PIMAGE_SECTION_HEADER  GetFirstSectionHeader(LPVOID ImageBase);
  18. LPVOID RvaToPtr(PIMAGE_NT_HEADERS pNtH,LPVOID ImageBase,DWORD dwRVA);
  19. LPVOID GetDirectoryEntryToData(LPVOID ImageBase,USHORT DirectoryEntry);
  20. PIMAGE_EXPORT_DIRECTORY GetExportDirectory(LPVOID ImageBase);
  21. PIMAGE_IMPORT_DESCRIPTOR  GetFirstImportDesc(LPVOID ImageBase);
  22. DWORD   GetNumOfExportFuncs(LPVOID ImageBase,PIMAGE_EXPORT_DIRECTORY pExportDir);
  23. BOOL    IsDataDirPresent(LPVOID ImageBase,USHORT DirectoryEntry);
  24. #endif