radareorg / radare2-r2pipe

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

Cannot find R2PIPE_IN or R2PIPE_OUT environment #132

Closed josephkehoe closed 3 years ago

josephkehoe commented 3 years ago

Environment

Specify r2pipe language, version of the module, r2 version and OS/arch details.

24/02/2021 radare2 5.1.1 1 @ windows-x86-64 git.5.1.1 commit: 7516c079f0e903551574934b3ae428a5e907a101 build: Thu 02/11/2021__ 9:40:53.69

Windows 10 Education 10.0.19041 Build 19041

1.5.3 (r2pipe version)



## Description

When the included qt code (example r2pipe usage code from git) is run from Qt the following error occurs:

10:38:53: Starting C:\Users\KEHOEJ\Desktop\r2PipeCode\radare2-r2pipe-master\build-r2pipe-Desktop_Qt_6_0_1_MinGW_64_bit-Debug\debug\r2pipe.exe ...
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
Cannot find R2PIPE_IN or R2PIPE_OUT environment
10:38:53: C:\Users\KEHOEJ\Desktop\r2PipeCode\radare2-r2pipe-master\build-r2pipe-Desktop_Qt_6_0_1_MinGW_64_bit-Debug\debug\r2pipe.exe exited with code 0

(Exception thrown at line 12 of r2pipe.cxx)

<!-- Describe the issue and what would you expect to see -->
I am unfamiliar with the Windows Environment (a linux user) so I am not sure if this is a simple configuration error on my part or if something missing from the r2pipe installation.
I have only installed the binaries for radare2, not compiled from source, and am assuming the r2pipe is included as part of that binary.
Do I have to manually set the two environment variables? (R2PIPE_IN, R2PIPE_OUT)

Thanks,
Joseph.
## Test

<!-- Provide an example to reproduce the issue -->
trufae commented 3 years ago

Those variavkes are set by r2. This program must be executed from the r2 shell like this:

$ radare2 -i r2pipe-program.exe foo.exe

or

$ radare2 foo.exe
> #!pipe r2pipe-program.exe
josephkehoe commented 3 years ago

Thanks again for the help. Have gone through your solution. Joseph.