| 385 | |
| 386 | template<class T> |
| 387 | [[nodiscard]] |
| 388 | static bool getSegmentInfoFromFileMemMap32(const ElfView::ElfInfo &info, Elf32_Word type, |
| 389 | const Elf32_Phdr **ppPhdr, Elf32_Word *pSize, T *data) { |
| 390 | auto *_phdr = findSegmentByType32(info, type); |
| 391 | if (_phdr) { |
| 392 | *ppPhdr = _phdr; |
| 393 | *data = reinterpret_cast<T>((info.handle) + _phdr->p_offset); |
| 394 | *pSize = _phdr->p_filesz; |
| 395 | return true; |
| 396 | } else { |
| 397 | *ppPhdr = nullptr; |
| 398 | *pSize = 0; |
| 399 | return false; |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | template<class T> |
| 404 | [[nodiscard]] |
no test coverage detected