Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose hard-coded dynamic load address for ELF sections #1515

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions manticore/platforms/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ class Linux(Platform):
# from /usr/include/asm-generic/resource.h
FCNTL_FDCWD = -100 # /* Special value used to indicate openat should use the cwd */

# Hard-coded base load address for dynamic elf binaries (ET_DYN in pyelftools)
BASE_DYN_ADDR_32 = 0x56555000
BASE_DYN_ADDR = 0x555555554000

def __init__(self, program, argv=None, envp=None, disasm="capstone", **kwargs):
"""
Builds a Linux OS platform
Expand Down Expand Up @@ -1003,9 +1007,9 @@ def load(self, filename, env):
if base == 0 and elf.header.e_type == "ET_DYN":
assert vaddr == 0
if addressbitsize == 32:
base = 0x56555000
base = self.BASE_DYN_ADDR_32
else:
base = 0x555555554000
base = self.BASE_DYN_ADDR

perms = perms_from_elf(flags)
hint = base + vaddr
Expand Down