elf-d icon indicating copy to clipboard operation
elf-d copied to clipboard

Add segments view

Open luismarques opened this issue 8 years ago • 2 comments

Could you please add a segments view, like the sections view?

luismarques avatar Mar 15 '17 17:03 luismarques

Sadly, I don't have time to implement that now. But I will accept a pull request for it. It should be easy to follow the same structure in the code.

yazd avatar Mar 19 '17 18:03 yazd

I'm also very restricted on time for the next month or so, but let me just add that it's easy to iterate the segments based on what elf-d already provides, in case anybody else needs it:

ELF e = ELF.fromFile(elfFile);
auto pho = e.header.programHeaderOffset;
auto num = e.header.numberOfProgramHeaderEntries;
ubyte[] bin = cast(ubyte[]) std.file.read(elfFile);
Elf32_Phdr* ph = cast(Elf32_Phdr*) (bin[pho .. pho + Elf32_Phdr.sizeof]).ptr;
foreach(p; ph[0..num])
    ...

luismarques avatar Mar 31 '17 12:03 luismarques