@Override
	public boolean checkPointer(long ptr) {
		SectionHeader[] sections = fileHeader.getSectionHeaders();
		for (SectionHeader section : sections) {
			long virtPtr = Integer.toUnsignedLong(section.getVirtualAddress());
			long virtSize = Integer.toUnsignedLong(section.getVirtualSize());
			long rawSize = Integer.toUnsignedLong(section.getSizeOfRawData());
			long rawPtr = Integer.toUnsignedLong(section.getPointerToRawData());

			long sectionBasePtr = layout == SectionLayout.MEMORY ? virtPtr : rawPtr;
			long sectionSize = layout == SectionLayout.MEMORY ? virtSize : rawSize;

			if (ptr >= sectionBasePtr && ptr <= sectionBasePtr + sectionSize) { // <= allows data after the last section, which is OK
				return true;
			}
		}
		if (optionalHeader != null) {
			if (optionalHeader.getFileAlignment() == optionalHeader.getSectionAlignment()) {
				return checkRVA(ptr);
			}
		}
		return false;
	}
Converts a relative virtual address (RVA) into a pointer.
@param rva the relative virtual address
@return the pointer into binary image, -1 if not valid
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/NTHeader.java