/* According to the known GUID gVfrArrayAttractGuid to get the base address from FFS. */
EFI_STATUS SearchVfrBinInFfs(IN VOID *Ffs, IN VOID *EfiAddr, IN UINTN Length, OUT UINTN **Offset, OUT UINT8 *NumOfMatchingOffset)
/* According to the known GUID gVfrArrayAttractGuid to get the base address from FFS. */
EFI_STATUS SearchVfrBinInFfs(IN VOID *Ffs, IN VOID *EfiAddr, IN UINTN Length, OUT UINTN **Offset, OUT UINT8 *NumOfMatchingOffset)
{
  UINTN       Index;
  EFI_STATUS  Status;
  UINTN       VirOffValue;
  if ((Ffs == NULL) || (Offset == NULL)) {
    return EFI_NOT_FOUND;
  }
  Status = GetAddressByGuid (
             Ffs,
             &gVfrArrayAttractGuid,
             Length,
             Offset,
             NumOfMatchingOffset
             );
  if (Status != EFI_SUCCESS) {
    return Status;
  }
  for (Index = 0; Index < *NumOfMatchingOffset; Index++) {
    VirOffValue = *(UINTN *)((UINTN)Ffs + *(*Offset + Index));
    *(*Offset + Index) = (UINTN)EfiAddr + VirOffValue;
  }
  return Status;
}