MCPcopy Create free account
hub / github.com/lief-project/LIEF / parse

Method parse

src/COFF/Relocation.cpp:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29namespace LIEF::COFF {
30std::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
44std::string Relocation::to_string() const {
45 using fmt::format;

Callers

nothing calls this directly

Calls 1

from_valueFunction · 0.50

Tested by

no test coverage detected