OpenCore
1.0.4
OpenCore Bootloader
|
#include <IndustryStandard/AppleMachoImage.h>
Go to the source code of this file.
Data Structures | |
struct | OC_MACHO_CONTEXT |
Macros | |
#define | MACHO_PAGE_SIZE 4096U |
#define | MACHO_ALIGN(x) |
Functions | |
BOOLEAN | MachoInitializeContext32 (OUT OC_MACHO_CONTEXT *Context, IN VOID *FileData, IN UINT32 FileSize, IN UINT32 HeaderOffset, IN UINT32 InnerSize) |
BOOLEAN | MachoInitializeContext64 (OUT OC_MACHO_CONTEXT *Context, IN VOID *FileData, IN UINT32 FileSize, IN UINT32 HeaderOffset, IN UINT32 InnerSize) |
BOOLEAN | MachoInitializeContext (OUT OC_MACHO_CONTEXT *Context, IN VOID *FileData, IN UINT32 FileSize, IN UINT32 HeaderOffset, IN UINT32 InnerSize, IN BOOLEAN Is32Bit) |
MACH_HEADER_ANY * | MachoGetMachHeader (IN OUT OC_MACHO_CONTEXT *Context) |
UINT32 | MachoGetInnerSize (IN OUT OC_MACHO_CONTEXT *Context) |
MACH_HEADER * | MachoGetMachHeader32 (IN OUT OC_MACHO_CONTEXT *Context) |
MACH_HEADER_64 * | MachoGetMachHeader64 (IN OUT OC_MACHO_CONTEXT *Context) |
VOID * | MachoGetFileData (IN OUT OC_MACHO_CONTEXT *Context) |
UINT32 | MachoGetFileSize (IN OUT OC_MACHO_CONTEXT *Context) |
UINT32 | MachoGetVmSize (IN OUT OC_MACHO_CONTEXT *Context) |
UINT64 | MachoGetLastAddress (IN OUT OC_MACHO_CONTEXT *Context) |
MACH_UUID_COMMAND * | MachoGetUuid (IN OUT OC_MACHO_CONTEXT *Context) |
MACH_SEGMENT_COMMAND_ANY * | MachoGetSegmentByName (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SegmentName) |
MACH_SEGMENT_COMMAND * | MachoGetSegmentByName32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SegmentName) |
MACH_SEGMENT_COMMAND_64 * | MachoGetSegmentByName64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SegmentName) |
MACH_SECTION_ANY * | MachoGetSectionByName (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_SEGMENT_COMMAND_ANY *Segment, IN CONST CHAR8 *SectionName) |
MACH_SECTION * | MachoGetSectionByName32 (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_SEGMENT_COMMAND *Segment, IN CONST CHAR8 *SectionName) |
MACH_SECTION_64 * | MachoGetSectionByName64 (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_SEGMENT_COMMAND_64 *Segment, IN CONST CHAR8 *SectionName) |
MACH_SECTION_ANY * | MachoGetSegmentSectionByName (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SegmentName, IN CONST CHAR8 *SectionName) |
MACH_SECTION * | MachoGetSegmentSectionByName32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SegmentName, IN CONST CHAR8 *SectionName) |
MACH_SECTION_64 * | MachoGetSegmentSectionByName64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SegmentName, IN CONST CHAR8 *SectionName) |
MACH_SEGMENT_COMMAND_ANY * | MachoGetNextSegment (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_SEGMENT_COMMAND_ANY *Segment OPTIONAL) |
MACH_SEGMENT_COMMAND * | MachoGetNextSegment32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_SEGMENT_COMMAND *Segment OPTIONAL) |
MACH_SEGMENT_COMMAND_64 * | MachoGetNextSegment64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_SEGMENT_COMMAND_64 *Segment OPTIONAL) |
MACH_SECTION_ANY * | MachoGetNextSection (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_SEGMENT_COMMAND_ANY *Segment, IN MACH_SECTION_ANY *Section OPTIONAL) |
MACH_SECTION * | MachoGetNextSection32 (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_SEGMENT_COMMAND *Segment, IN MACH_SECTION *Section OPTIONAL) |
MACH_SECTION_64 * | MachoGetNextSection64 (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_SEGMENT_COMMAND_64 *Segment, IN MACH_SECTION_64 *Section OPTIONAL) |
MACH_SECTION_ANY * | MachoGetSectionByIndex (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Index) |
MACH_SECTION * | MachoGetSectionByIndex32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Index) |
MACH_SECTION_64 * | MachoGetSectionByIndex64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Index) |
MACH_SECTION * | MachoGetSectionByAddress32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Address) |
MACH_SECTION_64 * | MachoGetSectionByAddress64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address) |
BOOLEAN | MachoMergeSegments (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *Prefix) |
BOOLEAN | MachoSymbolIsSection32 (IN CONST MACH_NLIST *Symbol) |
BOOLEAN | MachoSymbolIsSection64 (IN CONST MACH_NLIST_64 *Symbol) |
BOOLEAN | MachoSymbolIsDefined (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Symbol) |
BOOLEAN | MachoSymbolIsDefined32 (IN CONST MACH_NLIST *Symbol) |
BOOLEAN | MachoSymbolIsDefined64 (IN CONST MACH_NLIST_64 *Symbol) |
BOOLEAN | MachoSymbolIsLocalDefined (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Symbol) |
BOOLEAN | MachoSymbolIsLocalDefined32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Symbol) |
BOOLEAN | MachoSymbolIsLocalDefined64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Symbol) |
MACH_NLIST_ANY * | MachoGetLocalDefinedSymbolByName (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *Name) |
MACH_NLIST * | MachoGetLocalDefinedSymbolByName32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *Name) |
MACH_NLIST_64 * | MachoGetLocalDefinedSymbolByName64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *Name) |
MACH_NLIST_ANY * | MachoGetSymbolByIndex (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Index) |
MACH_NLIST * | MachoGetSymbolByIndex32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Index) |
MACH_NLIST_64 * | MachoGetSymbolByIndex64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Index) |
CONST CHAR8 * | MachoGetSymbolName (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Symbol) |
CONST CHAR8 * | MachoGetSymbolName32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Symbol) |
CONST CHAR8 * | MachoGetSymbolName64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Symbol) |
CONST CHAR8 * | MachoGetIndirectSymbolName (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Symbol) |
CONST CHAR8 * | MachoGetIndirectSymbolName32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Symbol) |
CONST CHAR8 * | MachoGetIndirectSymbolName64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Symbol) |
BOOLEAN | MachoIsSymbolValueInRange (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Symbol) |
BOOLEAN | MachoIsSymbolValueInRange32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Symbol) |
BOOLEAN | MachoIsSymbolValueInRange64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Symbol) |
BOOLEAN | MachoGetSymbolByRelocationOffset32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Address, OUT MACH_NLIST **Symbol) |
BOOLEAN | MachoGetSymbolByRelocationOffset64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT MACH_NLIST_64 **Symbol) |
BOOLEAN | MachoGetSymbolByExternRelocationOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT MACH_NLIST_ANY **Symbol) |
BOOLEAN | MachoGetSymbolByExternRelocationOffset32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Address, OUT MACH_NLIST **Symbol) |
BOOLEAN | MachoGetSymbolByExternRelocationOffset64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT MACH_NLIST_64 **Symbol) |
BOOLEAN | MachoRelocateSymbol (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 LinkAddress, IN OUT MACH_NLIST_ANY *Symbol) |
BOOLEAN | MachoRelocateSymbol32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 LinkAddress, IN OUT MACH_NLIST *Symbol) |
BOOLEAN | MachoRelocateSymbol64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 LinkAddress, IN OUT MACH_NLIST_64 *Symbol) |
BOOLEAN | MachoSymbolGetFileOffset32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Symbol, OUT UINT32 *FileOffset, OUT UINT32 *MaxSize OPTIONAL) |
BOOLEAN | MachoSymbolGetFileOffset64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Symbol, OUT UINT32 *FileOffset, OUT UINT32 *MaxSize OPTIONAL) |
BOOLEAN | MachoSymbolGetFileOffset (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Symbol, OUT UINT32 *FileOffset, OUT UINT32 *MaxSize OPTIONAL) |
BOOLEAN | MachoSymbolGetDirectFileOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT UINT32 *FileOffset, OUT UINT32 *MaxSize OPTIONAL) |
BOOLEAN | MachoSymbolNameIsPureVirtual (IN CONST CHAR8 *Name) |
BOOLEAN | MachoSymbolNameIsPadslot (IN CONST CHAR8 *Name) |
BOOLEAN | MachoSymbolNameIsSmcp (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SymbolName) |
BOOLEAN | MachoSymbolNameIsMetaclassPointer (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SymbolName) |
BOOLEAN | MachoGetClassNameFromSuperMetaClassPointer (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SmcpName, IN UINTN ClassNameSize, OUT CHAR8 *ClassName) |
CONST CHAR8 * | MachoGetClassNameFromVtableName (IN CONST CHAR8 *VtableName) |
BOOLEAN | MachoGetFunctionPrefixFromClassName (IN CONST CHAR8 *ClassName, IN UINTN FunctionPrefixSize, OUT CHAR8 *FunctionPrefix) |
BOOLEAN | MachoGetClassNameFromMetaClassPointer (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *MetaClassName, IN UINTN ClassNameSize, OUT CHAR8 *ClassName) |
BOOLEAN | MachoGetVtableNameFromClassName (IN CONST CHAR8 *ClassName, IN UINTN VtableNameSize, OUT CHAR8 *VtableName) |
BOOLEAN | MachoGetMetaVtableNameFromClassName (IN CONST CHAR8 *ClassName, IN UINTN VtableNameSize, OUT CHAR8 *VtableName) |
BOOLEAN | MachoGetFinalSymbolNameFromClassName (IN CONST CHAR8 *ClassName, IN UINTN FinalSymbolNameSize, OUT CHAR8 *FinalSymbolName) |
BOOLEAN | MachoSymbolNameIsVtable (IN CONST CHAR8 *SymbolName) |
BOOLEAN | MachoSymbolNameIsCxx (IN CONST CHAR8 *Name) |
MACH_NLIST_ANY * | MachoGetMetaclassSymbolFromSmcpSymbol (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_ANY *Smcp) |
MACH_NLIST * | MachoGetMetaclassSymbolFromSmcpSymbol32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Smcp) |
MACH_NLIST_64 * | MachoGetMetaclassSymbolFromSmcpSymbol64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Smcp) |
BOOLEAN | MachoGetVtableSymbolsFromSmcp (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SmcpName, OUT CONST MACH_NLIST_ANY **Vtable, OUT CONST MACH_NLIST_ANY **MetaVtable) |
BOOLEAN | MachoGetVtableSymbolsFromSmcp32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SmcpName, OUT CONST MACH_NLIST **Vtable, OUT CONST MACH_NLIST **MetaVtable) |
BOOLEAN | MachoGetVtableSymbolsFromSmcp64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *SmcpName, OUT CONST MACH_NLIST_64 **Vtable, OUT CONST MACH_NLIST_64 **MetaVtable) |
BOOLEAN | MachoRelocationIsPairIntel32 (IN UINT8 Type) |
BOOLEAN | MachoRelocationIsPairIntel64 (IN UINT8 Type) |
BOOLEAN | MachoIsRelocationPairTypeIntel64 (IN UINT8 Type) |
BOOLEAN | MachoPreserveRelocationIntel64 (IN UINT8 Type) |
BOOLEAN | MachoInitialiseSymtabsExternal (IN OUT OC_MACHO_CONTEXT *Context, IN OC_MACHO_CONTEXT *SymsContext) |
UINT32 | MachoGetSymbolTable (IN OUT OC_MACHO_CONTEXT *Context, OUT CONST MACH_NLIST_ANY **SymbolTable, OUT CONST CHAR8 **StringTable OPTIONAL, OUT CONST MACH_NLIST_ANY **LocalSymbols OPTIONAL, OUT UINT32 *NumLocalSymbols OPTIONAL, OUT CONST MACH_NLIST_ANY **ExternalSymbols OPTIONAL, OUT UINT32 *NumExternalSymbols OPTIONAL, OUT CONST MACH_NLIST_ANY **UndefinedSymbols OPTIONAL, OUT UINT32 *NumUndefinedSymbols OPTIONAL) |
UINT32 | MachoGetSymbolTable32 (IN OUT OC_MACHO_CONTEXT *Context, OUT CONST MACH_NLIST **SymbolTable, OUT CONST CHAR8 **StringTable OPTIONAL, OUT CONST MACH_NLIST **LocalSymbols OPTIONAL, OUT UINT32 *NumLocalSymbols OPTIONAL, OUT CONST MACH_NLIST **ExternalSymbols OPTIONAL, OUT UINT32 *NumExternalSymbols OPTIONAL, OUT CONST MACH_NLIST **UndefinedSymbols OPTIONAL, OUT UINT32 *NumUndefinedSymbols OPTIONAL) |
UINT32 | MachoGetSymbolTable64 (IN OUT OC_MACHO_CONTEXT *Context, OUT CONST MACH_NLIST_64 **SymbolTable, OUT CONST CHAR8 **StringTable OPTIONAL, OUT CONST MACH_NLIST_64 **LocalSymbols OPTIONAL, OUT UINT32 *NumLocalSymbols OPTIONAL, OUT CONST MACH_NLIST_64 **ExternalSymbols OPTIONAL, OUT UINT32 *NumExternalSymbols OPTIONAL, OUT CONST MACH_NLIST_64 **UndefinedSymbols OPTIONAL, OUT UINT32 *NumUndefinedSymbols OPTIONAL) |
UINT32 | MachoGetIndirectSymbolTable (IN OUT OC_MACHO_CONTEXT *Context, OUT CONST MACH_NLIST_ANY **SymbolTable) |
UINT32 | MachoGetIndirectSymbolTable32 (IN OUT OC_MACHO_CONTEXT *Context, OUT CONST MACH_NLIST **SymbolTable) |
UINT32 | MachoGetIndirectSymbolTable64 (IN OUT OC_MACHO_CONTEXT *Context, OUT CONST MACH_NLIST_64 **SymbolTable) |
VOID * | MachoGetFilePointerByAddress (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT UINT32 *MaxSize OPTIONAL) |
UINT32 | MachoExpandImage (IN OC_MACHO_CONTEXT *Context, OUT UINT8 *Destination, IN UINT32 DestinationSize, IN BOOLEAN Strip, OUT UINT64 *FileOffset OPTIONAL) |
UINT32 | MachoGetExpandedImageSize (IN OC_MACHO_CONTEXT *Context) |
UINT64 | MachoRuntimeGetEntryAddress (IN VOID *Image) |
MACH_LOAD_COMMAND * | MachoGetNextCommand (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_LOAD_COMMAND_TYPE LoadCommandType, IN CONST MACH_LOAD_COMMAND *LoadCommand OPTIONAL) |
EFI_STATUS | FatGetArchitectureOffset (IN CONST UINT8 *Buffer, IN UINT32 BufferSize, IN UINT32 FullSize, IN MACH_CPU_TYPE CpuType, OUT UINT32 *FatOffset, OUT UINT32 *FatSize) |
EFI_STATUS | FatFilterArchitectureByType (IN OUT UINT8 **FileData, IN OUT UINT32 *FileSize, IN MACH_CPU_TYPE CpuType) |
EFI_STATUS | FatFilterArchitecture32 (IN OUT UINT8 **FileData, IN OUT UINT32 *FileSize) |
EFI_STATUS | FatFilterArchitecture64 (IN OUT UINT8 **FileData, IN OUT UINT32 *FileSize) |
Provides Mach-O parsing helper functions.
Copyright (c) 2016 - 2018, Download-Fritz. 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 OcMachoLib.h.
#define MACHO_ALIGN | ( | x | ) |
Macro to align by default assumed page size.
Definition at line 28 of file OcMachoLib.h.
#define MACHO_PAGE_SIZE 4096U |
Default assumed page size.
Definition at line 23 of file OcMachoLib.h.
EFI_STATUS FatFilterArchitecture32 | ( | IN OUT UINT8 ** | FileData, |
IN OUT UINT32 * | FileSize ) |
Moves file pointer and size to point to x86 slice in case FAT Mach-O is used.
[in,out] | FileData | Pointer to pointer of the file's data. |
[in,out] | FileSize | Pointer to file size of FileData. |
Definition at line 142 of file MachoFat.c.
EFI_STATUS FatFilterArchitecture64 | ( | IN OUT UINT8 ** | FileData, |
IN OUT UINT32 * | FileSize ) |
Moves file pointer and size to point to x86_64 slice in case FAT Mach-O is used.
[in,out] | FileData | Pointer to pointer of the file's data. |
[in,out] | FileSize | Pointer to file size of FileData. |
Definition at line 151 of file MachoFat.c.
EFI_STATUS FatFilterArchitectureByType | ( | IN OUT UINT8 ** | FileData, |
IN OUT UINT32 * | FileSize, | ||
IN MACH_CPU_TYPE | CpuType ) |
Moves file pointer and size to point to specified slice in case FAT Mach-O is used.
[in,out] | FileData | Pointer to pointer of the file's data. |
[in,out] | FileSize | Pointer to file size of FileData. |
[in] | CpuType | Desired CPU slice to use. |
Definition at line 116 of file MachoFat.c.
EFI_STATUS FatGetArchitectureOffset | ( | IN CONST UINT8 * | Buffer, |
IN UINT32 | BufferSize, | ||
IN UINT32 | FullSize, | ||
IN MACH_CPU_TYPE | CpuType, | ||
OUT UINT32 * | FatOffset, | ||
OUT UINT32 * | FatSize ) |
Returns offset and size of specified slice in case FAT Mach-O is used. If no FAT is detected, FatOffset and FatSize are set to 0 and FullSize respectively.
[in] | Buffer | Pointer to the buffer data. |
[in] | BufferSize | Size of Buffer. |
[in] | FullSize | Full file size, used to validate sizes within FAT structure. |
[in] | CpuType | Desired CPU slice to use. |
[out] | FatOffset | Pointer to offset of FAT slice. |
[out] | FatSize | Pointer to size of FAT slice. |
Definition at line 27 of file MachoFat.c.
UINT32 MachoExpandImage | ( | IN OC_MACHO_CONTEXT * | Context, |
OUT UINT8 * | Destination, | ||
IN UINT32 | DestinationSize, | ||
IN BOOLEAN | Strip, | ||
OUT UINT64 *FileOffset | OPTIONAL ) |
Expand Mach-O image to Destination (make segment file sizes equal to vm sizes).
[in] | Context | Context of the Mach-O. |
[out] | Destination | Output buffer. |
[in] | DestinationSize | Output buffer maximum size. |
[in] | Strip | Output with stripped prelink commands. |
[in] | FileOffset | Pointer to the file offset of the first segment. |
BOOLEAN MachoGetClassNameFromMetaClassPointer | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | MetaClassName, | ||
IN UINTN | ClassNameSize, | ||
OUT CHAR8 * | ClassName ) |
Retrieves the class name of a Meta Class Pointer.
[in,out] | Context | Context of the Mach-O. |
[in] | MetaClassName | MCP Symbol name to get the class name of. |
[in] | ClassNameSize | The size of ClassName. |
[out] | ClassName | The output buffer for the class name. |
Definition at line 204 of file CxxSymbols.c.
BOOLEAN MachoGetClassNameFromSuperMetaClassPointer | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SmcpName, | ||
IN UINTN | ClassNameSize, | ||
OUT CHAR8 * | ClassName ) |
Retrieves the class name of a Super Meta Class Pointer.
[in,out] | Context | Context of the Mach-O. |
[in] | SmcpName | SMCP Symbol name to get the class name of. |
[in] | ClassNameSize | The size of ClassName. |
[out] | ClassName | The output buffer for the class name. |
Definition at line 116 of file CxxSymbols.c.
CONST CHAR8 * MachoGetClassNameFromVtableName | ( | IN CONST CHAR8 * | VtableName | ) |
Retrieves the class name of a VTable.
[out] | VtableName | The VTable's name. |
Definition at line 152 of file CxxSymbols.c.
UINT32 MachoGetExpandedImageSize | ( | IN OC_MACHO_CONTEXT * | Context | ) |
Calculates size required for expanded Mach-O image using MachoExpandImage().
[in] | Context | Context of the Mach-O. |
VOID * MachoGetFileData | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
VOID * MachoGetFilePointerByAddress | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | Address, | ||
OUT UINT32 *MaxSize | OPTIONAL ) |
Returns a pointer to the Mach-O file at the specified virtual address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Virtual address to look up. |
[out] | MaxSize | Maximum data safely available from FileOffset. If NULL is returned, the output is undefined. |
UINT32 MachoGetFileSize | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
BOOLEAN MachoGetFinalSymbolNameFromClassName | ( | IN CONST CHAR8 * | ClassName, |
IN UINTN | FinalSymbolNameSize, | ||
OUT CHAR8 * | FinalSymbolName ) |
Retrieves the final symbol name of a class name.
[in] | ClassName | Class name to get the final symbol name of. |
[in] | FinalSymbolNameSize | The size of FinalSymbolName. |
[out] | FinalSymbolName | The output buffer for the final symbol name. |
Definition at line 327 of file CxxSymbols.c.
BOOLEAN MachoGetFunctionPrefixFromClassName | ( | IN CONST CHAR8 * | ClassName, |
IN UINTN | FunctionPrefixSize, | ||
OUT CHAR8 * | FunctionPrefix ) |
Retrieves the function prefix of a class name.
[in] | ClassName | The class name to evaluate. |
[in] | FunctionPrefixSize | The size of FunctionPrefix. |
[out] | FunctionPrefix | The output buffer for the function prefix. |
Definition at line 165 of file CxxSymbols.c.
CONST CHAR8 * MachoGetIndirectSymbolName | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Symbol ) |
CONST CHAR8 * MachoGetIndirectSymbolName32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST * | Symbol ) |
Retrieves a 32-bit Symbol's name.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Indirect symbol to retrieve the name of. |
NULL | NULL is returned on failure. |
CONST CHAR8 * MachoGetIndirectSymbolName64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_64 * | Symbol ) |
Retrieves a 64-bit Symbol's name.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Indirect symbol to retrieve the name of. |
NULL | NULL is returned on failure. |
UINT32 MachoGetIndirectSymbolTable | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
OUT CONST MACH_NLIST_ANY ** | SymbolTable ) |
UINT32 MachoGetIndirectSymbolTable32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
OUT CONST MACH_NLIST ** | SymbolTable ) |
Obtain indirect 32-bit symbol table.
[in] | Context | Context of the Mach-O. |
[in,out] | SymbolTable | Indirect symbol table. |
UINT32 MachoGetIndirectSymbolTable64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
OUT CONST MACH_NLIST_64 ** | SymbolTable ) |
Obtain indirect 64-bit symbol table.
[in] | Context | Context of the Mach-O. |
[in,out] | SymbolTable | Indirect symbol table. |
UINT32 MachoGetInnerSize | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
UINT64 MachoGetLastAddress | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
MACH_NLIST_ANY * MachoGetLocalDefinedSymbolByName | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | Name ) |
MACH_NLIST * MachoGetLocalDefinedSymbolByName32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | Name ) |
Retrieves a locally defined 32-bit symbol by its name.
[in] | Context | Context of the Mach-O. |
[in] | Name | Name of the symbol to locate. |
MACH_NLIST_64 * MachoGetLocalDefinedSymbolByName64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | Name ) |
Retrieves a locally defined 64-bit symbol by its name.
[in] | Context | Context of the Mach-O. |
[in] | Name | Name of the symbol to locate. |
MACH_HEADER_ANY * MachoGetMachHeader | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
MACH_HEADER * MachoGetMachHeader32 | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
Returns the 32-bit Mach-O Header structure.
[in,out] | Context | Context of the Mach-O. |
MACH_HEADER_64 * MachoGetMachHeader64 | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
Returns the 64-bit Mach-O Header structure.
[in,out] | Context | Context of the Mach-O. |
MACH_NLIST_ANY * MachoGetMetaclassSymbolFromSmcpSymbol | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Smcp ) |
Retrieves Metaclass symbol of a SMCP.
[in,out] | Context | Context of the Mach-O. |
[in] | Smcp | The SMCP to evaluate. |
NULL | NULL is returned on failure. |
Definition at line 400 of file CxxSymbols.c.
MACH_NLIST * MachoGetMetaclassSymbolFromSmcpSymbol32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST * | Smcp ) |
Retrieves 32-bit Metaclass symbol of a SMCP.
[in,out] | Context | Context of the Mach-O. |
[in] | Smcp | The SMCP to evaluate. |
NULL | NULL is returned on failure. |
MACH_NLIST_64 * MachoGetMetaclassSymbolFromSmcpSymbol64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_64 * | Smcp ) |
Retrieves 64-bit Metaclass symbol of a SMCP.
[in,out] | Context | Context of the Mach-O. |
[in] | Smcp | The SMCP to evaluate. |
NULL | NULL is returned on failure. |
BOOLEAN MachoGetMetaVtableNameFromClassName | ( | IN CONST CHAR8 * | ClassName, |
IN UINTN | VtableNameSize, | ||
OUT CHAR8 * | VtableName ) |
Retrieves the Meta VTable name of a class name.
[in] | ClassName | Class name to get the Meta VTable name of. |
[in] | VtableNameSize | The size of VtableName. |
[out] | VtableName | The output buffer for the VTable name. |
Definition at line 279 of file CxxSymbols.c.
MACH_LOAD_COMMAND * MachoGetNextCommand | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_LOAD_COMMAND_TYPE | LoadCommandType, | ||
IN CONST MACH_LOAD_COMMAND *LoadCommand | OPTIONAL ) |
Retrieves the next Load Command of type LoadCommandType.
[in,out] | Context | Context of the Mach-O. |
[in] | LoadCommandType | Type of the Load Command to retrieve. |
[in] | LoadCommand | Previous Load Command. If NULL, the first match is returned. |
NULL | NULL is returned on failure. |
MACH_SECTION_ANY * MachoGetNextSection | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_SEGMENT_COMMAND_ANY * | Segment, | ||
IN MACH_SECTION_ANY *Section | OPTIONAL ) |
MACH_SECTION * MachoGetNextSection32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_SEGMENT_COMMAND * | Segment, | ||
IN MACH_SECTION *Section | OPTIONAL ) |
Retrieves the next 32-bit section of a segment.
[in,out] | Context | Context of the Mach-O. |
[in] | Segment | The segment to get the section of. |
[in] | Section | The section to get the successor of. |
NULL | NULL is returned on failure. |
MACH_SECTION_64 * MachoGetNextSection64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_SEGMENT_COMMAND_64 * | Segment, | ||
IN MACH_SECTION_64 *Section | OPTIONAL ) |
Retrieves the next 64-bit section of a segment.
[in,out] | Context | Context of the Mach-O. |
[in] | Segment | The segment to get the section of. |
[in] | Section | The section to get the successor of. |
NULL | NULL is returned on failure. |
MACH_SEGMENT_COMMAND_ANY * MachoGetNextSegment | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_SEGMENT_COMMAND_ANY *Segment | OPTIONAL ) |
MACH_SEGMENT_COMMAND * MachoGetNextSegment32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_SEGMENT_COMMAND *Segment | OPTIONAL ) |
Retrieves the next 32-bit segment.
[in,out] | Context | Context of the Mach-O. |
[in] | Segment | Segment to retrieve the successor of. if NULL, the first segment is returned. |
NULL | NULL is returned on failure. |
MACH_SEGMENT_COMMAND_64 * MachoGetNextSegment64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_SEGMENT_COMMAND_64 *Segment | OPTIONAL ) |
Retrieves the next 64-bit segment.
[in,out] | Context | Context of the Mach-O. |
[in] | Segment | Segment to retrieve the successor of. if NULL, the first segment is returned. |
NULL | NULL is returned on failure. |
MACH_SECTION * MachoGetSectionByAddress32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Address ) |
Retrieves a 32-bit section by its address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address of the section to retrieve. |
NULL | NULL is returned on failure. |
MACH_SECTION_64 * MachoGetSectionByAddress64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | Address ) |
Retrieves a 64-bit section by its address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address of the section to retrieve. |
NULL | NULL is returned on failure. |
MACH_SECTION_ANY * MachoGetSectionByIndex | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Index ) |
MACH_SECTION * MachoGetSectionByIndex32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Index ) |
Retrieves a 32-bit section by its index.
[in,out] | Context | Context of the Mach-O. |
[in] | Index | Index of the section to retrieve. |
NULL | NULL is returned on failure. |
MACH_SECTION_64 * MachoGetSectionByIndex64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Index ) |
Retrieves a 64-bit section by its index.
[in,out] | Context | Context of the Mach-O. |
[in] | Index | Index of the section to retrieve. |
NULL | NULL is returned on failure. |
MACH_SECTION_ANY * MachoGetSectionByName | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_SEGMENT_COMMAND_ANY * | Segment, | ||
IN CONST CHAR8 * | SectionName ) |
MACH_SECTION * MachoGetSectionByName32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_SEGMENT_COMMAND * | Segment, | ||
IN CONST CHAR8 * | SectionName ) |
Retrieves the first 32-bit section by the name of SectionName.
[in,out] | Context | Context of the Mach-O. |
[in] | Segment | Segment to search in. |
[in] | SectionName | Section name to search for. |
NULL | NULL is returned on failure. |
MACH_SECTION_64 * MachoGetSectionByName64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN MACH_SEGMENT_COMMAND_64 * | Segment, | ||
IN CONST CHAR8 * | SectionName ) |
Retrieves the first 64-bit section by the name of SectionName.
[in,out] | Context | Context of the Mach-O. |
[in] | Segment | Segment to search in. |
[in] | SectionName | Section name to search for. |
NULL | NULL is returned on failure. |
MACH_SEGMENT_COMMAND_ANY * MachoGetSegmentByName | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SegmentName ) |
MACH_SEGMENT_COMMAND * MachoGetSegmentByName32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SegmentName ) |
Retrieves the first 32-bit segment by the name of SegmentName.
[in,out] | Context | Context of the Mach-O. |
[in] | SegmentName | Segment name to search for. |
NULL | NULL is returned on failure. |
MACH_SEGMENT_COMMAND_64 * MachoGetSegmentByName64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SegmentName ) |
Retrieves the first 64-bit segment by the name of SegmentName.
[in,out] | Context | Context of the Mach-O. |
[in] | SegmentName | Segment name to search for. |
NULL | NULL is returned on failure. |
MACH_SECTION_ANY * MachoGetSegmentSectionByName | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SegmentName, | ||
IN CONST CHAR8 * | SectionName ) |
Retrieves a section within a segment by the name of SegmentName.
[in,out] | Context | Context of the Mach-O. |
[in] | SegmentName | The name of the segment to search in. |
[in] | SectionName | The name of the section to search for. |
NULL | NULL is returned on failure. |
MACH_SECTION * MachoGetSegmentSectionByName32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SegmentName, | ||
IN CONST CHAR8 * | SectionName ) |
Retrieves a 32-bit section within a segment by the name of SegmentName.
[in,out] | Context | Context of the Mach-O. |
[in] | SegmentName | The name of the segment to search in. |
[in] | SectionName | The name of the section to search for. |
NULL | NULL is returned on failure. |
MACH_SECTION_64 * MachoGetSegmentSectionByName64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SegmentName, | ||
IN CONST CHAR8 * | SectionName ) |
Retrieves a 64-bit section within a segment by the name of SegmentName.
[in,out] | Context | Context of the Mach-O. |
[in] | SegmentName | The name of the segment to search in. |
[in] | SectionName | The name of the section to search for. |
NULL | NULL is returned on failure. |
BOOLEAN MachoGetSymbolByExternRelocationOffset | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | Address, | ||
OUT MACH_NLIST_ANY ** | Symbol ) |
Retrieves the symbol referenced by the extern Relocation targeting Address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address to search for. |
[out] | Symbol | Buffer to output the symbol referenced by the Relocation into. The output is undefined when FALSE is returned. May be NULL. |
BOOLEAN MachoGetSymbolByExternRelocationOffset32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Address, | ||
OUT MACH_NLIST ** | Symbol ) |
Retrieves the 32-bit symbol referenced by the extern Relocation targeting Address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address to search for. |
[out] | Symbol | Buffer to output the symbol referenced by the Relocation into. The output is undefined when FALSE is returned. May be NULL. |
BOOLEAN MachoGetSymbolByExternRelocationOffset64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | Address, | ||
OUT MACH_NLIST_64 ** | Symbol ) |
Retrieves the 64-bit symbol referenced by the extern Relocation targeting Address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address to search for. |
[out] | Symbol | Buffer to output the symbol referenced by the Relocation into. The output is undefined when FALSE is returned. May be NULL. |
MACH_NLIST_ANY * MachoGetSymbolByIndex | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Index ) |
MACH_NLIST * MachoGetSymbolByIndex32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Index ) |
Retrieves a 32-bit symbol by its index.
[in] | Context | Context of the Mach-O. |
[in] | Index | Index of the symbol to locate. |
NULL | NULL is returned on failure. |
MACH_NLIST_64 * MachoGetSymbolByIndex64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Index ) |
Retrieves a 64-bit symbol by its index.
[in] | Context | Context of the Mach-O. |
[in] | Index | Index of the symbol to locate. |
NULL | NULL is returned on failure. |
BOOLEAN MachoGetSymbolByRelocationOffset32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | Address, | ||
OUT MACH_NLIST ** | Symbol ) |
Retrieves the 32-bit symbol referenced by the Relocation targeting Address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address to search for. |
[out] | Symbol | Buffer to output the symbol referenced by the Relocation into. The output is undefined when FALSE is returned. May be NULL. |
BOOLEAN MachoGetSymbolByRelocationOffset64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | Address, | ||
OUT MACH_NLIST_64 ** | Symbol ) |
Retrieves the 64-bit symbol referenced by the Relocation targeting Address.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Address to search for. |
[out] | Symbol | Buffer to output the symbol referenced by the Relocation into. The output is undefined when FALSE is returned. May be NULL. |
CONST CHAR8 * MachoGetSymbolName | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Symbol ) |
CONST CHAR8 * MachoGetSymbolName32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST * | Symbol ) |
Retrieves a 32-bit Symbol's name.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to retrieve the name of. |
symbol | name. |
CONST CHAR8 * MachoGetSymbolName64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_64 * | Symbol ) |
Retrieves a 64-bit Symbol's name.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to retrieve the name of. |
symbol | name. |
UINT32 MachoGetSymbolTable | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
OUT CONST MACH_NLIST_ANY ** | SymbolTable, | ||
OUT CONST CHAR8 **StringTable | OPTIONAL, | ||
OUT CONST MACH_NLIST_ANY **LocalSymbols | OPTIONAL, | ||
OUT UINT32 *NumLocalSymbols | OPTIONAL, | ||
OUT CONST MACH_NLIST_ANY **ExternalSymbols | OPTIONAL, | ||
OUT UINT32 *NumExternalSymbols | OPTIONAL, | ||
OUT CONST MACH_NLIST_ANY **UndefinedSymbols | OPTIONAL, | ||
OUT UINT32 *NumUndefinedSymbols | OPTIONAL ) |
Obtain symbol tables.
[in] | Context | Context of the Mach-O. |
[out] | SymbolTable | Symbol table. |
[out] | StringTable | String table for that symbol table. |
[out] | LocalSymbols | Local symbol table. |
[out] | NumLocalSymbols | Number of symbols in local symbol table. |
[out] | ExternalSymbols | External symbol table. |
[out] | NumExternalSymbols | Number of symbols in external symbol table. |
[out] | UndefinedSymbols | Undefined symbol table. |
[out] | NumUndefinedSymbols | Number of symbols in undefined symbol table. |
UINT32 MachoGetSymbolTable32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
OUT CONST MACH_NLIST ** | SymbolTable, | ||
OUT CONST CHAR8 **StringTable | OPTIONAL, | ||
OUT CONST MACH_NLIST **LocalSymbols | OPTIONAL, | ||
OUT UINT32 *NumLocalSymbols | OPTIONAL, | ||
OUT CONST MACH_NLIST **ExternalSymbols | OPTIONAL, | ||
OUT UINT32 *NumExternalSymbols | OPTIONAL, | ||
OUT CONST MACH_NLIST **UndefinedSymbols | OPTIONAL, | ||
OUT UINT32 *NumUndefinedSymbols | OPTIONAL ) |
Obtain 32-bit symbol tables.
[in] | Context | Context of the Mach-O. |
[out] | SymbolTable | Symbol table. |
[out] | StringTable | String table for that symbol table. |
[out] | LocalSymbols | Local symbol table. |
[out] | NumLocalSymbols | Number of symbols in local symbol table. |
[out] | ExternalSymbols | External symbol table. |
[out] | NumExternalSymbols | Number of symbols in external symbol table. |
[out] | UndefinedSymbols | Undefined symbol table. |
[out] | NumUndefinedSymbols | Number of symbols in undefined symbol table. |
UINT32 MachoGetSymbolTable64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
OUT CONST MACH_NLIST_64 ** | SymbolTable, | ||
OUT CONST CHAR8 **StringTable | OPTIONAL, | ||
OUT CONST MACH_NLIST_64 **LocalSymbols | OPTIONAL, | ||
OUT UINT32 *NumLocalSymbols | OPTIONAL, | ||
OUT CONST MACH_NLIST_64 **ExternalSymbols | OPTIONAL, | ||
OUT UINT32 *NumExternalSymbols | OPTIONAL, | ||
OUT CONST MACH_NLIST_64 **UndefinedSymbols | OPTIONAL, | ||
OUT UINT32 *NumUndefinedSymbols | OPTIONAL ) |
Obtain 64-bit symbol tables.
[in] | Context | Context of the Mach-O. |
[out] | SymbolTable | Symbol table. |
[out] | StringTable | String table for that symbol table. |
[out] | LocalSymbols | Local symbol table. |
[out] | NumLocalSymbols | Number of symbols in local symbol table. |
[out] | ExternalSymbols | External symbol table. |
[out] | NumExternalSymbols | Number of symbols in external symbol table. |
[out] | UndefinedSymbols | Undefined symbol table. |
[out] | NumUndefinedSymbols | Number of symbols in undefined symbol table. |
MACH_UUID_COMMAND * MachoGetUuid | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
UINT32 MachoGetVmSize | ( | IN OUT OC_MACHO_CONTEXT * | Context | ) |
BOOLEAN MachoGetVtableNameFromClassName | ( | IN CONST CHAR8 * | ClassName, |
IN UINTN | VtableNameSize, | ||
OUT CHAR8 * | VtableName ) |
Retrieves the VTable name of a class name.
[in] | ClassName | Class name to get the VTable name of. |
[in] | VtableNameSize | The size of VtableName. |
[out] | VtableName | The output buffer for the VTable name. |
Definition at line 239 of file CxxSymbols.c.
BOOLEAN MachoGetVtableSymbolsFromSmcp | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SmcpName, | ||
OUT CONST MACH_NLIST_ANY ** | Vtable, | ||
OUT CONST MACH_NLIST_ANY ** | MetaVtable ) |
Retrieves VTable and Meta VTable of a SMCP. Logically matches XNU's get_vtable_syms_from_smcp.
[in,out] | Context | Context of the Mach-O. |
[in] | SmcpName | SMCP Symbol mame to retrieve the VTables from. |
[out] | Vtable | Output buffer for the VTable symbol pointer. |
[out] | MetaVtable | Output buffer for the Meta VTable symbol pointer. |
Definition at line 413 of file CxxSymbols.c.
BOOLEAN MachoGetVtableSymbolsFromSmcp32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SmcpName, | ||
OUT CONST MACH_NLIST ** | Vtable, | ||
OUT CONST MACH_NLIST ** | MetaVtable ) |
Retrieves 32-bit VTable and Meta VTable of a SMCP. Logically matches XNU's get_vtable_syms_from_smcp.
[in,out] | Context | Context of the Mach-O. |
[in] | SmcpName | SMCP Symbol mame to retrieve the VTables from. |
[out] | Vtable | Output buffer for the VTable symbol pointer. |
[out] | MetaVtable | Output buffer for the Meta VTable symbol pointer. |
BOOLEAN MachoGetVtableSymbolsFromSmcp64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SmcpName, | ||
OUT CONST MACH_NLIST_64 ** | Vtable, | ||
OUT CONST MACH_NLIST_64 ** | MetaVtable ) |
Retrieves 64-bit VTable and Meta VTable of a SMCP. Logically matches XNU's get_vtable_syms_from_smcp.
[in,out] | Context | Context of the Mach-O. |
[in] | SmcpName | SMCP Symbol mame to retrieve the VTables from. |
[out] | Vtable | Output buffer for the VTable symbol pointer. |
[out] | MetaVtable | Output buffer for the Meta VTable symbol pointer. |
BOOLEAN MachoInitialiseSymtabsExternal | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN OC_MACHO_CONTEXT * | SymsContext ) |
BOOLEAN MachoInitializeContext | ( | OUT OC_MACHO_CONTEXT * | Context, |
IN VOID * | FileData, | ||
IN UINT32 | FileSize, | ||
IN UINT32 | HeaderOffset, | ||
IN UINT32 | InnerSize, | ||
IN BOOLEAN | Is32Bit ) |
Initializes a Mach-O Context.
[out] | Context | Mach-O Context to initialize. |
[in] | FileData | Pointer to the file's expected Mach-O header. |
[in] | FileSize | File size of FileData. |
[in] | HeaderOffset | The amount of Bytes the Mach-O header is offset from the base (container, e.g. KC) of the file. |
[in] | InnerSize | The size, in Bytes, of the inner Mach-O file. |
[in] | Is32Bit | TRUE if Mach-O is 32-bit. |
Provides services for Mach-O headers.
Copyright (C) 2016 - 2018, Download-Fritz. 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.
BOOLEAN MachoInitializeContext32 | ( | OUT OC_MACHO_CONTEXT * | Context, |
IN VOID * | FileData, | ||
IN UINT32 | FileSize, | ||
IN UINT32 | HeaderOffset, | ||
IN UINT32 | InnerSize ) |
Initializes a 32-bit Mach-O Context.
[out] | Context | Mach-O Context to initialize. |
[in] | FileData | Pointer to the file's expected Mach-O header. |
[in] | FileSize | File size of FileData. |
[in] | HeaderOffset | The amount of Bytes the Mach-O header is offset from the base (container, e.g. KC) of the file. |
[in] | InnerSize | The size, in Bytes, of the inner Mach-O file. |
BOOLEAN MachoInitializeContext64 | ( | OUT OC_MACHO_CONTEXT * | Context, |
IN VOID * | FileData, | ||
IN UINT32 | FileSize, | ||
IN UINT32 | HeaderOffset, | ||
IN UINT32 | InnerSize ) |
Initializes a 64-bit Mach-O Context.
[out] | Context | Mach-O Context to initialize. |
[in] | FileData | Pointer to the file's expected Mach-O header. |
[in] | FileSize | File size of FileData. |
[in] | HeaderOffset | The amount of Bytes the Mach-O header is offset from the base (container, e.g. KC) of the file. |
[in] | InnerSize | The size, in Bytes, of the inner Mach-O file. |
BOOLEAN MachoIsRelocationPairTypeIntel64 | ( | IN UINT8 | Type | ) |
Returns whether the Relocation's type matches a Pair's for the Intel 64 platform.
[in] | Type | The Relocation's type to verify. |
Definition at line 62 of file Relocations.c.
BOOLEAN MachoIsSymbolValueInRange | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Symbol ) |
BOOLEAN MachoIsSymbolValueInRange32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST * | Symbol ) |
Returns whether the 32-bit symbol's value is a valid address within the Mach-O referenced to by Context.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to verify the value of. |
BOOLEAN MachoIsSymbolValueInRange64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_64 * | Symbol ) |
Returns whether the 64-bit symbol's value is a valid address within the Mach-O referenced to by Context.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to verify the value of. |
BOOLEAN MachoMergeSegments | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | Prefix ) |
BOOLEAN MachoPreserveRelocationIntel64 | ( | IN UINT8 | Type | ) |
Returns whether the Relocation shall be preserved for the Intel 64 platform.
[in] | Type | The Relocation's type to verify. |
Definition at line 76 of file Relocations.c.
BOOLEAN MachoRelocateSymbol | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | LinkAddress, | ||
IN OUT MACH_NLIST_ANY * | Symbol ) |
BOOLEAN MachoRelocateSymbol32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT32 | LinkAddress, | ||
IN OUT MACH_NLIST * | Symbol ) |
Relocate 32-bit Symbol to be against LinkAddress.
[in,out] | Context | Context of the Mach-O. |
[in] | LinkAddress | The address to be linked against. |
[in,out] | Symbol | The symbol to be relocated. |
BOOLEAN MachoRelocateSymbol64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | LinkAddress, | ||
IN OUT MACH_NLIST_64 * | Symbol ) |
Relocate 64-bit Symbol to be against LinkAddress.
[in,out] | Context | Context of the Mach-O. |
[in] | LinkAddress | The address to be linked against. |
[in,out] | Symbol | The symbol to be relocated. |
BOOLEAN MachoRelocationIsPairIntel32 | ( | IN UINT8 | Type | ) |
Returns whether the Relocation's type indicates a Pair for the Intel 32 platform.
[in] | Type | The Relocation's type to verify. |
Definition at line 32 of file Relocations.c.
BOOLEAN MachoRelocationIsPairIntel64 | ( | IN UINT8 | Type | ) |
Returns whether the Relocation's type indicates a Pair for the Intel 64 platform.
[in] | Type | The Relocation's type to verify. |
Definition at line 47 of file Relocations.c.
UINT64 MachoRuntimeGetEntryAddress | ( | IN VOID * | Image | ) |
BOOLEAN MachoSymbolGetDirectFileOffset | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN UINT64 | Address, | ||
OUT UINT32 * | FileOffset, | ||
OUT UINT32 *MaxSize | OPTIONAL ) |
Retrieves the Mach-O file offset of the address pointed to by a Symbol.
[in,out] | Context | Context of the Mach-O. |
[in] | Address | Virtual address to retrieve the offset of. |
[out] | FileOffset | Pointer the file offset is returned into. If FALSE is returned, the output is undefined. |
[out] | MaxSize | Maximum data safely available from FileOffset. |
0 | 0 is returned on failure. |
BOOLEAN MachoSymbolGetFileOffset | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Symbol, | ||
OUT UINT32 * | FileOffset, | ||
OUT UINT32 *MaxSize | OPTIONAL ) |
Retrieves the Mach-O file offset of the address pointed to by a Symbol.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to retrieve the offset of. |
[out] | FileOffset | Pointer the file offset is returned into. If FALSE is returned, the output is undefined. |
[out] | MaxSize | Maximum data safely available from FileOffset. |
0 | 0 is returned on failure. |
BOOLEAN MachoSymbolGetFileOffset32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST * | Symbol, | ||
OUT UINT32 * | FileOffset, | ||
OUT UINT32 *MaxSize | OPTIONAL ) |
Retrieves the Mach-O file offset of the address pointed to by a 32-bit Symbol.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to retrieve the offset of. |
[out] | FileOffset | Pointer the file offset is returned into. If FALSE is returned, the output is undefined. |
[out] | MaxSize | Maximum data safely available from FileOffset. |
0 | 0 is returned on failure. |
BOOLEAN MachoSymbolGetFileOffset64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_64 * | Symbol, | ||
OUT UINT32 * | FileOffset, | ||
OUT UINT32 *MaxSize | OPTIONAL ) |
Retrieves the Mach-O file offset of the address pointed to by a 64-bit Symbol.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to retrieve the offset of. |
[out] | FileOffset | Pointer the file offset is returned into. If FALSE is returned, the output is undefined. |
[out] | MaxSize | Maximum data safely available from FileOffset. |
0 | 0 is returned on failure. |
BOOLEAN MachoSymbolIsDefined | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Symbol ) |
BOOLEAN MachoSymbolIsDefined32 | ( | IN CONST MACH_NLIST * | Symbol | ) |
Returns whether 32-bit Symbol is defined.
[in] | Symbol | Symbol to evaluate. |
BOOLEAN MachoSymbolIsDefined64 | ( | IN CONST MACH_NLIST_64 * | Symbol | ) |
Returns whether 64-bit Symbol is defined.
[in] | Symbol | Symbol to evaluate. |
BOOLEAN MachoSymbolIsLocalDefined | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_ANY * | Symbol ) |
BOOLEAN MachoSymbolIsLocalDefined32 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST * | Symbol ) |
Returns whether 32-bit Symbol is defined locally.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to evaluate. |
BOOLEAN MachoSymbolIsLocalDefined64 | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST MACH_NLIST_64 * | Symbol ) |
Returns whether 64-bit Symbol is defined locally.
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol to evaluate. |
BOOLEAN MachoSymbolIsSection32 | ( | IN CONST MACH_NLIST * | Symbol | ) |
Returns whether 32-bit Symbol describes a section.
[in] | Symbol | Symbol to evaluate. |
BOOLEAN MachoSymbolIsSection64 | ( | IN CONST MACH_NLIST_64 * | Symbol | ) |
Returns whether 64-bit Symbol describes a section.
[in] | Symbol | Symbol to evaluate. |
BOOLEAN MachoSymbolNameIsCxx | ( | IN CONST CHAR8 * | Name | ) |
Returns whether the symbol name describes a C++ symbol.
[in] | Name | The name to evaluate. |
Definition at line 391 of file CxxSymbols.c.
BOOLEAN MachoSymbolNameIsMetaclassPointer | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SymbolName ) |
Returns whether SymbolName defines a Super Metaclass Pointer.
[in,out] | Context | Context of the Mach-O. |
[in] | SymbolName | The symbol name to check. |
Definition at line 88 of file CxxSymbols.c.
BOOLEAN MachoSymbolNameIsPadslot | ( | IN CONST CHAR8 * | Name | ) |
Returns whether Name is a Padslot.
[in] | Name | The name to evaluate. |
Definition at line 51 of file CxxSymbols.c.
BOOLEAN MachoSymbolNameIsPureVirtual | ( | IN CONST CHAR8 * | Name | ) |
Returns whether Name is pure virtual.
[in] | Name | The name to evaluate. |
Definition at line 42 of file CxxSymbols.c.
BOOLEAN MachoSymbolNameIsSmcp | ( | IN OUT OC_MACHO_CONTEXT * | Context, |
IN CONST CHAR8 * | SymbolName ) |
Returns whether SymbolName defines a Super Metaclass Pointer.
[in,out] | Context | Context of the Mach-O. |
[in] | SymbolName | The symbol name to check. |
Definition at line 60 of file CxxSymbols.c.
BOOLEAN MachoSymbolNameIsVtable | ( | IN CONST CHAR8 * | SymbolName | ) |
Returns whether SymbolName defines a VTable.
[in] | SymbolName | The symbol name to check. |
Definition at line 379 of file CxxSymbols.c.