本文整理汇总了C#中Reader.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.ReadUInt32方法的具体用法?C# Reader.ReadUInt32怎么用?C# Reader.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader.ReadUInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadHeader
public PackageHeader ReadHeader(Reader reader)
{
PackageHeader header = new PackageHeader();
header.magic = reader.ReadBytes(0x04);
Array.Reverse(header.magic);
reader.Position = 0x07;
header.pkg_type = reader.ReadByte();
reader.Position = 0x08;
header.pkg_info_offset = reader.ReadUInt32();
reader.Position = 0x0C;
header.pkg_info_count = reader.ReadUInt32();
reader.Position = 0x10;
header.header_size = reader.ReadUInt32();
reader.Position = 0x14;
header.item_count = reader.ReadUInt32();
reader.Position = 0x18;
header.total_size = reader.ReadUInt64();
reader.Position = 0x20;
header.data_offset = reader.ReadUInt64();
reader.Position = 0x28;
header.data_size = reader.ReadUInt64();
reader.Position = 0x30;
header.contentid = reader.ReadString(0x24);
reader.Position = 0x60;
header.digest = reader.ReadBytes(0x10);
Array.Reverse(header.digest);
reader.Position = 0x70;
header.pkg_data_riv = reader.ReadBytes(0x10);
Array.Reverse(header.pkg_data_riv);
reader.Position = 0x80;
header.header_cmac_hash = reader.ReadBytes(0x10);
Array.Reverse(header.header_cmac_hash);
reader.Position = 0x90;
header.header_npdrm_signature = reader.ReadBytes(0x28);
Array.Reverse(header.header_npdrm_signature);
reader.Position = 0xB8;
header.header_sha1_hash = reader.ReadBytes(0x08);
Array.Reverse(header.header_sha1_hash);
return header;
}
示例2: ReadSlot
private void ReadSlot()
{
using (var reader = new Reader(buffer, true))
{
SetStatus("Reading Slot# " + (index + 1));
_offset = (0x44 + (0x79400 * index));
try
{
//Name
SetStatus("Reading Name");
reader.Position = _offset + 4;
Slots[index].Name =
reader.ReadString(StringType.Ascii, 16).Trim(Convert.ToChar("\0"));
//Money
SetStatus("Reading Money");
reader.Position = _offset + 64;
Slots[index].Money = reader.ReadUInt32();
//Squad Reads
int counter = 0;
foreach (Squad squad in Slots[index].Squads)
{
SetStatus("Reading " + (Squaddies)counter);
reader.Position = _offset + squad.Adjust;
squad.Level = reader.ReadUInt16();
reader.Position += 4;
squad.Points = reader.ReadUInt32();
counter++;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
SetStatus("ERROR!");
return;
}
Slots[index].SlotRead = true;
SetStatus("Loaded!");
reader.Flush();
}
}