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

Function findSegmentByType32

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

Source from the content-addressed store, hash-verified

358}
359
360[[nodiscard]]
361static inline const Elf32_Phdr *findSegmentByType32(const ElfView::ElfInfo &info, Elf32_Word type) {
362 const Elf32_Phdr *target = nullptr;
363 const auto *phdr = (const Elf32_Phdr *) info.phdr;
364 for (int i = 0; i < ((const Elf32_Ehdr *) info.ehdr)->e_phnum; i++) {
365 if (phdr[i].p_type == type) {
366 target = phdr + i;
367 break;
368 }
369 }
370 return target;
371}
372
373[[nodiscard]]
374static inline const Elf64_Phdr *findSegmentByType64(const ElfView::ElfInfo &info, Elf64_Word type) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected