MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / GetRelocEntries

Method GetRelocEntries

view/elf/elfview.cpp:411–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411void ElfView::GetRelocEntries(BinaryReader& reader, const vector<Elf64SectionHeader>& sections,
412 bool implicit, vector<ELFRelocEntry>& result)
413{
414 size_t relocSize = m_elf32 ? 8 : 16;
415 if (!implicit)
416 relocSize += m_elf32 ? 4 : 8;
417
418 for (auto& section : sections)
419 {
420 for (uint64_t j = 0; j < section.size / relocSize; j++)
421 {
422 reader.Seek(section.offset + (j * relocSize));
423 uint64_t ofs = m_elf32 ? reader.Read32() : reader.Read64();
424 uint64_t info = m_elf32 ? reader.Read32() : reader.Read64();
425 uint64_t addend = 0;
426 if (!implicit)
427 addend = m_elf32 ? reader.Read32() : reader.Read64();
428
429 result.push_back(ELFRelocEntry(ofs, info >> (m_elf32 ? 8 : 32), info & (m_elf32 ? 0xff : 0xffffffff),
430 addend, section.info, implicit));
431 }
432 }
433}
434
435static bool In(const string& str, const vector<string>& list)
436{

Callers

nothing calls this directly

Calls 5

ELFRelocEntryClass · 0.85
push_backMethod · 0.80
SeekMethod · 0.45
Read32Method · 0.45
Read64Method · 0.45

Tested by

no test coverage detected