|
RDFU
1.0
|
Helper functions for Portable Executable files. More...
#include "EfiScannerHeaders.h"
Go to the source code of this file.
Macros | |
| #define | FIELD_OFFSET(type, field) ((LONG)(LONG_PTR)&(((type *)0)->field)) |
| #define | IMAGE_FIRST_SECTION32(ntheader) |
| #define | IMAGE_FIRST_SECTION64(ntheader) |
Functions | |
| BOOLEAN | IsItPE64 (C_PTR Base) |
| BOOLEAN | GetPEHeaders (C_PTR Base, EFI_IMAGE_DOS_HEADER **pMZ, EFI_IMAGE_NT_HEADERS32 **pPE, EFI_IMAGE_SECTION_HEADER **pSH) |
| ULONG | GetPECodeChecksum (C_PTR Base) |
Helper functions for Portable Executable files.
Dump support for TE images.
Definition in file Pe.c.
| #define IMAGE_FIRST_SECTION32 | ( | ntheader | ) |
Definition at line 19 of file Pe.c.
Referenced by GetPEHeaders().
| #define IMAGE_FIRST_SECTION64 | ( | ntheader | ) |
Definition at line 26 of file Pe.c.
Referenced by GetPEHeaders().
Function computes the checksum from code section of the selected PE file. Code sections that are writable are not included in the checksum.
| Base | Base of PE file in memory |
| Checksum | On success |
| NULL | On error |
Definition at line 144 of file Pe.c.
References EFI_IMAGE_SECTION_HEADER::Characteristics, EFI_IMAGE_SCN_MEM_EXECUTE, EFI_IMAGE_SCN_MEM_WRITE, EFI_IMAGE_NT_HEADERS32::FileHeader, GetPEHeaders(), EFI_IMAGE_FILE_HEADER::NumberOfSections, EFI_IMAGE_SECTION_HEADER::SizeOfRawData, and EFI_IMAGE_SECTION_HEADER::VirtualAddress.
Referenced by AddImageToList(), and GetAllImagesWithDescription().


| BOOLEAN GetPEHeaders | ( | C_PTR | Base, |
| EFI_IMAGE_DOS_HEADER ** | pMZ, | ||
| EFI_IMAGE_NT_HEADERS32 ** | pPE, | ||
| EFI_IMAGE_SECTION_HEADER ** | pSH | ||
| ) |
Function initializes the IMAGE_DOS_HEADER, IMAGE_NT_HEADERS and IMAGE_SECTION_HEADER.
| Base | Base of PE file in memory |
| pMZ | Pointer to variable which receives the EFI_IMAGE_DOS_HEADER pointer |
| pPE | Pointer to variable which receives the EFI_IMAGE_NT_HEADERS pointer |
| pSH | Pointer to variable which receives the EFI_IMAGE_SECTION_HEADER pointer |
| TRUE | On success |
| FALSE | On error |
Definition at line 76 of file Pe.c.
References EFI_IMAGE_DOS_HEADER::e_lfanew, EFI_IMAGE_DOS_HEADER::e_magic, EFI_IMAGE_DOS_SIGNATURE, EFI_IMAGE_NT_SIGNATURE, EFI_IMAGE_NT_HEADERS32::FileHeader, IMAGE_FILE_MACHINE_X64, IMAGE_FIRST_SECTION32, IMAGE_FIRST_SECTION64, LogFullAscii(), EFI_IMAGE_FILE_HEADER::Machine, and EFI_IMAGE_NT_HEADERS32::Signature.
Referenced by BruteFind_gEventSignalQueueAddr(), and GetPECodeChecksum().


| BOOLEAN IsItPE64 | ( | C_PTR | Base | ) |
Function checks whether selected Portable Executable file in memory is 32bit or 64bit.
| Base | Base of PE file in memory |
| TRUE | PE is 64bit |
| FALSE | PE is 32bit |
Definition at line 46 of file Pe.c.
References EFI_IMAGE_DOS_HEADER::e_lfanew, EFI_IMAGE_NT_HEADERS32::FileHeader, IMAGE_FILE_MACHINE_X64, and EFI_IMAGE_FILE_HEADER::Machine.