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


C# IInstructionOperandResolver.ResolveToken方法代码示例

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


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

示例1: box_read

		static Instruction box_read(BinaryReader reader, IInstructionOperandResolver resolver, GenericParamContext gpContext) {
			var instr = new Instruction();
			switch (reader.ReadByte()) {
			case 0: instr.OpCode = OpCodes.Box; break;
			case 1: instr.OpCode = OpCodes.Unbox_Any; break;
			default: throw new ApplicationException("Invalid opcode");
			}
			instr.Operand = resolver.ResolveToken(reader.ReadUInt32(), gpContext);
			return instr;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:10,代码来源:OpCodeHandler.cs

示例2: ldftn_read

		static Instruction ldftn_read(BinaryReader reader, IInstructionOperandResolver resolver, GenericParamContext gpContext) {
			byte code = reader.ReadByte();
			uint token = reader.ReadUInt32();

			switch (code) {
			case 0:
				return new Instruction(OpCodes.Ldftn, resolver.ResolveToken(token, gpContext));

			case 1:
				reader.ReadInt32();	// token of newobj .ctor
				return new Instruction(OpCodes.Ldvirtftn, resolver.ResolveToken(token, gpContext));

			default:
				throw new ApplicationException("Invalid opcode");
			}
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:16,代码来源:OpCodeHandler.cs

示例3: newarr_read

		static Instruction newarr_read(BinaryReader reader, IInstructionOperandResolver resolver, GenericParamContext gpContext) {
			return new Instruction(OpCodes.Newarr, resolver.ResolveToken(reader.ReadUInt32(), gpContext));
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:3,代码来源:OpCodeHandler.cs

示例4: ldfld_read

		static Instruction ldfld_read(BinaryReader reader, IInstructionOperandResolver resolver, GenericParamContext gpContext) {
			byte b = reader.ReadByte();
			var field = resolver.ResolveToken(reader.ReadUInt32(), gpContext) as IField;
			switch (b) {
			case 0: return new Instruction(null, new FieldInstructionOperand(OpCodes.Ldsfld, OpCodes.Ldfld, field));
			case 1: return new Instruction(null, new FieldInstructionOperand(OpCodes.Ldsflda, OpCodes.Ldflda, field));
			case 2: return new Instruction(null, new FieldInstructionOperand(OpCodes.Stsfld, OpCodes.Stfld, field));
			default: throw new ApplicationException("Invalid opcode");
			}
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:10,代码来源:OpCodeHandler.cs

示例5: ldelem_read

		static Instruction ldelem_read(BinaryReader reader, IInstructionOperandResolver resolver, GenericParamContext gpContext) {
			Instruction instr = null;
			bool first = reader.ReadBoolean();
			bool second = reader.ReadBoolean();
			int value = reader.ReadInt32();
			foreach (var info in instructionInfos2) {
				if (info.First != first || info.Second != second)
					continue;
				if (second && value != info.Value)
					continue;

				if (second)
					instr = new Instruction(info.OpCode);
				else
					instr = new Instruction(info.OpCode, resolver.ResolveToken((uint)value, gpContext));
				break;
			}
			if (instr == null)
				throw new ApplicationException("Invalid opcode");

			return instr;
		}
开发者ID:RafaelRMachado,项目名称:de4dot,代码行数:22,代码来源:OpCodeHandler.cs

示例6: newarr_read

		static Instruction newarr_read(BinaryReader reader, IInstructionOperandResolver resolver) {
			return new Instruction(OpCodes.Newarr, resolver.ResolveToken(reader.ReadUInt32()));
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:3,代码来源:OpCodeHandler.cs

示例7: initobj_read

		static Instruction initobj_read(BinaryReader reader, IInstructionOperandResolver resolver) {
			return new Instruction(OpCodes.Initobj, resolver.ResolveToken(reader.ReadUInt32()));
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:3,代码来源:OpCodeHandler.cs

示例8: cast_read

		static Instruction cast_read(BinaryReader reader, IInstructionOperandResolver resolver) {
			var instr = new Instruction();
			switch (reader.ReadByte()) {
			case 0: instr.OpCode = OpCodes.Castclass; break;
			case 1: instr.OpCode = OpCodes.Isinst; break;
			default: throw new ApplicationException("Invalid opcode");
			}
			instr.Operand = resolver.ResolveToken(reader.ReadUInt32());
			return instr;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:10,代码来源:OpCodeHandler.cs


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