radareorg / radare2-r2pipe

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

Fix Windows Python 3 #!pipe #117

Closed kazarmy closed 4 years ago

kazarmy commented 4 years ago

Detailed description

This pr makes the following changes/fixes to the Python 3 Windows #!pipe code:

  1. The R2PIPE_PATH env var already contains the full path to the named pipe, so a prefix shouldn't be added to it.
  2. Need to use the W versions of the Win32 api for Python 3 strings.
  3. Need to encode the r2 command in utf-8 first before sending it down the pipe to r2.
  4. Removed the e scr.color=false invocation for consistency with non-Windows code.
  5. Better error messaging.

Unfortunately, this pr is necessary but not sufficient for correct #!pipe operation on Windows, but can this pr be merged in first and the version bumped?

This is the companion pr to radareorg/radare2#17139.

Test plan

See radareorg/radare2#17139 for a test script.

Closing issues

...

kazarmy commented 4 years ago

The companion pr on the r2 side is radareorg/radare2#17139.

kazarmy commented 4 years ago

Updated the description.

kazarmy commented 4 years ago

Sorry, "r2pipe" was too broad ... "#!pipe" is more accurate