sfdnsres: Fix serialization issues (#2992)
* sfdnsres: Fix serialization issues Fix a crash on Monster Hunter Rise * Address gdkchan's comments * Address gdkchan's comments
This commit is contained in:
parent
f4bbc019b9
commit
d300a5a45b
5 changed files with 244 additions and 54 deletions
|
@ -60,6 +60,18 @@ namespace Ryujinx.HLE.Utilities
|
|||
return output;
|
||||
}
|
||||
|
||||
public static string ReadUtf8String(ReadOnlySpan<byte> data, out int dataRead)
|
||||
{
|
||||
dataRead = data.IndexOf((byte)0) + 1;
|
||||
|
||||
if (dataRead <= 1)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return Encoding.UTF8.GetString(data[..dataRead]);
|
||||
}
|
||||
|
||||
public static string ReadUtf8String(ServiceCtx context, int index = 0)
|
||||
{
|
||||
ulong position = context.Request.PtrBuff[index].Position;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue