| 28 | |
| 29 | namespace LIEF::COFF { |
| 30 | std::unique_ptr<Relocation> Relocation::parse( |
| 31 | BinaryStream& stream, Header::MACHINE_TYPES arch) |
| 32 | { |
| 33 | auto raw_reloc = stream.read<details::relocation>(); |
| 34 | if (!raw_reloc) { |
| 35 | return nullptr; |
| 36 | } |
| 37 | auto reloc = std::unique_ptr<Relocation>(new Relocation()); |
| 38 | reloc->address_ = raw_reloc->VirtualAddress; |
| 39 | reloc->symbol_idx_ = raw_reloc->SymbolTableIndex; |
| 40 | reloc->type_ = from_value(raw_reloc->Type, arch); |
| 41 | return reloc; |
| 42 | } |
| 43 | |
| 44 | std::string Relocation::to_string() const { |
| 45 | using fmt::format; |
nothing calls this directly
no test coverage detected