Ryujinx/Ryujinx.HLE/HOS/Services/Time/TimeZone/Types/TzifHeader.cs
Mary 51fa1b2cb0
hle: Improve safety (#2778)
* timezone: Make timezone implementation safe

* hle: Do not use TrimEnd to parse ASCII strings

This adds an util that handle reading an ASCII string in a safe way.
Previously it was possible to read malformed data that could cause
various undefined behaviours in multiple services.

* hid: Remove an useless unsafe modifier on keyboard update

* Address gdkchan's comment

* Address gdkchan's comment
2021-10-24 19:13:20 -03:00

19 lines
No EOL
515 B
C#

using Ryujinx.Common.Memory;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Pack = 0x4, Size = 0x2C)]
struct TzifHeader
{
public Array4<byte> Magic;
public byte Version;
private Array15<byte> _reserved;
public int TtisGMTCount;
public int TtisSTDCount;
public int LeapCount;
public int TimeCount;
public int TypeCount;
public int CharCount;
}
}