MCPcopy Create free account
hub / github.com/cinit/TMoe / getSegmentInfoFromFileMemMap64

Function getSegmentInfoFromFileMemMap64

app/src/main/cpp/utils/elfsym/ElfView.cpp:404–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402
403template<class T>
404[[nodiscard]]
405static 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
420int ElfView::getElfInfo(ElfInfo &info) const {
421 info.handle = static_cast<const uint8_t *>(mRva.address);

Callers 1

getElfInfoMethod · 0.85

Calls 1

findSegmentByType64Function · 0.85

Tested by

no test coverage detected