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

Method DerefPpc64Descriptor

view/elf/elfview.cpp:2666–2686  ·  view source on GitHub ↗

http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES

Source from the content-addressed store, hash-verified

2664
2665// http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES
2666bool ElfView::DerefPpc64Descriptor(BinaryReader& reader, uint64_t addr, uint64_t& result)
2667{
2668 /* must be 64-bit ELF, arch PPC64 */
2669 if (m_elf32 || m_commonHeader.arch != EM_PPC64)
2670 return false;
2671
2672 /* .opd section must exist */
2673 if (!m_sectionOpd.size)
2674 return false;
2675
2676 /* addr must be within .opd section */
2677 if (addr < m_sectionOpd.address || addr >= m_sectionOpd.address + m_sectionOpd.size)
2678 return false;
2679
2680 /* dereference descriptor to get function entry */
2681 uint64_t saved = reader.GetOffset();
2682 reader.Seek(m_sectionOpd.offset + (addr - m_sectionOpd.address));
2683 bool read_success = reader.TryRead64(result);;
2684 reader.Seek(saved);
2685 return read_success;
2686}
2687
2688
2689void ElfView::ParseMiniDebugInfo()

Callers

nothing calls this directly

Calls 3

TryRead64Method · 0.80
GetOffsetMethod · 0.45
SeekMethod · 0.45

Tested by

no test coverage detected