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

Installing and using plugins under Windows does not work #24074

Open
stevenengland opened this issue Mar 17, 2025 · 14 comments
Open

Installing and using plugins under Windows does not work #24074

stevenengland opened this issue Mar 17, 2025 · 14 comments

Comments

@stevenengland
Copy link

Environment

Windows 11 vm

Description

When installing plugins, some installations are running without an error, others throw errors. After a successful installation the plugin cannot be used unfortunately.

This is true for a precompiled set of binaries as well as for a fresh built installation:

Example for a working installation but where the invocation fails:

(venv) C:\Users\vboxuser\Desktop\radare2_compiled\prefix\bin>r2pm -ci r2ai
INFO: Cleaning r2ai
INFO: Using r2-5.9.9 and r2pm-5.9.9
INFO: Cleaning r2ai
INFO: git clone --depth=1 --recursive https://github.com/radareorg/r2ai C:\Users\vboxuser\.local\share\radare2\r2pm/git\r2ai
Cloning into 'C:\Users\vboxuser\.local\share\radare2\r2pm/git\r2ai'...
remote: Enumerating objects: 163, done.
remote: Counting objects: 100% (163/163), done.
remote: Compressing objects: 100% (150/150), done.
remote: Total 163 (delta 8), reused 97 (delta 3), pack-reused 0 (from 0)
Receiving objects: 100% (163/163), 2.15 MiB | 5.51 MiB/s, done.
Resolving deltas: 100% (8/8), done.
INFO: Starting install for r2ai


(venv) C:\Users\vboxuser\Desktop\radare2_compiled\prefix\bin>r2pm -r r2ai
The command "r2ai" is either misspelled or could not be found

Example where even the plugin installation fails:

(venv) C:\Users\vboxuser\Desktop\radare2_compiled\prefix\bin>r2pm -ci decai
INFO: Cleaning decai
INFO: Using r2-5.9.9 and r2pm-5.9.9
INFO: Cleaning decai
INFO: git clone --depth=1 --recursive https://github.com/radareorg/r2ai C:\Users\vboxuser\.local\share\radare2\r2pm/git\decai
Cloning into 'C:\Users\vboxuser\.local\share\radare2\r2pm/git\decai'...
remote: Enumerating objects: 163, done.
remote: Counting objects: 100% (163/163), done.
remote: Compressing objects: 100% (150/150), done.
remote: Total 163 (delta 8), reused 97 (delta 3), pack-reused 0 (from 0)
Receiving objects: 100% (163/163), 2.15 MiB | 5.48 MiB/s, done.
Resolving deltas: 100% (8/8), done.
INFO: Starting install for decai
ERROR: This package does not have R2PM_INSTALL_WINDOWS instructions
@trufae
Copy link
Collaborator

trufae commented Mar 17, 2025

you can copy the script into the plugin directory by hand. but the script should add the rule for install_windows to work in windows. can you give it a try by modifying the file and sending a PR?

@trufae
Copy link
Collaborator

trufae commented Mar 18, 2025

Let me rephrase it. This is a problem related to the packages itself and not to r2pm. It will be good that the most used packages are supported on windows by having the target script.

Would you like to edit those packages and write those batch scripts?

Heres an example: https://github.com/radareorg/radare2-pm/blob/master/db/r2frida

@trufae
Copy link
Collaborator

trufae commented Mar 18, 2025

I agree that r2pm may stop earlier and not clone a repo if the pkg doesnt contain the windows scripts. This is something I can fix in here

@stevenengland
Copy link
Author

Okay, thanks for further explanation. I cannot promise anything but I will have a look. This is all related to the decai example from above, correct?

I will also have a look for the other case where the installation succeeds but then the plugin cannot be called. Like it is illustrated above for the r2ai plugin.

@trufae
Copy link
Collaborator

trufae commented Mar 19, 2025

i just did the windows scripts for decai, but i have no windows/time to test it, give it a try and let me know if it works now

@trufae
Copy link
Collaborator

trufae commented Mar 19, 2025

also this 4787cbf

@stevenengland
Copy link
Author

i just did the windows scripts for decai, but i have no windows/time to test it, give it a try and let me know if it works now

Hi, sorry to say that this seems to be not yet fixed (or maybe I do not understand it). The update recognized a change for the decai plugin but the installation failed.

PS C:\Users\vboxuser\Desktop\radare2_compiled> r2pm -U
INFO: Running git pull on C:\Users\vboxuser\.local\share\radare2\r2pm/git/radare2-pm
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0 (from 0)
Unpacking objects: 100% (4/4), 526 bytes | 35.00 KiB/s, done.
From https://github.com/radareorg/radare2-pm
   6215b70..40899cd  master     -> origin/master
Updating 6215b70..40899cd
Fast-forward
 db/decai | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
PS C:\Users\vboxuser\Desktop\radare2_compiled> r2pm -ci decai
INFO: Cleaning decai
INFO: Using r2-5.9.9 and r2pm-5.9.9
INFO: Cleaning decai
fatal: not a git repository (or any of the parent directories): .git
INFO: Starting install for decai
INFO: R2PM_NEEDS: Found curl in PATH
ERROR: This package does not have R2PM_INSTALL_WINDOWS instructions

@trufae
Copy link
Collaborator

trufae commented Mar 19, 2025

Do you have curl installed? If so i guess we need to fix the function that walks the PATH env var for windows environments

@stevenengland
Copy link
Author

Should be baked into Windows by default but I'll check

@stevenengland
Copy link
Author

Curl is available.

@trufae
Copy link
Collaborator

trufae commented Mar 20, 2025

works for me it finds curl, installs the plugin, and decai command appears in the r2 shell. try again after building latest r2 from git just in case.. also update the r2pm database with r2pm -U

@trufae
Copy link
Collaborator

trufae commented Mar 20, 2025

in r2 you have the "where" and "whereis" commands to tell you where a binary is located in PATH. this works fine for r2 and r2pm in my box. the code used in this command is the same used by r2pm

@trufae
Copy link
Collaborator

trufae commented Mar 26, 2025

ping?

@stevenengland
Copy link
Author

stevenengland commented Mar 26, 2025

Hi, sorry.

experienced a few obstacles and did not try again until now. So for completeness but not related to this issue:

I compiled it again and ran:

(venv) PS C:\Users\vboxuser\Desktop\radare_compiled_260325\prefix> r2pm.exe -U
INFO: Running git pull on C:\Users\vboxuser\.local\share\radare2\r2pm/git/radare2-pm
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0 (from 0)
Unpacking objects: 100% (4/4), 348 bytes | 9.00 KiB/s, done.
From https://github.com/radareorg/radare2-pm
   40899cd..a918f2d  master     -> origin/master
Updating 40899cd..a918f2d
Fast-forward
 db/decai | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(venv) PS C:\Users\vboxuser\Desktop\radare_compiled_260325\prefix> r2pm -ci decai
INFO: Cleaning decai
INFO: Using r2-5.9.9 and r2pm-5.9.9
INFO: Cleaning decai
fatal: not a git repository (or any of the parent directories): .git
INFO: Starting install for decai
INFO: R2PM_NEEDS: Found curl in PATH
ERROR: This package does not have R2PM_INSTALL_WINDOWS instructions

Then I ran:

(venv) PS C:\Users\vboxuser\Desktop\radare_compiled_260325\prefix> r2 binary.exe
WARN: Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
[0x00401594]> where decai
[0x00401594]> whereis decai
[0x00401594]> decai -h
ERROR: r2pm -ci decai
[0x00401594]>

So, that is basically all I can share right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants