OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Functions | |
INT64 | GetCurrentTimestamp (VOID) |
BOOLEAN | AsciiFileSystemPathIsLegal (IN CONST CHAR8 *Path) |
BOOLEAN | AsciiCommentIsLegal (IN CONST CHAR8 *Comment) |
BOOLEAN | AsciiIdentifierIsLegal (IN CONST CHAR8 *Identifier, IN BOOLEAN IsKernelIdentifier) |
BOOLEAN | AsciiArchIsLegal (IN CONST CHAR8 *Arch, IN BOOLEAN IsKernelArch) |
BOOLEAN | AsciiPropertyIsLegal (IN CONST CHAR8 *Property) |
BOOLEAN | AsciiUefiDriverIsLegal (IN CONST CHAR8 *Driver, IN CONST UINTN DriverIndex) |
BOOLEAN | AsciiDevicePathIsLegal (IN CONST CHAR8 *AsciiDevicePath) |
BOOLEAN | AsciiGuidIsLegal (IN CONST CHAR8 *AsciiGuid) |
BOOLEAN | DataHasProperMasking (IN CONST VOID *Data, IN CONST VOID *Mask, IN UINTN DataSize, IN UINTN MaskSize) |
UINT32 | ValidatePatch (IN CONST CHAR8 *PatchSection, IN UINT32 PatchIndex, IN BOOLEAN FindSizeCanBeZero, IN CONST UINT8 *Find, IN UINT32 FindSize, IN CONST UINT8 *Replace, IN UINT32 ReplaceSize, IN CONST UINT8 *Mask, IN UINT32 MaskSize, IN CONST UINT8 *ReplaceMask, IN UINT32 ReplaceMaskSize) |
UINT32 | FindArrayDuplication (IN VOID *First, IN UINTN Number, IN UINTN Size, IN DUPLICATION_CHECK DupChecker) |
BOOLEAN | StringIsDuplicated (IN CONST CHAR8 *EntrySection, IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString) |
UINT32 | ReportError (IN CONST CHAR8 *FuncName, IN UINT32 ErrorCount) |
Copyright (C) 2018, vit9696. All rights reserved. Copyright (C) 2020, PMheart. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcValidateLib.c.
BOOLEAN AsciiArchIsLegal | ( | IN CONST CHAR8 * | Arch, |
IN BOOLEAN | IsKernelArch ) |
Check if an OpenCore Configuration Arch matches specific conventions.
[in] | Arch | Arch to be checked. |
[in] | IsKernelArch | TRUE to perform special checks for Kernel->Scheme->KernelArch. |
TRUE | If Arch matches conventions. |
Definition at line 160 of file OcValidateLib.c.
BOOLEAN AsciiCommentIsLegal | ( | IN CONST CHAR8 * | Comment | ) |
Check if an OpenCore Configuration Comment contains only ASCII printable characters.
[in] | Comment | Comment to be checked. |
TRUE | If Comment only contains ASCII printable characters. |
Definition at line 71 of file OcValidateLib.c.
BOOLEAN AsciiDevicePathIsLegal | ( | IN CONST CHAR8 * | AsciiDevicePath | ) |
Check if a device path in ASCII is valid.
[in] | AsciiDevicePath | Device path to be checked. |
TRUE | If AsciiDevicePath is valid. |
Definition at line 260 of file OcValidateLib.c.
BOOLEAN AsciiFileSystemPathIsLegal | ( | IN CONST CHAR8 * | Path | ) |
Check if a filesystem path contains only legal characters.
[in] | Path | Filesystem path to be checked. |
TRUE | If Path only contains 0-9, A-Z, a-z, '_', '-', '.', '/', and '\'. |
Definition at line 37 of file OcValidateLib.c.
BOOLEAN AsciiGuidIsLegal | ( | IN CONST CHAR8 * | AsciiGuid | ) |
Check if a GUID in ASCII is valid.
[in] | AsciiGuid | GUID in ASCII format to be checked. |
TRUE | If AsciiGuid has valid GUID format. |
Definition at line 316 of file OcValidateLib.c.
BOOLEAN AsciiIdentifierIsLegal | ( | IN CONST CHAR8 * | Identifier, |
IN BOOLEAN | IsKernelIdentifier ) |
Check if an OpenCore Configuration Identifier matches specific conventions.
[in] | Identifier | Identifier to be checked. |
[in] | IsKernelPatchIdentifier | TRUE to perform special checks for Kernel->Patch->Identifier. |
TRUE | If Identifier matches conventions. |
Definition at line 93 of file OcValidateLib.c.
BOOLEAN AsciiPropertyIsLegal | ( | IN CONST CHAR8 * | Property | ) |
Check if an OpenCore Configuration Property contains only ASCII printable characters. This is mainly used in Device Properties and NVRAM Properties.
[in] | Property | Property to be checked. |
TRUE | If Property only contains ASCII printable characters. |
Definition at line 200 of file OcValidateLib.c.
BOOLEAN AsciiUefiDriverIsLegal | ( | IN CONST CHAR8 * | Driver, |
IN CONST UINTN | DriverIndex ) |
Check if a UEFI Driver matches specific conventions.
[in] | Driver | Driver path name to be checked. |
[in] | DriverIndex | Index of driver being checked. |
TRUE | If path of Driver contains .efi suffix, and only contains 0-9, A-Z, a-z, '_', '-', '.', and '/'. |
Definition at line 212 of file OcValidateLib.c.
BOOLEAN DataHasProperMasking | ( | IN CONST VOID * | Data, |
IN CONST VOID * | Mask, | ||
IN UINTN | DataSize, | ||
IN UINTN | MaskSize ) |
Check if a set of data has proper masking set.
This function assumes identical sizes of Data and Mask, which must be ensured before calling.
[in] | Data | Data to be checked. |
[in] | Mask | Mask to be applied to Data. |
[in] | DataSize | Size of Data. |
[in] | MaskSize | Size of Mask. |
TRUE | If corresponding bits of Mask to Data are active (set to non-zero). |
Definition at line 332 of file OcValidateLib.c.
UINT32 FindArrayDuplication | ( | IN VOID * | First, |
IN UINTN | Number, | ||
IN UINTN | Size, | ||
IN DUPLICATION_CHECK | DupChecker ) |
Check if one array has duplicated entries.
[in] | First | Pointer to the first object of the array to be checked, converted to a VOID*. |
[in] | Number | Number of elements in the array pointed to by First. |
[in] | Size | Size in bytes of each element in the array. |
[in] | DupChecker | Pointer to a comparator function which returns TRUE if duplication is found. See DUPLICATION_CHECK for function prototype. |
Definition at line 456 of file OcValidateLib.c.
INT64 GetCurrentTimestamp | ( | VOID | ) |
Get current timestamp in milliseconds.
Definition at line 20 of file OcValidateLib.c.
UINT32 ReportError | ( | IN CONST CHAR8 * | FuncName, |
IN UINT32 | ErrorCount ) |
Report status of errors in the end of each checker function.
[in] | FuncName | Checker function name. (func in most cases) |
[in] | ErrorCount | Number of errors to be returned. |
Definition at line 511 of file OcValidateLib.c.
BOOLEAN StringIsDuplicated | ( | IN CONST CHAR8 * | EntrySection, |
IN CONST CHAR8 * | FirstString, | ||
IN CONST CHAR8 * | SecondString ) |
Check if two strings are duplicated to each other. Used as a wrapper of AsciiStrCmp to print duplicated entries.
[in] | EntrySection | Section of strings to which they belong throughout OpenCore Configuration. |
[in] | FirstString | Primary entry in string format. |
[in] | SecondString | Secondary entry in string format. |
TRUE | If FirstString and SecondString are duplicated. |
Definition at line 493 of file OcValidateLib.c.
UINT32 ValidatePatch | ( | IN CONST CHAR8 * | PatchSection, |
IN UINT32 | PatchIndex, | ||
IN BOOLEAN | FindSizeCanBeZero, | ||
IN CONST UINT8 * | Find, | ||
IN UINT32 | FindSize, | ||
IN CONST UINT8 * | Replace, | ||
IN UINT32 | ReplaceSize, | ||
IN CONST UINT8 * | Mask, | ||
IN UINT32 | MaskSize, | ||
IN CONST UINT8 * | ReplaceMask, | ||
IN UINT32 | ReplaceMaskSize ) |
Check if an OpenCore binary patch is valid.
If size of Find cannot be zero and it is different from that of Replace, then error. If Mask/ReplaceMask is set, but its size is different from that of Find/Replace, then error. If Mask/ReplaceMask is set without corresponding bits being active for Find/Replace, then error.
[in] | PatchSection | Patch section to which the patch to be checked belongs. |
[in] | PatchIndex | Index of the patch to be checked. |
[in] | FindSizeCanBeZero | Whether size of Find can be zero. This should be set to TRUE only when Kernel->Patch->Base is used and Find is empty. |
[in] | Find | Find pattern to be checked. |
[in] | FindSize | Size of Find pattern above. |
[in] | Replace | Replace pattern to be checked. |
[in] | ReplaceSize | Size of Replace pattern above. |
[in] | Mask | Mask pattern to be checked. |
[in] | MaskSize | Size of Mask pattern above. |
[in] | ReplaceMask | ReplaceMask pattern to be checked. |
[in] | ReplaceMaskSize | Size of ReplaceMask pattern above. |
Definition at line 363 of file OcValidateLib.c.