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


C# BlamLib.ReadBytes方法代码示例

本文整理汇总了C#中BlamLib.ReadBytes方法的典型用法代码示例。如果您正苦于以下问题:C# BlamLib.ReadBytes方法的具体用法?C# BlamLib.ReadBytes怎么用?C# BlamLib.ReadBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BlamLib的用法示例。


在下文中一共展示了BlamLib.ReadBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read


//.........这里部分代码省略.........
			memoryPartitions[0].BaseAddress = s.ReadUInt32(); // cache resource buffer
			memoryPartitions[0].Size = s.ReadInt32();

			// readonly
			memoryPartitions[1].BaseAddress = s.ReadUInt32(); // sound cache resource buffer
			memoryPartitions[1].Size = s.ReadInt32();

			memoryPartitions[2].BaseAddress = s.ReadUInt32(); // global tags buffer
			memoryPartitions[2].Size = s.ReadInt32();
			memoryPartitions[3].BaseAddress = s.ReadUInt32(); // shared tag blocks?
			memoryPartitions[3].Size = s.ReadInt32();
			memoryPartitions[4].BaseAddress = s.ReadUInt32(); // address
			memoryPartitions[4].Size = s.ReadInt32();

			// readonly
			memoryPartitions[5].BaseAddress = s.ReadUInt32(); // map tags buffer
			memoryPartitions[5].Size = s.ReadInt32();
			#endregion

			int count = s.ReadInt32();
			s.Seek(12, System.IO.SeekOrigin.Current); // these bytes are always the same
			// if there is a hash in the header, this is the ONLY
			// place where it can be
			s.Seek(20 /*SHA1*/ + 40 + 256 /*RSA*/, System.IO.SeekOrigin.Current); // ???

			// 0x46C
			cacheInterop.Read(s);
			cacheInterop.PostprocessForCacheRead(kSizeOf);

			s.Seek(16, System.IO.SeekOrigin.Current); // GUID?, these bytes are always the same. ODST is different from Halo 3

			#region blah 1
			// 0x4AC

			// campaign has a shit load of these
			// but shared doesn't nor mainmenu
			// I compared the sc110 french and english and both have the SAME counts and element data. So 
			// I don't think this is a hash or something. At least, if it is, it's not runtime relative so 
			// nothing we have to worry about

			s.ReadInt16(); // I've only seen this be two different values (besides zero).
			count = s.ReadInt16();
			s.ReadInt32(); // seems to always be zero
			CompressionGuid = new Guid(s.ReadBytes(16));

			s.Seek(count * 28, System.IO.SeekOrigin.Current); // seek past the elements
			// dword
			// long
			// buffer [0x14] (probably a sha1 hash)
			s.Seek((320 - count) * 28, System.IO.SeekOrigin.Current); // seek past the unused elements
			#endregion

			#region blah 2
			{
				// 0x27C4
				// This on the other hand, sc110 french and english had MINOR differences. Those differences were in 
				// DWORDs @ 0x4 and 0x8

				// 005 - 1
				// 010 - 3
				// 020 - 3
				// 030 - 2
				// 040 - 2
				// 050 - 2
				// 070 - 3
				// 100 - 3
				// 110 - 2
				// 120 - 2
				// 130 - 1

				// c100  - 1
				// c200  - 1
				// h100  - 9
				// l200  - 7
				// l300  - 8
				// sc100 - 5
				// sc110 - 5
				// sc120 - 6
				// sc130 - 6
				// sc140 - 6
				// sc150 - 6

				// going to punt and just assume there is a max count of 10 of these possible

				// maybe related to bsp\'zones'?
				int blah2_sizeof = !is_odst ? 172 : 180;

				count = (int)(s.ReadUInt32() >> 24); // did someone forget to fucking byte swap something?
				s.Seek(count * blah2_sizeof, System.IO.SeekOrigin.Current); // seek past the elements
				s.Seek((10 - count) * blah2_sizeof, System.IO.SeekOrigin.Current); // seek past the unused elements
			}
			#endregion

			s.Seek((!is_odst ? 380 : 300) + sizeof(uint), System.IO.SeekOrigin.Current); // zero


			ReadPostprocessForInterop();

			ReadPostprocessForBaseAddresses(s);
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:101,代码来源:CacheFile.cs

示例2: Read

				public void Read(BlamLib.IO.EndianReader s)
				{
					Size = s.ReadInt32() - 4;
					TickId = s.ReadUInt32();
					Buffer = s.ReadBytes(Size);
				}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:6,代码来源:BLF.cs


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