OcMachoLib: Introduce MachoGetFileSize() API.

This commit is contained in:
Download-Fritz 2018-11-04 08:21:17 +01:00
parent 3b9ad05f71
commit 8ddbd9fdd4
2 changed files with 28 additions and 0 deletions

View File

@ -56,6 +56,17 @@ MachoGetMachHeader64 (
IN OUT OC_MACHO_CONTEXT *Context
);
/**
Returns the Mach-O's file size.
@param[in,out] Context Context of the Mach-O.
**/
UINTN
MachoGetFileSize (
IN OUT OC_MACHO_CONTEXT *Context
);
/**
Returns the last virtual address of a Mach-O.

View File

@ -51,6 +51,23 @@ MachoGetMachHeader64 (
return (MACH_HEADER_64 *)Context->MachHeader;
}
/**
Returns the Mach-O's file size.
@param[in,out] Context Context of the Mach-O.
**/
UINTN
MachoGetFileSize (
IN OUT OC_MACHO_CONTEXT *Context
)
{
ASSERT (Context != NULL);
ASSERT (Context->FileSize != 0);
return Context->FileSize;
}
/**
Initializes a Mach-O Context.