radareorg / radare2-r2pipe

Access radare2 via pipe from any programming language!
388 stars 99 forks source link

Python: Opening a file in a subdirectory called "tcp" raises exception #114

Closed haystack-ia closed 4 years ago

haystack-ia commented 4 years ago

Describe the issue

Opening a file in a directory called "tcp" (and presumably "http" after looking at the code) raises an exception.

How to reproduce?

Asciinema link here: https://asciinema.org/a/2UqHIBaaVHD1cCjsGWI7MA5po

Expected behavior

Opening a file in a directory named "tcp" or "http" should be handled.

Possible fix

Change lines 52 and 64 in open_async.py, and lines 33 and 39 in open_sync.py, to check for "http://" and "tcp://" rather than "http" and "tcp" at the beginning of the line. The check for ccall already follows this format.