| 402 | |
| 403 | template<class T> |
| 404 | [[nodiscard]] |
| 405 | static bool getSegmentInfoFromFileMemMap64(const ElfView::ElfInfo &info, Elf64_Word type, |
| 406 | const Elf64_Phdr **ppPhdr, Elf64_Xword *pSize, T *data) { |
| 407 | auto *_phdr = findSegmentByType64(info, type); |
| 408 | if (_phdr) { |
| 409 | *ppPhdr = _phdr; |
| 410 | *data = reinterpret_cast<T>((info.handle) + _phdr->p_offset); |
| 411 | *pSize = _phdr->p_filesz; |
| 412 | return true; |
| 413 | } else { |
| 414 | *ppPhdr = nullptr; |
| 415 | *pSize = 0; |
| 416 | return false; |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | int ElfView::getElfInfo(ElfInfo &info) const { |
| 421 | info.handle = static_cast<const uint8_t *>(mRva.address); |
no test coverage detected