Skip to content

Instantly share code, notes, and snippets.

@0x070696E65
Created May 2, 2023 13:10
Show Gist options
  • Save 0x070696E65/428a215004722a34fdb147271cfd8bbd to your computer and use it in GitHub Desktop.
Save 0x070696E65/428a215004722a34fdb147271cfd8bbd to your computer and use it in GitHub Desktop.
SymbolのCatupaltにあるdataにある.datファイルをデシリアライズする方法
string fileName = "./files/01100.dat";
var fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None);
var data = new byte[fileStream.Length];
fileStream.Read(data, 0, data.Length);
var first8Bytes = data[0..8];
var offset = BitConverter.ToUInt64(first8Bytes);
var result = BlockFactory.Deserialize(Converter.BytesToHex(data[(int) offset..]));
Console.WriteLine(result);
Console.WriteLine(Converter.BytesToHex(result.Serialize()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment