当前位置: 首页>>代码示例>>C#>>正文


C# Reader.ReadUInt32方法代码示例

本文整理汇总了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;
		}
开发者ID:lockflatboy,项目名称:PlayStationStorePackage,代码行数:55,代码来源:PackageExtra.cs

示例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();
            }
        }
开发者ID:8Ball360Haven,项目名称:BladestormSaveEditor,代码行数:42,代码来源:MainWindow.xaml.cs


注:本文中的Reader.ReadUInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。