當前位置: 首頁>>代碼示例>>C#>>正文


C# PEAPI.FileImage類代碼示例

本文整理匯總了C#中PEAPI.FileImage的典型用法代碼示例。如果您正苦於以下問題:C# FileImage類的具體用法?C# FileImage怎麽用?C# FileImage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FileImage類屬於PEAPI命名空間,在下文中一共展示了FileImage類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Write

		internal sealed override void Write(FileImage output) 
		{
			base.Write(output);
			if (byteNum) 
				output.Write((sbyte)val);
			else 
				output.Write(val); 
		}
開發者ID:REALTOBIZ,項目名稱:mono,代碼行數:8,代碼來源:Code.cs

示例2: Write

		internal sealed override void Write(FileImage output) 
		{
			output.Write(parMode);
			output.Write(seqNo);
			output.StringsIndex(nameIx);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:6,代碼來源:Metadata.cs

示例3: WriteCodedIndex

		internal void WriteCodedIndex(CIx code, MetaDataElement elem, FileImage output) 
		{
			uint ix = 0;
			if (elem != null) { 
				ix = (elem.Row << CIxShiftMap[(uint)code]) | elem.GetCodedIx(code);
				// Console.WriteLine("coded index = " + ix + " row = " + elem.Row);
				//} else {
				// Console.WriteLine("elem for coded index is null");
			}
			if (lgeCIx[(uint)code]) 
				output.Write(ix);
			else
				output.Write((ushort)ix);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:14,代碼來源:Metadata.cs

示例4: WriteResources

		internal void WriteResources (FileImage output) 
		{
			if (resources == null) return;
			for (int i = 0; i < resources.Count; i ++) {
				byte [] resBytes = (byte []) resources [i];
				output.Write ((uint) resBytes.Length);
				output.Write (resBytes);
			} 
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:9,代碼來源:Metadata.cs

示例5: MetaData

		internal MetaData(FileImage file) 
		{
			// tilde = new MetaDataStream(tildeName,false,0);
			this.file = file;
			strings = new MetaDataStream(stringsName,new UTF8Encoding(),true);
			us = new MetaDataStream(usName,new UnicodeEncoding(),true);
			guid = new MetaDataStream(guidName,false);
			blob = new MetaDataStream(blobName,true);
			streams[1] = strings;
			streams[2] = us;
			streams[3] = guid;
			streams[4] = blob;
			for (int i=0; i < numMetaDataTables; i++) {
				largeIx[i] = false;
			}
			for (int i=0; i < lgeCIx.Length; i++) {
				lgeCIx[i] = false;
			}
			mscorlib = new MSCorLib(this);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:20,代碼來源:Metadata.cs

示例6: WriteTildeStream

		internal void WriteTildeStream(FileImage output) 
		{
			long startTilde = output.Seek(0,SeekOrigin.Current);
			output.Write((uint)0); // Reserved
#if NET_2_0 || BOOTSTRAP_NET_2_0
			output.Write((byte)2); // MajorVersion
			output.Write((byte)0); // MinorVersion
#else
			output.Write((byte)1); // MajorVersion
			output.Write((byte)0); // MinorVersion
#endif
			output.Write(heapSizes);
			output.Write((byte)1); // Reserved
			output.Write(valid);
			output.Write(sorted);
			for (int i=0; i < numMetaDataTables; i++) {
				if (metaDataTables[i] != null) {
					uint count = (uint)metaDataTables[i].Count;
					output.Write(count);
				}
			}
			long tabStart = output.Seek(0,SeekOrigin.Current);
			// Console.WriteLine("Starting metaData tables at " + tabStart);
			for (int i=0; i < numMetaDataTables; i++) {
				if (metaDataTables[i] != null) {
					// Console.WriteLine("Starting metaData table " + i + " at " + (output.Seek(0,SeekOrigin.Current) - startTilde));
					ArrayList table = metaDataTables[i];
					for (int j=0; j < table.Count; j++) {
						((MetaDataElement)table[j]).Write(output);
					}
				}
			}
			// Console.WriteLine("Writing padding at " + output.Seek(0,SeekOrigin.Current));
			for (int i=0; i < tildePadding; i++) output.Write((byte)0);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:35,代碼來源:Metadata.cs

示例7: WriteByteCodes

		internal void WriteByteCodes(FileImage output) 
		{
			for (int i=0; i < byteCodes.Count; i++) {
				((CILInstructions)byteCodes[i]).Write(output);
			}
			for (int i=0; i < byteCodePadding; i++) {
				output.Write((byte)0);
			}
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:9,代碼來源:Metadata.cs

示例8: WriteMetaData

		internal void WriteMetaData(FileImage output) 
		{
			this.output = output;
			mdStart = output.Seek(0,SeekOrigin.Current);
			// Console.WriteLine("Writing metaData at " + Hex.Long(mdStart));
			output.Write(MetaDataSignature);
			output.Write((short)1);  // Major Version
			output.Write((short)1);  // Minor Version  ECMA = 0, PEFiles = 1
			output.Write(0);         // Reserved
			output.Write(version.Length);
			output.Write(version.ToCharArray());   // version string is already zero padded
			output.Write((short)0);
			output.Write((ushort)numStreams);
			// write tilde header
			output.Write(tildeStart);
			output.Write(tildeTide + tildePadding);
			output.Write(tildeName);
			for (int i=1; i < numStreams; i++) streams[i].WriteHeader(output);
			// Console.WriteLine("Writing tilde stream at " + output.Seek(0,SeekOrigin.Current) + " = " + tildeStart);
			WriteTildeStream(output);
			for (int i=1; i < numStreams; i++) streams[i].Write(output);
			// Console.WriteLine("Finished Writing metaData at " + output.Seek(0,SeekOrigin.Current));
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:23,代碼來源:Metadata.cs


注:本文中的PEAPI.FileImage類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。