Firmware_Slap icon indicating copy to clipboard operation
Firmware_Slap copied to clipboard

looking for radare even though ghidra is installed

Open Alien-AV opened this issue 4 years ago • 4 comments

Running "Discover_And_Dump.py" from Quickstart section of the readme results in "radare not found" messages on the celery side. Discover_And_Dump.py examples/iwconfig -D iwconfig_results

However, I've installed ghidra according to instructions and I expected slap to use it instead of radare. Is it supposed to use ghidra instead of radare automatically? (Or am I misunderstanding the instructions?) What could be wrong with my setup? (I seem to have followed the instructions correctly.)

Alien-AV avatar Aug 15 '19 08:08 Alien-AV

I had to install both Ghidra and Radare2 to get it to run as well. I think the documentation might need to be changed to state both are required to be installed. @ChrisTheCoolHut what are your thoughts?

nstarke avatar Aug 15 '19 14:08 nstarke

I'll install it on a clean VM tonight and check it out.

I thought I had segregated the radare2 and ghidra code. and at the top of Discover and Dump I have use_ghidra defined.

Function_handler and ghidra_handler should probably be named radare2_handler and ghidra_handler.

ChrisTheCoolHut avatar Aug 15 '19 14:08 ChrisTheCoolHut

I can confirm op's report. I ran the example with iwconfig, and for some reason it would not find radare2, even though Discover_and_Dump.py had use_ghidra as True.

I then installed radare2, (like nstarke did) but r2pipe still couldn't find it.

So I added the path to the radare2 executable (radare2home="/usr/bin/") in both r2pipe.open() function calls in function_handler.py.

~~I'm running into a different issue now, but~~ I currently don't have a radare2 PATH error.

PhatHub avatar Aug 20 '19 23:08 PhatHub

I think the problem is that Discover_And_Dump.py always imports function_handler, which always imports r2pipe - and if you don't have radare installed, you won't have r2pipe. As there's always either function_handler or ghidra_handler used but never both, it would make sense to make the import conditional. I'll draft a patch for that.

mmiszczyk avatar Feb 10 '20 16:02 mmiszczyk