/* Read a natural value from memory. May or may not be aligned. */
UINTN VmReadMemN(IN VM_CONTEXT *VmPtr, IN UINTN Addr)
/* Read a natural value from memory. May or may not be aligned. */
UINTN VmReadMemN(IN VM_CONTEXT *VmPtr, IN UINTN Addr)
{
  UINTN            Data;
  volatile UINT32  Size;
  UINT8            *FromPtr;
  UINT8            *ToPtr;
  Addr = ConvertStackAddr (VmPtr, Addr);
  if (ADDRESS_IS_ALIGNED (Addr, sizeof (UINTN))) {
    return *(UINTN *)Addr;
  }
  Data    = 0;
  FromPtr = (UINT8 *)Addr;
  ToPtr   = (UINT8 *)&Data;
  for (Size = 0; Size < sizeof (Data); Size++) {
    *ToPtr = *FromPtr;
    ToPtr++;
    FromPtr++;
  }
  return Data;
}