mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-31 01:19:16 +00:00
@@ -2,8 +2,6 @@ using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Ryujinx.HLE.Loaders.Elf
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
|
||||
enum ElfDynamicTag
|
||||
{
|
||||
DT_NULL = 0,
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace Ryujinx.HLE.Loaders.Elf
|
||||
public ElfSymbolBinding Binding { get; private set; }
|
||||
public ElfSymbolVisibility Visibility { get; private set; }
|
||||
|
||||
public readonly bool IsFuncOrObject => Type == ElfSymbolType.SttFunc || Type == ElfSymbolType.SttObject;
|
||||
public readonly bool IsGlobalOrWeak => Binding == ElfSymbolBinding.StbGlobal || Binding == ElfSymbolBinding.StbWeak;
|
||||
public readonly bool IsFuncOrObject => Type is ElfSymbolType.SttFunc or ElfSymbolType.SttObject;
|
||||
public readonly bool IsGlobalOrWeak => Binding is ElfSymbolBinding.StbGlobal or ElfSymbolBinding.StbWeak;
|
||||
|
||||
public int ShIdx { get; private set; }
|
||||
public ulong Value { get; private set; }
|
||||
|
||||
@@ -94,15 +94,15 @@ namespace Ryujinx.HLE.Loaders.Mods
|
||||
|
||||
static int ParseHexByte(byte c)
|
||||
{
|
||||
if (c >= '0' && c <= '9')
|
||||
if (c is >= (byte)'0' and <= (byte)'9')
|
||||
{
|
||||
return c - '0';
|
||||
}
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
else if (c is >= (byte)'A' and <= (byte)'F')
|
||||
{
|
||||
return c - 'A' + 10;
|
||||
}
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
else if (c is >= (byte)'a' and <= (byte)'f')
|
||||
{
|
||||
return c - 'a' + 10;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Ryujinx.HLE.Loaders.Mods
|
||||
Logger.Warning?.Print(LogClass.ModLoader, $"Attempted to patch protected memory ({patchOffset:x} is within protected boundary of {protectedOffset:x}).");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (patchOffset > memory.Length)
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.ModLoader, $"Attempted to patch out of bounds memory (offset {patchOffset} ({patchOffset:x}) exceeds memory buffer length {memory.Length}).");
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
||||
if (!_processesByPid.TryGetValue(_latestPid, out ProcessResult value))
|
||||
throw new RyujinxException(
|
||||
$"The HLE Process map did not have a process with ID {_latestPid}. Are you missing firmware?");
|
||||
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool LoadNxo(string path)
|
||||
{
|
||||
BlitStruct<ApplicationControlProperty> nacpData = new(1);
|
||||
@@ -172,7 +172,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
||||
// Load executable.
|
||||
IExecutable executable;
|
||||
|
||||
if (Path.GetExtension(path).ToLower() == ".nro")
|
||||
if (Path.GetExtension(path).Equals(".nro", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
FileStream input = new(path, FileMode.Open);
|
||||
NroExecutable nro = new(input.AsStorage());
|
||||
|
||||
Reference in New Issue
Block a user