Exemplo n.º 1
0
        public NativeMethodBodyVM(NativeMethodBodyOptions options)
        {
            this.origOptions = options;
            this.rva = new UInt32VM(a => HasErrorUpdated());

            Reinitialize();
        }
Exemplo n.º 2
0
        public NativeMethodBodyVM(NativeMethodBodyOptions options)
        {
            this.origOptions = options;
            this.rva         = new UInt32VM(a => HasErrorUpdated());

            Reinitialize();
        }
Exemplo n.º 3
0
 public MethodBodyOptions(MethodDef method)
 {
     this.CodeType = method.CodeType;
     if (method.MethodBody is CilBody) {
         var headerRva = method.RVA;
         var headerFileOffset = (FileOffset)method.Module.ToFileOffset((uint)headerRva);
         var rva = (RVA)((uint)headerRva + method.Body.HeaderSize);
         var fileOffset = (FileOffset)((long)headerFileOffset + method.Body.HeaderSize);
         this.CilBodyOptions = new CilBodyOptions((CilBody)method.MethodBody, headerRva, headerFileOffset, rva, fileOffset);
         this.BodyType = MethodBodyType.Cil;
     }
     else if (method.MethodBody is NativeMethodBody) {
         this.NativeMethodBodyOptions = new NativeMethodBodyOptions((NativeMethodBody)method.MethodBody);
         this.BodyType = MethodBodyType.Native;
     }
     else
         this.BodyType = MethodBodyType.None;
 }
Exemplo n.º 4
0
		public MethodBodyOptions(MethodDef method)
		{
			this.CodeType = method.CodeType;
			if (method.MethodBody is CilBody) {
				FileOffset fileOffset = 0;
				var mod = method.Module as ModuleDefMD;
				if (mod != null)
					fileOffset = mod.MetaData.PEImage.ToFileOffset(method.RVA);
				this.CilBodyOptions = new CilBodyOptions((CilBody)method.MethodBody, method.RVA, fileOffset);
				this.BodyType = MethodBodyType.Cil;
			}
			else if (method.MethodBody is NativeMethodBody) {
				this.NativeMethodBodyOptions = new NativeMethodBodyOptions((NativeMethodBody)method.MethodBody);
				this.BodyType = MethodBodyType.Native;
			}
			else
				this.BodyType = MethodBodyType.None;
		}
Exemplo n.º 5
0
 public MethodBodyOptions(MethodDef method)
 {
     this.CodeType = method.CodeType;
     if (method.MethodBody is CilBody)
     {
         var headerRva        = method.RVA;
         var headerFileOffset = (FileOffset)method.Module.ToFileOffset((uint)headerRva);
         var rva        = (RVA)((uint)headerRva + method.Body.HeaderSize);
         var fileOffset = (FileOffset)((long)headerFileOffset + method.Body.HeaderSize);
         this.CilBodyOptions = new CilBodyOptions((CilBody)method.MethodBody, headerRva, headerFileOffset, rva, fileOffset);
         this.BodyType       = MethodBodyType.Cil;
     }
     else if (method.MethodBody is NativeMethodBody)
     {
         this.NativeMethodBodyOptions = new NativeMethodBodyOptions((NativeMethodBody)method.MethodBody);
         this.BodyType = MethodBodyType.Native;
     }
     else
     {
         this.BodyType = MethodBodyType.None;
     }
 }
Exemplo n.º 6
0
 public MethodBodyOptions(MethodDef method)
 {
     this.CodeType = method.CodeType;
     if (method.MethodBody is CilBody)
     {
         FileOffset fileOffset = 0;
         var        mod        = method.Module as ModuleDefMD;
         if (mod != null)
         {
             fileOffset = mod.MetaData.PEImage.ToFileOffset(method.RVA);
         }
         this.CilBodyOptions = new CilBodyOptions((CilBody)method.MethodBody, method.RVA, fileOffset);
         this.BodyType       = MethodBodyType.Cil;
     }
     else if (method.MethodBody is NativeMethodBody)
     {
         this.NativeMethodBodyOptions = new NativeMethodBodyOptions((NativeMethodBody)method.MethodBody);
         this.BodyType = MethodBodyType.Native;
     }
     else
     {
         this.BodyType = MethodBodyType.None;
     }
 }
Exemplo n.º 7
0
 public void InitializeFrom(NativeMethodBodyOptions options)
 {
     this.RVA.Value = (uint)options.RVA;
 }
Exemplo n.º 8
0
 public NativeMethodBodyOptions CopyTo(NativeMethodBodyOptions options)
 {
     options.RVA = (dnlib.PE.RVA)(uint)this.RVA.Value;
     return options;
 }
Exemplo n.º 9
0
 public NativeMethodBodyOptions CopyTo(NativeMethodBodyOptions options)
 {
     options.RVA = (dnlib.PE.RVA)(uint) this.RVA.Value;
     return(options);
 }
Exemplo n.º 10
0
 public void InitializeFrom(NativeMethodBodyOptions options)
 {
     this.RVA.Value = (uint)options.RVA;
 }