Compare commits

...

2 Commits

Author SHA1 Message Date
jcm
171b46ef49 macOS: Use user-friendly macOS version string (#5838)
* use user-friendly macOS version string rather than kernel version

* add build identifier string

---------

Co-authored-by: jcm <butt@butts.com>
2023-10-25 00:37:13 +02:00
Alex Barney
56fe2ff535 Fix loading tickets from a Sha256PartitionFileSystem (#5844) 2023-10-24 13:26:25 -03:00
2 changed files with 17 additions and 1 deletions

View File

@@ -12,6 +12,13 @@ namespace Ryujinx.Common.SystemInfo
{ {
internal MacOSSystemInfo() internal MacOSSystemInfo()
{ {
if (SysctlByName("kern.osversion", out string buildRevision) != 0)
{
buildRevision = "Unknown Build";
}
OsDescription = $"macOS {Environment.OSVersion.Version} ({buildRevision}) ({RuntimeInformation.OSArchitecture})";
string cpuName = GetCpuidCpuName(); string cpuName = GetCpuidCpuName();
if (cpuName == null && SysctlByName("machdep.cpu.brand_string", out cpuName) != 0) if (cpuName == null && SysctlByName("machdep.cpu.brand_string", out cpuName) != 0)

View File

@@ -264,7 +264,16 @@ namespace Ryujinx.HLE.FileSystem
if (result.IsSuccess()) if (result.IsSuccess())
{ {
Ticket ticket = new(ticketFile.Get.AsStream()); // When reading a file from a Sha256PartitionFileSystem, you can't start a read in the middle
// of the hashed portion (usually the first 0x200 bytes) of the file and end the read after
// the end of the hashed portion, so we read the ticket file using a single read.
byte[] ticketData = new byte[0x2C0];
result = ticketFile.Get.Read(out long bytesRead, 0, ticketData);
if (result.IsFailure() || bytesRead != ticketData.Length)
continue;
Ticket ticket = new(new MemoryStream(ticketData));
var titleKey = ticket.GetTitleKey(KeySet); var titleKey = ticket.GetTitleKey(KeySet);
if (titleKey != null) if (titleKey != null)