C#-计算给定数据的二进制偏移

时间:2019-04-26 15:32:27

标签: c# offset binary-data

我正在识别NAND转储中给定数据段的偏移量。我要识别的数据如下-'TitleId'。

https://github.com/Thealexbarney/LibHac/blob/master/src/LibHac/IO/Save/Header.cs

public class ExtraData
{
    public ulong TitleId { get; }
    public Guid UserId { get; }
    public ulong SaveId { get; }
    public SaveDataType Type { get; }

    public ulong SaveOwnerId { get; }
    public long Timestamp { get; }
    public long Field50 { get; }
    public uint Field54 { get; }
    public long DataSize { get; }
    public long JournalSize { get; }

    public ExtraData(BinaryReader reader)
    {
        TitleId = reader.ReadUInt64();
        UserId = ToGuid(reader.ReadBytes(0x10));
        SaveId = reader.ReadUInt64();
        Type = (SaveDataType)reader.ReadByte();
        reader.BaseStream.Position += 0x1f;

        SaveOwnerId = reader.ReadUInt64();
        Timestamp = reader.ReadInt64();
        Field50 = reader.ReadUInt32();
        Field54 = reader.ReadUInt32();
        DataSize = reader.ReadInt64();
        JournalSize = reader.ReadInt64();
    }

您知道我如何获得该titleid的偏移量吗?我对c#的掌握不是特别熟练,将不胜感激。

0 个答案:

没有答案