예제 #1
0
		public NativeMethodBodyVM(NativeMethodBodyOptions options, bool initialize) {
			origOptions = options;
			RVA = new UInt32VM(a => HasErrorUpdated());

			if (initialize)
				Reinitialize();
		}
예제 #2
0
        public NativeMethodBodyVM(NativeMethodBodyOptions options, bool initialize)
        {
            this.origOptions = options;
            this.rva         = new UInt32VM(a => HasErrorUpdated());

            if (initialize)
            {
                Reinitialize();
            }
        }
예제 #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;
		}
예제 #4
0
 public MethodBodyOptions(MethodDef method)
 {
     CodeType = method.CodeType;
     if (method.MethodBody is CilBody cilBody)
     {
         var headerRva        = method.RVA;
         var headerFileOffset = (FileOffset)(method.Module.ToFileOffset((uint)headerRva) ?? (uint)headerRva);
         var rva        = headerRva + method.Body.HeaderSize;
         var fileOffset = headerFileOffset + method.Body.HeaderSize;
         CilBodyOptions = new CilBodyOptions(cilBody, headerRva, headerFileOffset, rva, fileOffset);
         BodyType       = MethodBodyType.Cil;
     }
     else if (method.MethodBody is NativeMethodBody nativeBody)
     {
         NativeMethodBodyOptions = new NativeMethodBodyOptions(nativeBody);
         BodyType = MethodBodyType.Native;
     }
     else
     {
         BodyType = MethodBodyType.None;
     }
 }
예제 #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;
     }
 }
예제 #6
0
 public NativeMethodBodyOptions CopyTo(NativeMethodBodyOptions options)
 {
     options.RVA = (dnlib.PE.RVA)(uint) this.RVA.Value;
     return(options);
 }
예제 #7
0
 public void InitializeFrom(NativeMethodBodyOptions options)
 {
     this.RVA.Value = (uint)options.RVA;
 }
예제 #8
0
 public void InitializeFrom(NativeMethodBodyOptions options)
 {
     this.RVA.Value = (uint)options.RVA;
 }
예제 #9
0
 public NativeMethodBodyOptions CopyTo(NativeMethodBodyOptions options)
 {
     options.RVA = (dnlib.PE.RVA)(uint)this.RVA.Value;
     return options;
 }