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

radare2-cutter: Allow to use Python plugins #101571

Merged
merged 2 commits into from Nov 19, 2020
Merged

Conversation

Pamplemousse
Copy link
Member

@Pamplemousse Pamplemousse commented Oct 24, 2020

Motivation for this change

Cutter is a GUI front-end for the radare2 binary analysis tool; Its features can be extended using plugins, some of them written in Python.
However, for those to work, Cutter needs to have been compiled with specific flags.
See #101511 for details and references.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot requested review from dtzWill and Mic92 October 24, 2020 16:31
@Mic92 Mic92 marked this pull request as draft October 26, 2020 05:10
@Mic92 Mic92 changed the title [WIP] radare2-cutter: Allow to use Python plugins radare2-cutter: Allow to use Python plugins Oct 26, 2020
@Mic92
Copy link
Member

Mic92 commented Oct 26, 2020

@Pamplemousse I only checked whether it compiles and runs. Please test it with python plugins!

@Pamplemousse
Copy link
Member Author

Pamplemousse commented Oct 26, 2020

Built and ran on NixOS;
Successfully tested a couple of plugins!

Thanks @Mic92 :)

However, I encountered two new problems:

  • Plugins requiring extra Python libraries don't work (for example angrcutter);
  • Can't have several plugins at the same time (opened radareorg/cutter#2457 about that - might be a Nix-specific problem though... it's a bug in Pyside).

@Mic92
Copy link
Member

Mic92 commented Oct 26, 2020

@Pamplemousse for additional python libraries you have 3 options: use an override to extend propagatedBuildInputs or extend the PYTHONPATH with nix-shell or an wrapper around the executable set extends PYTHONPATH.

Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
@Pamplemousse
Copy link
Member Author

I did not have time to invest into making plugins requiring python libraries work (especially given that in the current state of Pyside, only one plugin at a time can be used...).

However, I felt this is already a significant enough improvement from the current Cutter in nixpkgs.

@Mic92 , I rebased / squashed your commit for a cleaner history. Thanks a lot for your help!

@Mic92 Mic92 merged commit 589d025 into NixOS:master Nov 19, 2020
@Pamplemousse Pamplemousse deleted the cutter branch January 8, 2021 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants