TUP.AsmResolver.Offset.ToMethod C# (CSharp) Méthode

ToMethod() public méthode

Converts the offset to an imported or exported method/
public ToMethod ( Win32Assembly assembly ) : IMethod
assembly Win32Assembly The assembly that contains the offset
Résultat IMethod
        public IMethod ToMethod(Win32Assembly assembly)
        {
            foreach (LibraryReference lib in assembly.LibraryImports)
                foreach (ImportMethod method in lib.ImportMethods)
                {
                    if (method.RVA + assembly._ntHeader.OptionalHeader.ImageBase == Va)
                        return method;
                }
            foreach (ExportMethod method in assembly.LibraryExports)
            {
                if (Va == method.RVA + assembly._ntHeader.OptionalHeader.ImageBase)
                    return method;
            }

            throw new ArgumentException("No matching method has been found.");
        }