Repository: pwndbg/pwndbg

Issue:
piebase, breakrva does not work if the path to binary contains space
<!--
Before reporting a new issue, make sure that we do not have any duplicates already open.
If there is one it might be good to take part in the discussion there.

Please make sure you have checked that the issue persists on LATEST pwndbg version.

Below is a template for BUG REPORTS.
Don't include it if this is a FEATURE REQUEST.
-->


### Description
`vmmap` does not recognize the path of the binary if the path contains a space.
Consequently, commands like `piebase` and `breakrva` does not work as it relies on `vmmap`.


<!--
Briefly describe the problem you are having in a few paragraphs.
-->

### Steps to reproduce

Path without a space:
`/home/kp/Downloads/good/babystack`
![image](https://user-images.githubusercontent.com/10012884/70852451-8e8c8b80-1e6f-11ea-809b-5fdf60b0b4a1.png)

Path with a space:
`/home/kp/Downloads/no good/babystack`
![image](https://user-images.githubusercontent.com/10012884/70852468-b8de4900-1e6f-11ea-9be8-aa37169a03c0.png)



<!--
What do we have to do to reproduce the problem?
If this is connected to particular C/asm code, 
please provide the smallest C code that reproduces the issue.
-->

### My setup

OS: Ubuntu 18.04
Gdb:      8.3.1
Python:   2.7.15+ (default, Oct  7 2019, 17:39:04)  [GCC 7.4.0]
Pwndbg:   1.1.0 build: e650f92
Capstone: 4.0.1024
Unicorn:  1.0.1

<!--
Show us your gdb/python/pwndbg/OS/IDA Pro version (depending on your case).

NOTE: We are currently supporting only Ubuntu installations.
It is known that pwndbg is not fully working e.g. on Arch Linux (the heap stuff is not working there).
If you would like to change this situation - help us improving pwndbg and supporting other distros!

This can be displayed in pwndbg through `version` command.

If it is somehow unavailable, use:
* `show version` - for gdb
* `py import sys; print(sys.version)` - for python
* pwndbg version/git commit id
-->
piebase, breakrva does not work if the path to binary contains space
<!--
Before reporting a new issue, make sure that we do not have any duplicates already open.
If there is one it might be good to take part in the discussion there.

Please make sure you have checked that the issue persists on LATEST pwndbg version.

Below is a template for BUG REPORTS.
Don't include it if this is a FEATURE REQUEST.
-->


### Description
`vmmap` does not recognize the path of the binary if the path contains a space.
Consequently, commands like `piebase` and `breakrva` does not work as it relies on `vmmap`.


<!--
Briefly describe the problem you are having in a few paragraphs.
-->

### Steps to reproduce

Path without a space:
`/home/kp/Downloads/good/babystack`
![image](https://user-images.githubusercontent.com/10012884/70852451-8e8c8b80-1e6f-11ea-809b-5fdf60b0b4a1.png)

Path with a space:
`/home/kp/Downloads/no good/babystack`
![image](https://user-images.githubusercontent.com/10012884/70852468-b8de4900-1e6f-11ea-9be8-aa37169a03c0.png)



<!--
What do we have to do to reproduce the problem?
If this is connected to particular C/asm code, 
please provide the smallest C code that reproduces the issue.
-->

### My setup

OS: Ubuntu 18.04
Gdb:      8.3.1
Python:   2.7.15+ (default, Oct  7 2019, 17:39:04)  [GCC 7.4.0]
Pwndbg:   1.1.0 build: e650f92
Capstone: 4.0.1024
Unicorn:  1.0.1

<!--
Show us your gdb/python/pwndbg/OS/IDA Pro version (depending on your case).

NOTE: We are currently supporting only Ubuntu installations.
It is known that pwndbg is not fully working e.g. on Arch Linux (the heap stuff is not working there).
If you would like to change this situation - help us improving pwndbg and supporting other distros!

This can be displayed in pwndbg through `version` command.

If it is somehow unavailable, use:
* `show version` - for gdb
* `py import sys; print(sys.version)` - for python
* pwndbg version/git commit id
-->


Discussion:

Resolving patch:
diff --git a/pwndbg/vmmap.py b/pwndbg/vmmap.py
--- a/pwndbg/vmmap.py
+++ b/pwndbg/vmmap.py
@@ -207,7 +207,7 @@ def proc_pid_maps():
     for line in data.splitlines():
         maps, perm, offset, dev, inode_objfile = line.split(None, 4)
 
-        try:    inode, objfile = inode_objfile.split()
+        try:    inode, objfile = inode_objfile.split(None, 1)
         except: objfile = ''
 
         start, stop = maps.split('-')


Test patch: