Go to the source code of this file.
|
BOOLEAN | InternalRetrieveSymtabs (IN OUT OC_MACHO_CONTEXT *Context) |
|
MACH_RELOCATION_INFO * | InternalGetExternRelocationByOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address) |
|
MACH_RELOCATION_INFO * | InternalGetLocalRelocationByOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address) |
|
BOOLEAN | InternalSymbolIsSane32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST *Symbol) |
|
BOOLEAN | InternalSymbolIsSane64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST MACH_NLIST_64 *Symbol) |
|
BOOLEAN | InternalMachoSymbolGetDirectFileOffset32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Address, OUT UINT32 *FileOffset, OUT UINT32 *MaxSize OPTIONAL) |
|
BOOLEAN | InternalMachoSymbolGetDirectFileOffset64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT UINT32 *FileOffset, OUT UINT32 *MaxSize OPTIONAL) |
|
UINT32 | InternalMachoGetVmSize32 (IN OUT OC_MACHO_CONTEXT *Context) |
|
UINT32 | InternalMachoGetVmSize64 (IN OUT OC_MACHO_CONTEXT *Context) |
|
UINT32 | InternalMachoGetLastAddress32 (IN OUT OC_MACHO_CONTEXT *Context) |
|
UINT64 | InternalMachoGetLastAddress64 (IN OUT OC_MACHO_CONTEXT *Context) |
|
MACH_LOAD_COMMAND * | InternalMachoGetNextCommand32 (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_LOAD_COMMAND_TYPE LoadCommandType, IN CONST MACH_LOAD_COMMAND *LoadCommand OPTIONAL) |
|
MACH_LOAD_COMMAND * | InternalMachoGetNextCommand64 (IN OUT OC_MACHO_CONTEXT *Context, IN MACH_LOAD_COMMAND_TYPE LoadCommandType, IN CONST MACH_LOAD_COMMAND *LoadCommand OPTIONAL) |
|
VOID * | InternalMachoGetFilePointerByAddress32 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT32 Address, OUT UINT32 *MaxSize OPTIONAL) |
|
VOID * | InternalMachoGetFilePointerByAddress64 (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, OUT UINT32 *MaxSize OPTIONAL) |
|
UINT32 | InternalMachoExpandImage32 (IN OC_MACHO_CONTEXT *Context, IN BOOLEAN CalculateSizeOnly, OUT UINT8 *Destination, IN UINT32 DestinationSize, IN BOOLEAN Strip, OUT UINT64 *FileOffset OPTIONAL) |
|
UINT32 | InternalMachoExpandImage64 (IN OC_MACHO_CONTEXT *Context, IN BOOLEAN CalculateSizeOnly, OUT UINT8 *Destination, IN UINT32 DestinationSize, IN BOOLEAN Strip, OUT UINT64 *FileOffset OPTIONAL) |
|
BOOLEAN | InternalMachoMergeSegments32 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *Prefix) |
|
BOOLEAN | InternalMachoMergeSegments64 (IN OUT OC_MACHO_CONTEXT *Context, IN CONST CHAR8 *Prefix) |
|
◆ SYM_MAX_NAME_LEN
#define SYM_MAX_NAME_LEN 256U |
Private data of OcMachoLib.
Copyright (C) 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 at line 22 of file OcMachoLibInternal.h.
◆ InternalGetExternRelocationByOffset()
Retrieves an extern Relocation by the address it targets.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Address | The address to search for. |
- Return values
-
NULL | NULL is returned on failure. |
Definition at line 211 of file Relocations.c.
◆ InternalGetLocalRelocationByOffset()
Retrieves a Relocation by the address it targets.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Address | The address to search for. |
- Return values
-
NULL | NULL is returned on failure. |
Retrieves an extern Relocation by the address it targets.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Address | The address to search for. |
- Return values
-
NULL | NULL is returned on failure. |
Definition at line 244 of file Relocations.c.
◆ InternalMachoExpandImage32()
UINT32 InternalMachoExpandImage32 |
( |
IN OC_MACHO_CONTEXT * | Context, |
|
|
IN BOOLEAN | CalculateSizeOnly, |
|
|
OUT UINT8 * | Destination, |
|
|
IN UINT32 | DestinationSize, |
|
|
IN BOOLEAN | Strip, |
|
|
OUT UINT64 *FileOffset | OPTIONAL ) |
Expand 32-bit Mach-O image to Destination (make segment file sizes equal to vm sizes).
- Parameters
-
[in] | Context | Context of the Mach-O. |
[in] | CalculateSizeOnly | TRUE to only calcuate a size and not actually expand the image. |
[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. |
- Returns
- New image size or 0 on failure.
◆ InternalMachoExpandImage64()
UINT32 InternalMachoExpandImage64 |
( |
IN OC_MACHO_CONTEXT * | Context, |
|
|
IN BOOLEAN | CalculateSizeOnly, |
|
|
OUT UINT8 * | Destination, |
|
|
IN UINT32 | DestinationSize, |
|
|
IN BOOLEAN | Strip, |
|
|
OUT UINT64 *FileOffset | OPTIONAL ) |
Expand 64-bit Mach-O image to Destination (make segment file sizes equal to vm sizes).
- Parameters
-
[in] | Context | Context of the Mach-O. |
[in] | CalculateSizeOnly | TRUE to only calcuate a size and not actually expand the image. |
[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. |
- Returns
- New image size or 0 on failure.
◆ InternalMachoGetFilePointerByAddress32()
VOID * InternalMachoGetFilePointerByAddress32 |
( |
IN OUT OC_MACHO_CONTEXT * | Context, |
|
|
IN UINT32 | Address, |
|
|
OUT UINT32 *MaxSize | OPTIONAL ) |
Returns a pointer to the 32-bit Mach-O file at the specified virtual address.
- Parameters
-
[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. |
◆ InternalMachoGetFilePointerByAddress64()
VOID * InternalMachoGetFilePointerByAddress64 |
( |
IN OUT OC_MACHO_CONTEXT * | Context, |
|
|
IN UINT64 | Address, |
|
|
OUT UINT32 *MaxSize | OPTIONAL ) |
Returns a pointer to the 64-bit Mach-O file at the specified virtual address.
- Parameters
-
[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. |
◆ InternalMachoGetLastAddress32()
Returns the last virtual address of a 32-bit Mach-O.
- Parameters
-
[in] | Context | Context of the Mach-O. |
- Return values
-
0 | The binary is malformed. |
◆ InternalMachoGetLastAddress64()
Returns the last virtual address of a 64-bit Mach-O.
- Parameters
-
[in] | Context | Context of the Mach-O. |
- Return values
-
0 | The binary is malformed. |
◆ InternalMachoGetNextCommand32()
Retrieves the next 32-bit Load Command of type LoadCommandType.
- Parameters
-
[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. |
- Return values
-
NULL | NULL is returned on failure. |
◆ InternalMachoGetNextCommand64()
Retrieves the next 64-bit Load Command of type LoadCommandType.
- Parameters
-
[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. |
- Return values
-
NULL | NULL is returned on failure. |
◆ InternalMachoGetVmSize32()
Returns the 32-bit Mach-O's virtual address space size.
- Parameters
-
[out] | Context | Context of the Mach-O. |
◆ InternalMachoGetVmSize64()
Returns the 64-bit Mach-O's virtual address space size.
- Parameters
-
[out] | Context | Context of the Mach-O. |
◆ InternalMachoMergeSegments32()
BOOLEAN InternalMachoMergeSegments32 |
( |
IN OUT OC_MACHO_CONTEXT * | Context, |
|
|
IN CONST CHAR8 * | Prefix ) |
Merge 32-bit Mach-O segments into one with lowest protection.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Prefix | Segment prefix to merge. |
- Return values
-
◆ InternalMachoMergeSegments64()
BOOLEAN InternalMachoMergeSegments64 |
( |
IN OUT OC_MACHO_CONTEXT * | Context, |
|
|
IN CONST CHAR8 * | Prefix ) |
Merge 64-bit Mach-O segments into one with lowest protection.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Prefix | Segment prefix to merge. |
- Return values
-
◆ InternalMachoSymbolGetDirectFileOffset32()
BOOLEAN InternalMachoSymbolGetDirectFileOffset32 |
( |
IN OUT OC_MACHO_CONTEXT * | Context, |
|
|
IN UINT32 | Address, |
|
|
OUT UINT32 * | FileOffset, |
|
|
OUT UINT32 *MaxSize | OPTIONAL ) |
Retrieves the Mach-O file offset of the address pointed to by a 32-bit Symbol.
- Parameters
-
[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. |
- Return values
-
0 | 0 is returned on failure. |
◆ InternalMachoSymbolGetDirectFileOffset64()
BOOLEAN InternalMachoSymbolGetDirectFileOffset64 |
( |
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 64-bit Symbol.
- Parameters
-
[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. |
- Return values
-
0 | 0 is returned on failure. |
◆ InternalRetrieveSymtabs()
Retrieves the SYMTAB command.
- Parameters
-
[in] | Context | Context of the Mach-O. |
- Return values
-
NULL | NULL is returned on failure. |
Definition at line 508 of file Header.c.
◆ InternalSymbolIsSane32()
Check 32-bit symbol validity.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol from some table. |
- Return values
-
◆ InternalSymbolIsSane64()
Check 64-bit symbol validity.
- Parameters
-
[in,out] | Context | Context of the Mach-O. |
[in] | Symbol | Symbol from some table. |
- Return values
-