首页 > 解决方案 > C# - 计算给定数据的二进制偏移量

问题描述

我正在识别 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# 不是特别熟练,我将不胜感激。

标签: c#offsetbinary-data

解决方案


推荐阅读