Land #3780, msfelfscan use correct offsets

bug/bundler_fix
Tod Beardsley 2014-09-11 15:28:18 -05:00
commit 0ed7f19eb2
No known key found for this signature in database
GPG Key ID: 1EFFB682ADB9F193
2 changed files with 10 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class Elf < ElfBase
isource.read(offset, PROGRAM_HEADER_SIZE), ei_data
)
if program_header[-1].p_type == PT_LOAD && base_addr == 0
if program_header[-1].p_type == PT_LOAD && program_header[-1].p_flags & PF_EXEC > 0
base_addr = program_header[-1].p_vaddr
end

View File

@ -214,6 +214,15 @@ class ElfBase
[ 'uint32n', 'p_align', 0 ]
)
# p_flags This member tells which permissions should have the segment
# Flags
PF_EXEC = 1
PF_WRITE = 2
PF_READ = 4
#
# p_type This member tells what kind of segment this array element
# describes or how to interpret the array element's information.