public long rvaToPointer(long rva) {
		SectionHeader[] sections = fileHeader.getSectionHeaders();
		for (SectionHeader section : sections) {
			long sectionVA = Integer.toUnsignedLong(section.getVirtualAddress());
			long vSize = Integer.toUnsignedLong(section.getVirtualSize());
			long rawPtr = Integer.toUnsignedLong(section.getPointerToRawData());
			long rawSize = Integer.toUnsignedLong(section.getSizeOfRawData());

			switch (layout) {
				case MEMORY:
					return rva;
				case FILE:
				default:
					if (rva >= sectionVA && rva < sectionVA + vSize) {
						// NOTE: virtual size is used in the above check because it's already been
						// adjusted for special-case scenarios when the sections were first 
						// processed in FileHeader.java
						long ptr = rva + rawPtr - sectionVA;

						// Make sure the pointer points to actual section file byte, rather than
						// padding bytes
						if (ptr >= rawPtr + rawSize) {
							return -1;
						}

						return ptr;
					}
					break;
			}
		}
		//
		//low alignment mode?
		//
		if (optionalHeader != null) {
			if (optionalHeader.getFileAlignment() == optionalHeader.getSectionAlignment() &&
				optionalHeader.getSectionAlignment() < 800 &&
				optionalHeader.getFileAlignment() > 1) {
				return rva;
			}
		}
		return -1;
	}
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