Created
May 2, 2023 13:10
-
-
Save 0x070696E65/428a215004722a34fdb147271cfd8bbd to your computer and use it in GitHub Desktop.
SymbolのCatupaltにあるdataにある.datファイルをデシリアライズする方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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