/* Converts an image address to the loaded address */
STATIC VOID * PeCoffLoaderImageAddress(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, IN UINTN Address)
/* Converts an image address to the loaded address */
STATIC VOID * PeCoffLoaderImageAddress(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, IN UINTN Address)
{
  if (Address >= ImageContext->ImageSize) {
    ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
    return NULL;
  }
  return (UINT8 *) ((UINTN) ImageContext->ImageAddress + Address);
}