/device/linaro/bootloader/edk2/MdePkg/Library/BasePeCoffGetEntryPointLib/ |
D | PeCoffGetEntryPoint.c | 60 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetEntryPoint() 65 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetEntryPoint() 75 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetEntryPoint() 76 …*EntryPoint = (VOID *)((UINTN)Pe32Data + (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x… in PeCoffLoaderGetEntryPoint() 112 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetMachineType() 117 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetMachineType() 122 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetMachineType() 123 return Hdr.Pe32->FileHeader.Machine; in PeCoffLoaderGetMachineType() 176 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetPdbPointer() 181 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetPdbPointer() [all …]
|
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/ |
D | PeCoffGetEntryPoint.c | 60 …Header.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ff… in PeCoffLoaderGetEntryPoint() 65 Header.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetEntryPoint() 72 …*EntryPoint = (VOID *)((UINTN)Pe32Data + (UINTN)(Header.Pe32->OptionalHeader.AddressOfEntryPoint &… in PeCoffLoaderGetEntryPoint() 100 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + DosHdr->e_lfanew); in PeCoffLoaderGetMachineType() 102 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data); in PeCoffLoaderGetMachineType() 105 if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetMachineType() 106 return Hdr.Pe32->FileHeader.Machine; in PeCoffLoaderGetMachineType() 158 …Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ffff)… in PeCoffLoaderGetPdbPointer() 163 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetPdbPointer() 174 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetPdbPointer() [all …]
|
/device/linaro/bootloader/edk2/EmulatorPkg/Library/PeiEmuPeCoffGetEntryPointLib/ |
D | PeiEmuPeCoffGetEntryPointLib.c | 95 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetMachineType() 98 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)(Pe32Data); in PeCoffLoaderGetMachineType() 103 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetMachineType() 104 return Hdr.Pe32->FileHeader.Machine; in PeCoffLoaderGetMachineType() 157 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetPdbPointer() 162 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetPdbPointer() 173 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetPdbPointer() 179 switch (Hdr.Pe32->FileHeader.Machine) { in PeCoffLoaderGetPdbPointer() 197 Magic = Hdr.Pe32->OptionalHeader.Magic; in PeCoffLoaderGetPdbPointer() 204 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes; in PeCoffLoaderGetPdbPointer() [all …]
|
/device/linaro/bootloader/edk2/SecurityPkg/Tcg/Tcg2Dxe/ |
D | MeasureBootPeCoff.c | 157 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINT8 *) (UINTN) ImageAddress + PeCoffHeaderOffset); in MeasurePeImageAndExtend() 158 if (Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) { in MeasurePeImageAndExtend() 184 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in MeasurePeImageAndExtend() 196 Magic = Hdr.Pe32->OptionalHeader.Magic; in MeasurePeImageAndExtend() 208 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes; in MeasurePeImageAndExtend() 209 HashSize = (UINTN) ((UINT8 *)(&Hdr.Pe32->OptionalHeader.CheckSum) - HashBase); in MeasurePeImageAndExtend() 235 HashBase = (UINT8 *) &Hdr.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in MeasurePeImageAndExtend() 236 HashSize = Hdr.Pe32->OptionalHeader.SizeOfHeaders - (UINTN) (HashBase - ImageAddress); in MeasurePeImageAndExtend() 259 HashBase = (UINT8 *) &Hdr.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in MeasurePeImageAndExtend() 260 …HashSize = (UINTN) ((UINT8 *)(&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_SE… in MeasurePeImageAndExtend() [all …]
|
/device/linaro/bootloader/edk2/SecurityPkg/Tcg/TrEEDxe/ |
D | MeasureBootPeCoff.c | 157 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINT8 *) (UINTN) ImageAddress + PeCoffHeaderOffset); in MeasurePeImageAndExtend() 158 if (Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) { in MeasurePeImageAndExtend() 184 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in MeasurePeImageAndExtend() 196 Magic = Hdr.Pe32->OptionalHeader.Magic; in MeasurePeImageAndExtend() 208 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes; in MeasurePeImageAndExtend() 209 HashSize = (UINTN) ((UINT8 *)(&Hdr.Pe32->OptionalHeader.CheckSum) - HashBase); in MeasurePeImageAndExtend() 235 HashBase = (UINT8 *) &Hdr.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in MeasurePeImageAndExtend() 236 HashSize = Hdr.Pe32->OptionalHeader.SizeOfHeaders - (UINTN) (HashBase - ImageAddress); in MeasurePeImageAndExtend() 259 HashBase = (UINT8 *) &Hdr.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in MeasurePeImageAndExtend() 260 …HashSize = (UINTN) ((UINT8 *)(&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_SE… in MeasurePeImageAndExtend() [all …]
|
/device/linaro/bootloader/edk2/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/ |
D | PeCoffGetEntryPoint.c | 120 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetMachineType() 125 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetMachineType() 130 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetMachineType() 131 return Hdr.Pe32->FileHeader.Machine; in PeCoffLoaderGetMachineType() 184 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetPdbPointer() 189 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetPdbPointer() 200 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetPdbPointer() 206 switch (Hdr.Pe32->FileHeader.Machine) { in PeCoffLoaderGetPdbPointer() 224 Magic = Hdr.Pe32->OptionalHeader.Magic; in PeCoffLoaderGetPdbPointer() 231 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes; in PeCoffLoaderGetPdbPointer() [all …]
|
/device/linaro/bootloader/edk2/DuetPkg/EfiLdr/ |
D | PeLoader.c | 84 if (PeHdr.Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) { in EfiLdrGetPeImageInfo() 92 Status = EfiLdrPeCoffCheckImageMachineType (PeHdr.Pe32.FileHeader.Machine); in EfiLdrGetPeImageInfo() 97 if (PeHdr.Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { in EfiLdrGetPeImageInfo() 98 *ImageBase = (UINT32)PeHdr.Pe32.OptionalHeader.ImageBase; in EfiLdrGetPeImageInfo() 99 } else if (PeHdr.Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) { in EfiLdrGetPeImageInfo() 105 *ImageSize = PeHdr.Pe32.OptionalHeader.SizeOfImage; in EfiLdrGetPeImageInfo() 157 if (PeHdr.Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) { in EfiLdrPeCoffLoadPeImage() 168 Status = EfiLdrPeCoffSetImageType (Image, PeHdr.Pe32.OptionalHeader.Subsystem); in EfiLdrPeCoffLoadPeImage() 180 Status = EfiLdrPeCoffCheckImageMachineType (PeHdr.Pe32.FileHeader.Machine); in EfiLdrPeCoffLoadPeImage() 199 if (PeHdr.Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { in EfiLdrPeCoffLoadPeImage() [all …]
|
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/ |
D | PeCoffLoader.c | 219 Hdr.Pe32 in PeCoffLoaderGetPeHeader() 237 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetPeHeader() 239 ImageContext->Machine = Hdr.Pe32->FileHeader.Machine; in PeCoffLoaderGetPeHeader() 246 if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) { in PeCoffLoaderGetPeHeader() 248 } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) { in PeCoffLoaderGetPeHeader() 250 } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) { in PeCoffLoaderGetPeHeader() 253 Magic = Hdr.Pe32->OptionalHeader.Magic; in PeCoffLoaderGetPeHeader() 262 ImageContext->ImageType = Hdr.Pe32->OptionalHeader.Subsystem; in PeCoffLoaderGetPeHeader() 263 ImageContext->ImageSize = (UINT64)Hdr.Pe32->OptionalHeader.SizeOfImage; in PeCoffLoaderGetPeHeader() 264 ImageContext->SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment; in PeCoffLoaderGetPeHeader() [all …]
|
/device/linaro/bootloader/edk2/MdePkg/Library/BasePeCoffLib/ |
D | BasePeCoff.c | 69 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in PeCoffLoaderGetPeHeaderMagicValue() 75 return Hdr.Pe32->OptionalHeader.Magic; in PeCoffLoaderGetPeHeaderMagicValue() 152 Hdr.Pe32 in PeCoffLoaderGetPeHeader() 221 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetPeHeader() 223 ImageContext->Machine = Hdr.Pe32->FileHeader.Machine; in PeCoffLoaderGetPeHeader() 231 if (EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES < Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes) { in PeCoffLoaderGetPeHeader() 242 if (((UINT32)Hdr.Pe32->FileHeader.SizeOfOptionalHeader - HeaderWithoutDataDir) != in PeCoffLoaderGetPeHeader() 243 Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes * sizeof (EFI_IMAGE_DATA_DIRECTORY)) { in PeCoffLoaderGetPeHeader() 248 …CoffHeaderOffset + sizeof (UINT32) + sizeof (EFI_IMAGE_FILE_HEADER) + Hdr.Pe32->FileHeader.SizeOfO… in PeCoffLoaderGetPeHeader() 252 if (Hdr.Pe32->OptionalHeader.SizeOfImage <= SectionHeaderOffset) { in PeCoffLoaderGetPeHeader() [all …]
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/GenFw/ |
D | GenFw.c | 521 if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) { in GetPeCoffHeader() 527 if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) { in GetPeCoffHeader() 557 if (PeHdr->Pe32.OptionalHeader.SectionAlignment != PeHdr->Pe32.OptionalHeader.FileAlignment) { in PeCoffConvertImageToXip() 572 …nHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.File… in PeCoffConvertImageToXip() 573 for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) { in PeCoffConvertImageToXip() 588 if (FirstSectionOffset < PeHdr->Pe32.OptionalHeader.SizeOfHeaders) { in PeCoffConvertImageToXip() 617 if (PeHdr->Pe32.FileHeader.PointerToSymbolTable != 0) { in PeCoffConvertImageToXip() 621 PeHdr->Pe32.FileHeader.PointerToSymbolTable = 0; in PeCoffConvertImageToXip() 637 memcpy (XipFile, *FileBuffer, PeHdr->Pe32.OptionalHeader.SizeOfHeaders); in PeCoffConvertImageToXip() 648 …der = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(NewPeHdr->Pe32.OptionalHeader) + NewPeHdr->Pe32.Fi… in PeCoffConvertImageToXip() [all …]
|
D | Elf32Convert.c | 548 NtHdr->Pe32.Signature = EFI_IMAGE_NT_SIGNATURE; in ScanSections32() 552 NtHdr->Pe32.FileHeader.Machine = EFI_IMAGE_MACHINE_IA32; in ScanSections32() 553 NtHdr->Pe32.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC; in ScanSections32() 556 NtHdr->Pe32.FileHeader.Machine = EFI_IMAGE_MACHINE_ARMT; in ScanSections32() 557 NtHdr->Pe32.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC; in ScanSections32() 561 NtHdr->Pe32.FileHeader.Machine = EFI_IMAGE_MACHINE_IA32; in ScanSections32() 562 NtHdr->Pe32.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC; in ScanSections32() 565 NtHdr->Pe32.FileHeader.NumberOfSections = mCoffNbrSections; in ScanSections32() 566 NtHdr->Pe32.FileHeader.TimeDateStamp = (UINT32) time(NULL); in ScanSections32() 567 mImageTimeStamp = NtHdr->Pe32.FileHeader.TimeDateStamp; in ScanSections32() [all …]
|
/device/linaro/bootloader/edk2/UefiCpuPkg/Library/CpuExceptionHandlerLib/ |
D | CpuExceptionCommon.c | 137 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)(Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in FindModuleImageBase() 141 if (((UINTN)Hdr.Pe32 > Pe32Data) && ((UINTN)Hdr.Pe32 < CurrentEip)) { in FindModuleImageBase() 142 if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in FindModuleImageBase() 147 …*EntryPoint = (UINTN)Pe32Data + (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff… in FindModuleImageBase() 155 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in FindModuleImageBase()
|
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/ |
D | BasePeCoff.c | 45 …if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == EF… in PeCoffLoaderGetPeHeaderMagicValue() 51 return Hdr.Pe32->OptionalHeader.Magic; in PeCoffLoaderGetPeHeaderMagicValue() 111 Hdr.Pe32 in GluePeCoffLoaderGetPeHeader() 129 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in GluePeCoffLoaderGetPeHeader() 131 ImageContext->Machine = Hdr.Pe32->FileHeader.Machine; in GluePeCoffLoaderGetPeHeader() 139 ImageContext->ImageType = Hdr.Pe32->OptionalHeader.Subsystem; in GluePeCoffLoaderGetPeHeader() 140 ImageContext->ImageSize = (UINT64)Hdr.Pe32->OptionalHeader.SizeOfImage; in GluePeCoffLoaderGetPeHeader() 141 ImageContext->SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment; in GluePeCoffLoaderGetPeHeader() 142 ImageContext->SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders; in GluePeCoffLoaderGetPeHeader() 238 ImageContext->ImageAddress = Hdr.Pe32->OptionalHeader.ImageBase; in GluePeCoffLoaderGetImageInfo() [all …]
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/Common/ |
D | BasePeCoff.c | 134 if ((*PeHdr)->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetPeHeader() 181 ImageContext->Machine = PeHdr->Pe32.FileHeader.Machine; in PeCoffLoaderCheckImageType() 200 PeHdr->Pe32.FileHeader.Machine = ImageContext->Machine; in PeCoffLoaderCheckImageType() 218 ImageContext->ImageType = PeHdr->Pe32.OptionalHeader.Subsystem; in PeCoffLoaderCheckImageType() 300 OptionHeader.Header = (VOID *) &(PeHdr->Pe32.OptionalHeader); in PeCoffLoaderGetImageInfo() 306 if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { in PeCoffLoaderGetImageInfo() 337 …if ((!(ImageContext->IsTeImage)) && ((PeHdr->Pe32.FileHeader.Characteristics & EFI_IMAGE_FILE_RELO… in PeCoffLoaderGetImageInfo() 347 if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { in PeCoffLoaderGetImageInfo() 387 PeHdr->Pe32.FileHeader.SizeOfOptionalHeader in PeCoffLoaderGetImageInfo() 390 for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++) { in PeCoffLoaderGetImageInfo() [all …]
|
/device/linaro/bootloader/edk2/SecurityPkg/Library/DxeTpmMeasureBootLib/ |
D | DxeTpmMeasureBootLib.c | 389 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINT8 *) (UINTN) ImageAddress + PeCoffHeaderOffset); in TcgMeasurePeImage() 390 if (Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) { in TcgMeasurePeImage() 421 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in TcgMeasurePeImage() 433 Magic = Hdr.Pe32->OptionalHeader.Magic; in TcgMeasurePeImage() 445 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes; in TcgMeasurePeImage() 446 HashSize = (UINTN) ((UINT8 *)(&Hdr.Pe32->OptionalHeader.CheckSum) - HashBase); in TcgMeasurePeImage() 472 HashBase = (UINT8 *) &Hdr.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in TcgMeasurePeImage() 473 HashSize = Hdr.Pe32->OptionalHeader.SizeOfHeaders - (UINTN) (HashBase - ImageAddress); in TcgMeasurePeImage() 496 HashBase = (UINT8 *) &Hdr.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in TcgMeasurePeImage() 497 …HashSize = (UINTN) ((UINT8 *)(&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_SE… in TcgMeasurePeImage() [all …]
|
/device/linaro/bootloader/edk2/SecurityPkg/Library/DxeImageVerificationLib/ |
D | DxeImageVerificationLib.c | 370 …if (mNtHeader.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && mNtHeader.Pe32->OptionalHeade… in HashPeImage() 382 Magic = mNtHeader.Pe32->OptionalHeader.Magic; in HashPeImage() 394 HashSize = (UINTN) ((UINT8 *) (&mNtHeader.Pe32->OptionalHeader.CheckSum) - HashBase); in HashPeImage() 395 NumberOfRvaAndSizes = mNtHeader.Pe32->OptionalHeader.NumberOfRvaAndSizes; in HashPeImage() 427 HashBase = (UINT8 *) &mNtHeader.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in HashPeImage() 428 HashSize = mNtHeader.Pe32->OptionalHeader.SizeOfHeaders - (UINTN) (HashBase - mImageBase); in HashPeImage() 451 HashBase = (UINT8 *) &mNtHeader.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in HashPeImage() 452 …HashSize = (UINTN) ((UINT8 *) (&mNtHeader.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_E… in HashPeImage() 476 …HashBase = (UINT8 *) &mNtHeader.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_SECUR… in HashPeImage() 477 HashSize = mNtHeader.Pe32->OptionalHeader.SizeOfHeaders - (UINTN) (HashBase - mImageBase); in HashPeImage() [all …]
|
/device/linaro/bootloader/edk2/EmbeddedPkg/GdbStub/ |
D | GdbStub.c | 881 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in PeCoffLoaderGetDebuggerInfo() 886 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in PeCoffLoaderGetDebuggerInfo() 901 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in PeCoffLoaderGetDebuggerInfo() 911 switch (Hdr.Pe32->FileHeader.Machine) { in PeCoffLoaderGetDebuggerInfo() 929 Magic = Hdr.Pe32->OptionalHeader.Magic; in PeCoffLoaderGetDebuggerInfo() 936 SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders; in PeCoffLoaderGetDebuggerInfo() 937 NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes; in PeCoffLoaderGetDebuggerInfo() 938 …DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DI… in PeCoffLoaderGetDebuggerInfo() 940 } else if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) { in PeCoffLoaderGetDebuggerInfo()
|
/device/linaro/bootloader/edk2/MdeModulePkg/Core/Pei/Image/ |
D | Image.c | 257 ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader in GetPeCoffImageFixLoadingAssignedAddress() 259 NumberOfSections = ImgHdr->Pe32.FileHeader.NumberOfSections; in GetPeCoffImageFixLoadingAssignedAddress() 774 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in RelocationIsStrip() 779 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data; in RelocationIsStrip() 799 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in RelocationIsStrip() 800 if ((Hdr.Pe32->FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) != 0) { in RelocationIsStrip()
|
/device/linaro/bootloader/edk2/MdeModulePkg/Core/Dxe/Mem/ |
D | MemoryProfileRecord.c | 277 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in InternalPeCoffGetPeHeaderMagicValue() 283 return Hdr.Pe32->OptionalHeader.Magic; in InternalPeCoffGetPeHeaderMagicValue() 311 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *) ((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in InternalPeCoffGetSubsystem() 316 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *) Pe32Data; in InternalPeCoffGetSubsystem() 321 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in InternalPeCoffGetSubsystem() 324 return Hdr.Pe32->OptionalHeader.Subsystem; in InternalPeCoffGetSubsystem() 367 … Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *) ((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff)); in InternalPeCoffGetEntryPoint() 372 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *) Pe32Data; in InternalPeCoffGetEntryPoint() 382 } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) { in InternalPeCoffGetEntryPoint() 383 …*EntryPoint = (VOID *) ((UINTN) Pe32Data + (UINTN) (Hdr.Pe32->OptionalHeader.AddressOfEntryPoint &… in InternalPeCoffGetEntryPoint()
|
/device/linaro/bootloader/edk2/MdeModulePkg/Core/Dxe/Misc/ |
D | PropertiesTable.c | 1130 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINT8 *) (UINTN) ImageAddress + PeCoffHeaderOffset); in InsertImageRecord() 1131 if (Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) { in InsertImageRecord() 1132 DEBUG ((EFI_D_VERBOSE, "Hdr.Pe32->Signature invalid - 0x%x\n", Hdr.Pe32->Signature)); in InsertImageRecord() 1140 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in InsertImageRecord() 1152 Magic = Hdr.Pe32->OptionalHeader.Magic; in InsertImageRecord() 1155 SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment; in InsertImageRecord() 1176 Hdr.Pe32->FileHeader.SizeOfOptionalHeader in InsertImageRecord() 1180 for (Index = 0; Index < Hdr.Pe32->FileHeader.NumberOfSections; Index++) { in InsertImageRecord()
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/GenFv/ |
D | GenFvInternalLib.c | 816 AddressOfEntryPoint = ImgHdr->Pe32.OptionalHeader.AddressOfEntryPoint; in WriteMapFile() 822 ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader in WriteMapFile() 824 Index = ImgHdr->Pe32.FileHeader.NumberOfSections; in WriteMapFile() 2286 IN UINT8 *Pe32, in GetPe32Info() argument 2322 if (Pe32 == NULL) { in GetPe32Info() 2329 TeHeader = (EFI_TE_IMAGE_HEADER *) Pe32; in GetPe32Info() 2343 DosHeader = (EFI_IMAGE_DOS_HEADER *) Pe32; in GetPe32Info() 2355 ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN) Pe32 + DosHeader->e_lfanew); in GetPe32Info() 2360 if (ImgHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) { in GetPe32Info() 2361 …LL, 0, 3000, "Invalid", "Unrecognized image signature 0x%08X.", (unsigned) ImgHdr->Pe32.Signature); in GetPe32Info() [all …]
|
/device/linaro/bootloader/edk2/MdeModulePkg/Core/PiSmmCore/ |
D | MemoryAttributesTable.c | 1098 Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINT8 *) (UINTN) ImageAddress + PeCoffHeaderOffset); in SmmInsertImageRecord() 1099 if (Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) { in SmmInsertImageRecord() 1100 DEBUG ((DEBUG_VERBOSE, "SMM Hdr.Pe32->Signature invalid - 0x%x\n", Hdr.Pe32->Signature)); in SmmInsertImageRecord() 1107 …if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == E… in SmmInsertImageRecord() 1119 Magic = Hdr.Pe32->OptionalHeader.Magic; in SmmInsertImageRecord() 1122 SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment; in SmmInsertImageRecord() 1143 Hdr.Pe32->FileHeader.SizeOfOptionalHeader in SmmInsertImageRecord() 1147 for (Index = 0; Index < Hdr.Pe32->FileHeader.NumberOfSections; Index++) { in SmmInsertImageRecord()
|
/device/linaro/bootloader/edk2/BaseTools/Source/C/VolInfo/ |
D | VolInfo.c | 1443 ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader in SetAddressToSectionHeader() 1449 for (Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) { in SetAddressToSectionHeader() 1549 ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader in RebaseImage() 1552 for (Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) { in RebaseImage() 1565 …if ((ImgHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) && (ImgHdr->Pe32.File… in RebaseImage() 1566 ImgHdr->Pe32.OptionalHeader.ImageBase = (UINT32) NewPe32BaseAddress; in RebaseImage() 1571 ImgHdr->Pe32.OptionalHeader.Magic, in RebaseImage()
|
/device/linaro/bootloader/edk2/UefiCpuPkg/ResetVector/Vtf0/Ia32/ |
D | SearchForSecEntry.asm | 170 ; if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) 175 ; (UINTN)(Hdr.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));
|
/device/linaro/bootloader/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/ |
D | SecureBootConfigImpl.c | 1724 mNtHeader.Pe32 = NtHeader32; in LoadPeImage() 1822 …if (mNtHeader.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && mNtHeader.Pe32->OptionalHeade… in HashPeImage() 1834 Magic = mNtHeader.Pe32->OptionalHeader.Magic; in HashPeImage() 1846 HashSize = (UINTN) ((UINT8 *) (&mNtHeader.Pe32->OptionalHeader.CheckSum) - HashBase); in HashPeImage() 1867 HashBase = (UINT8 *) &mNtHeader.Pe32->OptionalHeader.CheckSum + sizeof (UINT32); in HashPeImage() 1868 …HashSize = (UINTN) ((UINT8 *) (&mNtHeader.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_E… in HashPeImage() 1889 …HashBase = (UINT8 *) &mNtHeader.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_SECUR… in HashPeImage() 1890 …HashSize = mNtHeader.Pe32->OptionalHeader.SizeOfHeaders - (UINTN) ((UINT8 *) (&mNtHeader.Pe32->Opt… in HashPeImage() 1910 SumOfBytesHashed = mNtHeader.Pe32->OptionalHeader.SizeOfHeaders; in HashPeImage() 1924 …HEADER *) AllocateZeroPool (sizeof (EFI_IMAGE_SECTION_HEADER) * mNtHeader.Pe32->FileHeader.NumberO… in HashPeImage() [all …]
|