OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Functions | |
EFI_STATUS | PeCoffVerifyAppleSignature (IN OUT VOID *PeImage, IN OUT UINT32 *ImageSize) |
EFI_STATUS | PeCoffGetApfsDriverVersion (IN VOID *DriverBuffer, IN UINT32 DriverSize, OUT APFS_DRIVER_VERSION **DriverVersionPtr) |
EFI_STATUS | OcPatchLegacyEfi (IN VOID *DriverBuffer, IN UINT32 DriverSize) |
RETURN_STATUS | OcPeCoffFixupInitializeContext (OUT PE_COFF_LOADER_IMAGE_CONTEXT *Context, IN CONST VOID *FileBuffer, IN UINT32 FileSize, IN BOOLEAN InMemoryFixup) |
Provides additional services for Apple PE/COFF image.
Copyright (c) 2018, savvas. All rights reserved.
Copyright (c) 2021, vit9696. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file OcPeCoffExtLib.h.
EFI_STATUS OcPatchLegacyEfi | ( | IN VOID * | DriverBuffer, |
IN UINT32 | DriverSize ) |
Detect and patch W^X and overlapping section errors in legacy boot.efi. Expected to fix overlapping sections in 10.4 and 10.5 32-bit only, and W^X errors in most macOS binaries.
[in] | DriverBuffer | Image buffer. |
[in] | DriverSize | Size of the image. |
EFI_SUCCESS | on success. |
Definition at line 577 of file OcPeCoffExtLib.c.
RETURN_STATUS OcPeCoffFixupInitializeContext | ( | OUT PE_COFF_LOADER_IMAGE_CONTEXT * | Context, |
IN CONST VOID * | FileBuffer, | ||
IN UINT32 | FileSize, | ||
IN BOOLEAN | InMemoryFixup ) |
Fix W^X and section overlap issues in loaded TE, PE32, or PE32+ Image in memory while initialising Context.
Closely based on PeCoffInitializeContext from PeCoffLib2.
The approach of modifying the image in memory is basically incompatible with secure boot, although: a) Certain firmware may allow optionally registering the hash of any image which does not load, which would still work. b) It is fairly crazy anyway to want to apply secure boot to the old, insecure .efi files which need these fixups.
[out] | Context | The context describing the Image. |
[in] | FileBuffer | The file data to parse as PE Image. |
[in] | FileSize | The size, in Bytes, of FileBuffer. |
[in] | InMemoryFixup | If TRUE, fixes are made to image in memory. If FALSE, Context is initialised as if fixes were made, but no changes are made to loaded image. |
RETURN_SUCCESS | The Image context has been initialised successfully. |
other | The file data is malformed. |
Definition at line 739 of file OcPeCoffFixupInit.c.
EFI_STATUS PeCoffGetApfsDriverVersion | ( | IN VOID * | DriverBuffer, |
IN UINT32 | DriverSize, | ||
OUT APFS_DRIVER_VERSION ** | DriverVersionPtr ) |
Obtain APFS driver version.
[in] | DriverBuffer | Image buffer. |
[in] | DriverSize | Size of the image. |
[out] | DriverVersionPtr | Driver version within image buffer. |
EFI_SUCCESS | on success. |
Definition at line 553 of file OcPeCoffExtLib.c.
EFI_STATUS PeCoffVerifyAppleSignature | ( | IN OUT VOID * | PeImage, |
IN OUT UINT32 * | ImageSize ) |
Verify Apple COFF legacy signature. Image buffer is sanitized where necessary (zeroed), and an updated length is returned through size parameter.
[in,out] | PeImage | Image buffer. |
[in,out] | ImageSize | Size of the image. |
EFI_SUCCESS | on success. |
Definition at line 458 of file OcPeCoffExtLib.c.