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

[cmd] Allow for filtering about maps permissions in vmmap #1111

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions docs/commands/vmmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ differs from one architecture to another (this is one of the main reasons I star
place). For example, you can learn that ELF running on SPARC architectures always have their `.data`
and `heap` sections set as Read/Write/Execute.

`vmmap` accepts one argument, either a pattern to match again mapping names, or an address to
determine which section it belongs to.
`vmmap` accepts one argument, either a pattern to match again mapping names, an address to determine
which section it belongs to, or the permissions of the sections to match.

![vmmap-grep](https://i.imgur.com/ZFF4QVf.png)

Expand Down
6 changes: 6 additions & 0 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -8791,6 +8791,12 @@ def do_invoke(self, argv: List[str]) -> None:
addr = int(argv[0], 0)
if addr >= entry.page_start and addr < entry.page_end:
self.print_entry(entry)
elif argv[0][0] in 'r-' and \
ValekoZ marked this conversation as resolved.
Show resolved Hide resolved
argv[0][1] in 'w-' and \
argv[0][2] in 'x-':
ValekoZ marked this conversation as resolved.
Show resolved Hide resolved
perms = Permission.from_process_maps(argv[0])
if entry.permission == perms:
self.print_entry(entry)
else:
addr = safe_parse_and_eval(argv[0])
if addr is not None and addr >= entry.page_start and addr < entry.page_end:
Expand Down
Loading