OpenCore
1.0.4
OpenCore Bootloader
|
#include <Base.h>
#include <IndustryStandard/AppleKmodInfo.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/OcAppleKernelLib.h>
#include <Library/OcMachoLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcXmlLib.h>
#include "MkextInternal.h"
#include "PrelinkedInternal.h"
Go to the source code of this file.
Functions | |
STATIC BOOLEAN | GetTextBaseOffset (IN OC_MACHO_CONTEXT *ExecutableContext, OUT UINT64 *Address, OUT UINT64 *Offset) |
EFI_STATUS | PatcherInitContextFromPrelinked (IN OUT PATCHER_CONTEXT *Context, IN OUT PRELINKED_CONTEXT *Prelinked, IN CONST CHAR8 *Name) |
EFI_STATUS | PatcherInitContextFromMkext (IN OUT PATCHER_CONTEXT *Context, IN OUT MKEXT_CONTEXT *Mkext, IN CONST CHAR8 *Name) |
EFI_STATUS | PatcherInitContextFromBuffer (IN OUT PATCHER_CONTEXT *Context, IN OUT UINT8 *Buffer, IN UINT32 BufferSize, IN BOOLEAN Is32Bit) |
EFI_STATUS | PatcherGetSymbolAddress (IN OUT PATCHER_CONTEXT *Context, IN CONST CHAR8 *Name, IN OUT UINT8 **Address) |
EFI_STATUS | PatcherGetSymbolValue (IN OUT PATCHER_CONTEXT *Context, IN CONST CHAR8 *Name, IN OUT UINT64 *Value) |
EFI_STATUS | PatcherGetSymbolAddressValue (IN OUT PATCHER_CONTEXT *Context, IN CONST CHAR8 *Name, IN OUT UINT8 **Address, IN OUT UINT64 *Value) |
EFI_STATUS | PatcherApplyGenericPatch (IN OUT PATCHER_CONTEXT *Context, IN PATCHER_GENERIC_PATCH *Patch) |
EFI_STATUS | PatcherExcludePrelinkedKext (IN CONST CHAR8 *Identifier, IN OUT PATCHER_CONTEXT *PatcherContext, IN OUT PRELINKED_CONTEXT *PrelinkedContext) |
EFI_STATUS | PatcherExcludeMkextKext (IN OUT MKEXT_CONTEXT *MkextContext, IN CONST CHAR8 *Identifier) |
EFI_STATUS | PatcherBlockKext (IN OUT PATCHER_CONTEXT *Context) |
BOOLEAN | KextFindKmodAddress (IN OC_MACHO_CONTEXT *ExecutableContext, IN UINT64 LoadAddress, IN UINT32 Size, OUT UINT64 *Kmod) |
Copyright (C) 2019, vit9696. 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 KextPatcher.c.
STATIC BOOLEAN GetTextBaseOffset | ( | IN OC_MACHO_CONTEXT * | ExecutableContext, |
OUT UINT64 * | Address, | ||
OUT UINT64 * | Offset ) |
Definition at line 32 of file KextPatcher.c.
BOOLEAN KextFindKmodAddress | ( | IN OC_MACHO_CONTEXT * | ExecutableContext, |
IN UINT64 | LoadAddress, | ||
IN UINT32 | Size, | ||
OUT UINT64 * | Kmod ) |
Find kmod address.
[in] | ExecutableContext | Mach-O context. |
[in] | LoadAddress | Load address. |
[in] | Size | Executable size. |
[out] | Kmod | Pointer to kmod. |
Definition at line 790 of file KextPatcher.c.
EFI_STATUS PatcherApplyGenericPatch | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN PATCHER_GENERIC_PATCH * | Patch ) |
Apply generic patch.
[in,out] | Context | Patcher context. |
[in] | Patch | Patch description. |
Definition at line 310 of file KextPatcher.c.
EFI_STATUS PatcherBlockKext | ( | IN OUT PATCHER_CONTEXT * | Context | ) |
Block kext from loading.
[in,out] | Context | Patcher context. |
Definition at line 712 of file KextPatcher.c.
EFI_STATUS PatcherExcludeMkextKext | ( | IN OUT MKEXT_CONTEXT * | MkextContext, |
IN CONST CHAR8 * | Identifier ) |
Exclude kext from mkext.
[in,out] | MkextContext | Mkext context. |
[in] | Identifier | Kext identifier to be excluded. |
Definition at line 546 of file KextPatcher.c.
EFI_STATUS PatcherExcludePrelinkedKext | ( | IN CONST CHAR8 * | Identifier, |
IN OUT PATCHER_CONTEXT * | PatcherContext, | ||
IN OUT PRELINKED_CONTEXT * | PrelinkedContext ) |
Exclude kext from prelinked.
[in] | Identifier | Kext identifier to be excluded. |
[in,out] | PatcherContext | Patcher context. |
[in,out] | PrelinkedContext | Prelinked context. |
Definition at line 396 of file KextPatcher.c.
EFI_STATUS PatcherGetSymbolAddress | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN CONST CHAR8 * | Name, | ||
IN OUT UINT8 ** | Address ) |
Get local symbol address.
[in,out] | Context | Patcher context. |
[in] | Name | Symbol name. |
[in,out] | Address | Returned symbol address in file. |
Definition at line 214 of file KextPatcher.c.
EFI_STATUS PatcherGetSymbolAddressValue | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN CONST CHAR8 * | Name, | ||
IN OUT UINT8 ** | Address, | ||
IN OUT UINT64 * | Value ) |
Get local symbol address and symbol value.
[in,out] | Context | Patcher context. |
[in] | Name | Symbol name. |
[in,out] | Address | Returned symbol address in file. |
[in,out] | Value | Returned original symbol value. |
Definition at line 234 of file KextPatcher.c.
EFI_STATUS PatcherGetSymbolValue | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN CONST CHAR8 * | Name, | ||
IN OUT UINT64 * | Value ) |
Get local symbol value.
[in,out] | Context | Patcher context. |
[in] | Name | Symbol name. |
[in,out] | Value | Returned original symbol value. |
Definition at line 224 of file KextPatcher.c.
EFI_STATUS PatcherInitContextFromBuffer | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN OUT UINT8 * | Buffer, | ||
IN UINT32 | BufferSize, | ||
IN BOOLEAN | Use32Bit ) |
Initialize patcher from buffer for e.g. kernel patching.
[in,out] | Context | Patcher context. |
[in,out] | Buffer | Kernel buffer (could be prelinked). |
[in] | BufferSize | Kernel buffer size. |
[in] | Is32Bit | TRUE to use 32-bit. |
Definition at line 134 of file KextPatcher.c.
EFI_STATUS PatcherInitContextFromMkext | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN OUT MKEXT_CONTEXT * | Mkext, | ||
IN CONST CHAR8 * | Name ) |
Initialize patcher from mkext context for kext patching.
[in,out] | Context | Patcher context. |
[in,out] | Mkext | Mkext context. |
[in] | Name | Kext bundle identifier. |
Definition at line 117 of file KextPatcher.c.
EFI_STATUS PatcherInitContextFromPrelinked | ( | IN OUT PATCHER_CONTEXT * | Context, |
IN OUT PRELINKED_CONTEXT * | Prelinked, | ||
IN CONST CHAR8 * | Name ) |
Initialize patcher from prelinked context for kext patching.
[in,out] | Context | Patcher context. |
[in,out] | Prelinked | Prelinked context. |
[in] | Name | Kext bundle identifier. |
Definition at line 99 of file KextPatcher.c.