37PeCoffLoaderGetEntryPoint (
39 IN OUT VOID **EntryPoint
76PeCoffLoaderGetMachineType (
83 ASSERT (Pe32Data !=
NULL);
86 if (DosHdr->
e_magic == EFI_IMAGE_DOS_SIGNATURE) {
92 if (Hdr.Te->
Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
94 }
else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
95 return Hdr.Pe32->FileHeader.Machine;
122PeCoffLoaderGetPdbPointer (
131 VOID *CodeViewEntryPointer;
133 UINT32 NumberOfRvaAndSizes;
136 ASSERT (Pe32Data !=
NULL);
139 DirectoryEntry =
NULL;
141 NumberOfRvaAndSizes = 0;
144 if (DosHdr->
e_magic == EFI_IMAGE_DOS_SIGNATURE) {
156 if (Hdr.Te->
Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
157 if (Hdr.Te->
DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
158 DirectoryEntry = &Hdr.Te->
DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
161 Hdr.Te->
DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +
164 }
else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
170 switch (Hdr.Pe32->FileHeader.Machine) {
188 Magic = Hdr.Pe32->OptionalHeader.
Magic;
195 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
196 DirectoryEntry = (
EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
202 NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
203 DirectoryEntry = (
EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
207 if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
208 DirectoryEntry =
NULL;
215 if ((DebugEntry ==
NULL) || (DirectoryEntry ==
NULL)) {
221 if (DebugEntry->SizeOfData > 0) {
222 CodeViewEntryPointer = (VOID *)((
UINTN)DebugEntry->
RVA + ((
UINTN)Pe32Data) + (
UINTN)TEImageAdjust);
223 switch (*(UINT32 *)CodeViewEntryPointer) {
254PeCoffGetSizeOfHeaders (
262 ASSERT (Pe32Data !=
NULL);
265 if (DosHdr->
e_magic == EFI_IMAGE_DOS_SIGNATURE) {
277 if (Hdr.Te->
Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
279 }
else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
280 SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;
285 return (UINT32)SizeOfHeaders;
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define ASSERT_EFI_ERROR(StatusParameter)
#define CODEVIEW_SIGNATURE_NB10
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW
The Visual C++ debug information.
#define CODEVIEW_SIGNATURE_RSDS
#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define CODEVIEW_SIGNATURE_MTOC
#define EFI_IMAGE_MACHINE_IA32
#define EFI_IMAGE_MACHINE_IA64
#define EFI_IMAGE_MACHINE_X64
EMU_PE_COFF_GET_ENTRY_POINT PeCoffGetEntryPoint
UINT32 RVA
The address of the debug data when loaded, relative to the image base.
UINT32 e_lfanew
File address of new exe header.
UINT16 e_magic
Magic number.
UINT16 Signature
The signature for TE format = "VZ".
UINT32 BaseOfCode
From original image – required for ITP debug.
EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]
Only base relocation and debug directory.
UINT16 StrippedSize
Number of bytes we removed from the header.
UINT16 Machine
From the original file header.