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

Fix vmmap failed due to libc args dict #818

Closed
wants to merge 1 commit into from
Closed

Fix vmmap failed due to libc args dict #818

wants to merge 1 commit into from

Conversation

zhouzq-thu
Copy link
Contributor

@zhouzq-thu zhouzq-thu commented Feb 6, 2022

Fix vmmap failed due to libc args dict

Description

If turn gef-extras.libc_args on, e.g.

libc_args = True
libc_args_path = ~/gef-extras/glibc-function-args

vmmap will be failed as follows:

gef➤  vmmap 
[ Legend:  Code | Heap | Stack ]
Start              End                Offset             Perm Path
0x00555555554000 0x00555555556000 0x00000000000000 r-x /home/zhou/Desktop/girlfriend
0x00555555755000 0x00555555756000 0x00000000001000 r-- /home/zhou/Desktop/girlfriend
0x00555555756000 0x00555555757000 0x00000000002000 rw- /home/zhou/Desktop/girlfriend
[!] Command 'vmmap' failed to execute properly, reason: 'dict' object has no attribute 'split'

Reason

This is caused by the loop for match, color in gef.ui.highlight_table.items():.
However, highlight_table[_arch_mode] is a dict.

After patch

gef➤  vmmap 
[ Legend:  Code | Heap | Stack ]
Start              End                Offset             Perm Path
0x00555555554000 0x00555555556000 0x00000000000000 r-x /home/zhou/Desktop/girlfriend
0x00555555755000 0x00555555756000 0x00000000001000 r-- /home/zhou/Desktop/girlfriend
0x00555555756000 0x00555555757000 0x00000000002000 rw- /home/zhou/Desktop/girlfriend
0x007ffff79e2000 0x007ffff7bc9000 0x00000000000000 r-x /lib/x86_64-linux-gnu/libc-2.27.so
0x007ffff7bc9000 0x007ffff7dc9000 0x000000001e7000 --- /lib/x86_64-linux-gnu/libc-2.27.so
0x007ffff7dc9000 0x007ffff7dcd000 0x000000001e7000 r-- /lib/x86_64-linux-gnu/libc-2.27.so
0x007ffff7dcd000 0x007ffff7dcf000 0x000000001eb000 rw- /lib/x86_64-linux-gnu/libc-2.27.so
0x007ffff7dcf000 0x007ffff7dd3000 0x00000000000000 rw- 
0x007ffff7dd3000 0x007ffff7dfc000 0x00000000000000 r-x /lib/x86_64-linux-gnu/ld-2.27.so
0x007ffff7feb000 0x007ffff7fed000 0x00000000000000 rw- 
0x007ffff7ff7000 0x007ffff7ffa000 0x00000000000000 r-- [vvar]
0x007ffff7ffa000 0x007ffff7ffc000 0x00000000000000 r-x [vdso]
0x007ffff7ffc000 0x007ffff7ffd000 0x00000000029000 r-- /lib/x86_64-linux-gnu/ld-2.27.so
0x007ffff7ffd000 0x007ffff7ffe000 0x0000000002a000 rw- /lib/x86_64-linux-gnu/ld-2.27.so
0x007ffff7ffe000 0x007ffff7fff000 0x00000000000000 rw- 
0x007ffffffde000 0x007ffffffff000 0x00000000000000 rw- [stack]
0xffffffffff600000 0xffffffffff601000 0x00000000000000 r-x [vsyscall]

@hugsy
Copy link
Owner

hugsy commented Feb 6, 2022

Hi,

Thanks for the PR. This issue is already fixed in the PR #813 which is about to be merged in dev. That PR also adds proper tests so we can detect and avoid such issues in the future.

Cheers

@hugsy
Copy link
Owner

hugsy commented Feb 14, 2022

#813 is now merged. Your issue should be fixed in the dev branch, and will be applied to the master branch at the next release. Thanks!

@hugsy hugsy closed this Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants