R_API PE_DWord PE_(va2pa)(RBinPEObj* pe, PE_DWord rva) {
	PE_DWord section_base;
	int i, section_size;
	ut32 image_base = pe->nt_headers->optional_header.ImageBase;
	if (rva > image_base) {
		rva -= image_base;
	}
	for (i = 0; i < pe->num_sections; i++) {
		section_base = pe->sections[i].vaddr;
		section_size = pe->sections[i].vsize;
		if (rva >= section_base && rva < section_base + section_size) {
			return pe->sections[i].paddr + (rva - section_base);
		}
	}
	return rva;
}
R_API PE_DWord PE_(va2pa)(RBinPEObj* pe, PE_DWord rva) {
	PE_DWord section_base;
	int i, section_size;
	ut32 image_base = pe->nt_headers->optional_header.ImageBase;
	if (rva > image_base) {
		rva -= image_base;
	}
	for (i = 0; i < pe->num_sections; i++) {
		section_base = pe->sections[i].vaddr;
		section_size = pe->sections[i].vsize;
		if (rva >= section_base && rva < section_base + section_size) {
			return pe->sections[i].paddr + (rva - section_base);
		}
	}
	return rva;
}