VaToRva() публичный Метод

Transforms a virtual address to a relative virtual address.
public VaToRva ( ulong va ) : uint
va ulong The virtual address to convert.
Результат uint
Пример #1
0
        /// <summary>
        /// Creates an instance of an offset by specifying a virtual address.
        /// </summary>
        /// <param name="va">The virtual address.</param>
        /// <param name="assembly">The assembly containing the offset.</param>
        /// <returns></returns>
        public static Offset FromVa(ulong va, Win32Assembly assembly)
        {
            if (va == 0)
            {
                return(new Offset(0, 0, 0));
            }
            if (assembly == null)
            {
                return(new Offset(0, 0, va));
            }
            OffsetConverter offsetconverter = CreateConverter(assembly, va, 3);

            return(new Offset(offsetconverter.VaToFileOffset(va), offsetconverter.VaToRva(va), va));
        }
Пример #2
0
 /// <summary>
 /// Creates an instance of an offset by specifying a virtual address.
 /// </summary>
 /// <param name="va">The virtual address.</param>
 /// <param name="assembly">The assembly containing the offset.</param>
 /// <returns></returns>
 public static Offset FromVa(ulong va, Win32Assembly assembly)
 {
     if (va == 0)
         return new Offset(0, 0, 0, ASM.OperandType.Normal);
     OffsetConverter offsetconverter = new OffsetConverter(Section.GetSectionByRva(assembly, (uint)(va - assembly.NTHeader.OptionalHeader.ImageBase)));
     return new Offset(offsetconverter.VaToFileOffset(va), offsetconverter.VaToRva(va), va, ASM.OperandType.Normal);
 }