Lines Matching refs:RVA
219 bool DisassemblerWin32X86::ParseRelocs(std::vector<RVA> *relocs) {
246 RVA page_rva = ReadU32(block, 0);
265 RVA rva = page_rva + offset;
267 relocs->push_back(rva);
284 const Section* DisassemblerWin32X86::RVAToSection(RVA rva) const {
287 uint32 offset = rva - section->virtual_address;
295 int DisassemblerWin32X86::RVAToFileOffset(RVA rva) const {
296 const Section* section = RVAToSection(rva);
298 uint32 offset = rva - section->virtual_address;
306 // Small RVA values point into the file header in the loaded image.
307 // RVA 0 is the module load address which Windows uses as the module handle.
308 // RVA 2 sometimes occurs, I'm not sure what it is, but it would map into the
310 if (rva == 0 || rva == 2)
311 return rva;
317 const uint8* DisassemblerWin32X86::RVAToPointer(RVA rva) const {
318 int file_offset = RVAToFileOffset(rva);
376 RVA rva = abs32_locations_[i];
378 uint32 target_address = Read32LittleEndian(RVAToPointer(rva));
405 std::map<RVA, int>::iterator abs32_iter = abs32_target_rvas_.begin();
406 std::map<RVA, int>::iterator rel32_iter = rel32_target_rvas_.begin();
431 RVA relocs_start_rva = base_relocation_table().address_;
436 RVA start_rva = FileOffsetToRVA(start_file_offset);
437 RVA end_rva = start_rva + section->virtual_size;
439 // Quick way to convert from Pointer to RVA within a single Section is to
443 std::vector<RVA>::iterator abs32_pos = abs32_locations_.begin();
448 RVA current_rva = static_cast<RVA>(p - adjust_pointer_to_rva);
477 RVA rel32_rva = static_cast<RVA>(rel32 - adjust_pointer_to_rva);
493 RVA target_rva = rel32_rva + 4 + Read32LittleEndian(rel32);
535 RVA relocs_start_rva = base_relocation_table().address_;
540 RVA start_rva = FileOffsetToRVA(start_file_offset);
541 RVA end_rva = start_rva + section->virtual_size;
543 // Quick way to convert from Pointer to RVA within a single Section is to
547 std::vector<RVA>::iterator rel32_pos = rel32_locations_.begin();
548 std::vector<RVA>::iterator abs32_pos = abs32_locations_.begin();
556 RVA current_rva = static_cast<RVA>(p - adjust_pointer_to_rva);
576 RVA target_rva = target_address - image_base();
589 RVA target_rva = current_rva + 4 + Read32LittleEndian(p);
619 const std::map<RVA, int>& map) {
621 std::map<int, std::vector<RVA> > h;
622 for (std::map<RVA, int>::const_iterator p = map.begin();
636 for (std::map<int, std::vector<RVA> >::reverse_iterator p = h.rbegin();
664 std::string DisassemblerWin32X86::DescribeRVA(RVA rva) const {
665 const Section* section = RVAToSection(rva);
667 s << std::hex << rva;
671 << std::hex << (rva - section->virtual_address)
693 RVA DisassemblerWin32X86::FileOffsetToRVA(uint32 file_offset) const {
716 RVA rva = ReadU32(data_directory, 0);
721 // TODO(sra): validate RVA.
722 directory->address_ = rva;