@eniko @lofty For ELF PIE executables, take the highest value of ph.p_vaddr + ph.p_memsz from the PT_LOAD segments in the file
(This assumes that the PIE executable was linked at 0 but that’s the most common case; if it wasn’t, then subtract the lowest value of ph.p_vaddr from the previous)