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

update avatar_gdb.get_mappings() #28

Merged
merged 1 commit into from Aug 23, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion angr_targets/memory_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ class MemoryMap:
Describing a memory range inside the concrete
process.
"""
def __init__(self, start_address, end_address, offset, name):
def __init__(self, start_address, end_address, offset, name, perms):
self.start_address = start_address
self.end_address = end_address
self.offset = offset
self.name = name
self.perms = perms

def __str__(self):
my_str = "MemoryMap[start_address: 0x%x | end_address: 0x%x | name: %s" \
% (self.start_address,
self.end_address,
self.name)
if self.perms:
my_str += " | perms: %s"%self.perms

return my_str
10 changes: 8 additions & 2 deletions angr_targets/targets/avatar_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,16 @@ def get_mappings(self):
offset = map[3].replace("\\n", '')
offset = offset.replace("\\t", '')
offset = int(offset, 16)
map_name = map[4].replace("\\n", '')
if len(map) > 5:
perms = map[4].replace("\\n", '')
perms = perms.replace("\\t", '')
map_name = map[5].replace("\\n", '')
else:
perms = None
map_name = map[4].replace("\\n", '')
map_name = map_name.replace("\\t", '')
map_name = os.path.basename(map_name)
vmmap.append(MemoryMap(map_start_address, map_end_address, offset, map_name))
vmmap.append(MemoryMap(map_start_address, map_end_address, offset, map_name, perms))
except (IndexError, ValueError):
l.debug("Can't process this vmmap entry")
pass
Expand Down