mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-30 17:09:15 +00:00
@@ -500,6 +500,7 @@ namespace Ryujinx.HLE.HOS
|
||||
{
|
||||
AddFiles(fs, mod.Name, mod.Path.FullName, fileSet, builder);
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -516,6 +517,7 @@ namespace Ryujinx.HLE.HOS
|
||||
{
|
||||
AddFiles(fs, mod.Name, mod.Path.FullName, fileSet, builder);
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -547,7 +549,7 @@ namespace Ryujinx.HLE.HOS
|
||||
return newStorage;
|
||||
}
|
||||
|
||||
private static void AddFiles(IFileSystem fs, string modName, string rootPath, ISet<string> fileSet, RomFsBuilder builder)
|
||||
private static void AddFiles(IFileSystem fs, string modName, string rootPath, HashSet<string> fileSet, RomFsBuilder builder)
|
||||
{
|
||||
foreach (DirectoryEntryEx entry in fs.EnumerateEntries()
|
||||
.AsParallel()
|
||||
@@ -644,16 +646,11 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
modLoadResult.Replaces[1 << i] = true;
|
||||
|
||||
using (FileStream stream = nsoFile.OpenRead())
|
||||
{
|
||||
nsos[i] = new NsoExecutable(stream.AsStorage(), nsoName);
|
||||
Logger.Info?.Print(LogClass.ModLoader, $"NSO '{nsoName}' replaced");
|
||||
using (MD5 md5 = MD5.Create())
|
||||
{
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
tempHash += BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "").ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
using FileStream stream = nsoFile.OpenRead();
|
||||
nsos[i] = new NsoExecutable(stream.AsStorage(), nsoName);
|
||||
Logger.Info?.Print(LogClass.ModLoader, $"NSO '{nsoName}' replaced");
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
tempHash += Convert.ToHexStringLower(MD5.HashData(stream));
|
||||
}
|
||||
|
||||
modLoadResult.Stubs[1 << i] |= File.Exists(Path.Combine(mod.Path.FullName, nsoName + StubExtension));
|
||||
@@ -687,10 +684,7 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
if (!string.IsNullOrEmpty(tempHash))
|
||||
{
|
||||
using (MD5 md5 = MD5.Create())
|
||||
{
|
||||
modLoadResult.Hash += BitConverter.ToString(md5.ComputeHash(tempHash.ToBytes())).Replace("-", string.Empty).ToLowerInvariant();
|
||||
}
|
||||
modLoadResult.Hash += Convert.ToHexStringLower(MD5.HashData(tempHash.ToBytes()));
|
||||
}
|
||||
|
||||
return modLoadResult;
|
||||
|
||||
Reference in New Issue
Block a user