21 lines
722 B
C++
21 lines
722 B
C++
#include <print>
|
|
#include <elfio/elfio.hpp>
|
|
#include <ircolib/mem_access.hpp>
|
|
|
|
int main() {
|
|
ELFIO::elfio reader;
|
|
if (!reader.load("tests/elf/application.elf"))
|
|
return 1;
|
|
|
|
for (const auto §ion : reader.sections) {
|
|
for (const auto &segment : reader.segments) {
|
|
if (ircolib::IsInsideRange(section->get_address(), segment->get_virtual_address(),
|
|
segment->get_virtual_address() + segment->get_memory_size() - 1))
|
|
std::println("Found section {} @ 0x{:08X} -> 0x{:08X}", section->get_index(), section->get_address(),
|
|
section->get_address() + section->get_size() - 1);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|