コード例 #1
0
        public long ResolvePositionToSectionData(uint rva, out PESection section)
        {
            section = FindSection(rva);
            if (section == null)
            {
                throw new BadImageFormatException(string.Format(SR.ResolveImageSectionFailure, rva));
            }

            return(section.GetPointerToRawData(rva));
        }
コード例 #2
0
        public bool ResolvePositionToSectionData(uint rva, out long offset, out PESection section)
        {
            section = FindSection(rva);
            if (section == null)
            {
                offset = 0;
                return(false);
            }

            offset = section.GetPointerToRawData(rva);
            return(true);
        }
コード例 #3
0
        public virtual bool TryOpenImageToSectionData(uint rva, out IBinaryAccessor accessor, out PESection section)
        {
            section = FindSection(rva);
            if (section == null)
            {
                accessor = null;
                return(false);
            }

            long position = section.GetPointerToRawData(rva);

            accessor          = OpenImage();
            accessor.Position = position;

            return(true);
        }