Comments (13)
Looks like another problem with Bash. We can try to get back to this after Bash is replaced with Python implementation (soon I hope) - hopefully, it will be fixed.
from retdec-idaplugin.
So, in 05c7c47 i did the following:
- Python interpreter-related checks are not done at plugin initialization. For unknown reason it was crashing IDA on Windows (on Linux, it was ok).
- Python interpreter-related checks are done before each decompilation.
- Cons: More checks, more external command invocations from plugin. Should not be a problem.
- Pros: No crashes - safer (I never know what can and cannot be done in plugin's init function). Users are not bothered at every IDA start if they have a misconfigured plugin but don't use it. Checks can react to the current system state - state can change during one IDA session.
- New check for python interpreter version - must be at least 3.4, otherwise decompilation will not be attempted. Therefore if
python
is used, and it is Python 2, as it was in your case, you would be notified. AlsoPATH
is printed in the warning message, so it would be clearer what happened. - It is possible to configure path to the Python interpreter in plugin's config window - you do not have to hack your system just for RetDec IDA plugin. Once configured, it will be remembered.
I'm closing this as solved. You can try it and if there is a problem re-open, or open a new issue. I'm still solving some problems with empty warning windows on Windows, it is caused by some code related to this, but the issue is not really related to the original problem, so this can be closed.
from retdec-idaplugin.
Because bash script doesn't work great on macOS.
Try python branch.
BTW: what is the output of :
/usr/local/bin/retdec-decompiler.sh --help
from retdec-idaplugin.
$ /usr/local/bin/retdec-decompiler.sh --help
Decompiles the given file into the selected target high-level language.
Usage:
/usr/local/bin/retdec-decompiler.sh [ options ] file
Options:
...(lists all options available)
It seems bash-to-python
branch is actually behind master
though.
from retdec-idaplugin.
Can you try it now after we got rid of Bash?
from retdec-idaplugin.
It worked, but only after changing /usr/bin/python
to point that to python 3. It seems when we are in RdGlobalInfo::isDecompilerInSpecifiedPath
the pythonCmd
is python
, initPythonCommand
was not being run to set it to python3
. I think /usr/bin
normally could not be modified because of SIP, so the plugin would stuck to python 2 which will fail to run the decompiler.
from retdec-idaplugin.
pythonCmd
has no default value, initPythonCommand()
should always run in plugin initialization and set it up. If it does not, it is a bug. But I think it is very likely it did run and set up pythonCmd
to python
.
- How did you figure out it did not run?
- Does
python3 --version
orpy -3 --version
work in your command line? If not,python
is used.
from retdec-idaplugin.
I added some info message output in corresponding functions, and they are not printed out. Will try to confirm that later.
python3 works on my command line.
from retdec-idaplugin.
Sorry if the email of this reply have different content, I missed one output. Please read the new version below.
I made some very crude logs to check if they were run:
@@ -116,8 +116,10 @@ bool RdGlobalInfo::isSelectiveDecompilation()
*/
bool RdGlobalInfo::initPythonCommand()
{
+ INFO_MSG("Z");
if (runCommand("python3", "--version") == 0)
{
+ INFO_MSG("A");
pythonCmd = "python3";
return false;
}
@@ -137,6 +139,7 @@ bool RdGlobalInfo::initPythonCommand()
bool RdGlobalInfo::isDecompilerInSpecifiedPath() const
{
+ INFO_MSG("%s\"%s\" --help\n", pythonCmd.c_str(), decompilerPyPath.c_str());
return runCommand(pythonCmd, "\"" + decompilerPyPath + "\" --help") == 0;
}
Only Z
is present in the log, so it didn't find the python3 installation (maybe because of the binary location?)
# MrX @ harukanomacbook-pro in ~/src/retdec-idaplugin on git:master x [16:20:33]
$ python3 --version
Python 3.6.2
# MrX @ harukanomacbook-pro in ~/src/retdec-idaplugin on git:master x [16:20:35]
$ which python3
/usr/local/bin/python3
from retdec-idaplugin.
Ok, so initPythonCommand()
is run, but it does not successfully execute python3 --version
even though you can execute it from the terminal.
Is it possible that the PATH is somehow modified in order to find python3
only in your terminal but not globally - so the mechanism in plugin does not see it?
First, can you try to modify initPythonCommand()
like this?
if (runCommand("/usr/local/bin/python3", "--version") == 0)
{
INFO_MSG("A");
pythonCmd = "/usr/local/bin/python3";
return false;
}
If this works then python3
can be executed and used, but plugin environment simply does not see it. If it does not, then we have some bigger problem.
Second (if first works), runCommand()
is using IDA SDK's launch_process()
mechanism, and I don't really know how it works internally. Could you try to replace it with std::system()
in initPythonCommand()
. First
if (std::system("/usr/local/bin/python3 --version") == 0)
{
INFO_MSG("A");
pythonCmd = "/usr/local/bin/python3";
return false;
}
and then:
if (std::system("python3 --version") == 0)
{
INFO_MSG("A");
pythonCmd = "python3";
return false;
}
If both work (mainly "python3 --version"
), then there is some difference between std::system()
and launch_process()
. If only "/usr/local/bin/python3"
works, then whatever environment is plugin using, the PATH is not set in a way python3
can be found.
from retdec-idaplugin.
After testing I've found that it is caused by global PATH. For applications launched outside of terminals, the PATH needs to be changed using launchctl setenv PATH ...
to make applications see them. After setting the PATH in launchctl
the plugin could find python3
successfully.
from retdec-idaplugin.
I want to know how to solve this problem, I still get this error.
My system is Mac os 10.15
from retdec-idaplugin.
@hebtuerror404 Please, create a new issue as this one is closed and very old. Also, attach please the input file and the out from IDA's console.
from retdec-idaplugin.
Related Issues (20)
- Loading of output C file FAILED on Mac HOT 2
- Can help compile a mac version, A Mac IDA7.0 is here HOT 4
- retdec 4.0 unrecognized arguments HOT 5
- lauch_process ... failed with error code 2 HOT 6
- launch_process(...) failed with error code 1 HOT 3
- retdec not loading HOT 2
- How to compile the c file generated by retdec-idaplugin? HOT 1
- Default invocation broken for 32bit targets HOT 4
- Compilation failed during configure-msvc step for yara HOT 1
- Build with old SDK
- Continued support for IDA 7.2-7.4 HOT 2
- Please support IDA 7.7 HOT 8
- The compiled version from release doees not work HOT 4
- Unable to parse decompilation output: The document is empty. HOT 6
- Build failures on macOS HOT 3
- IDA7.7 v1.0 release does not work HOT 6
- Decompile Pesudo Code No Longer Works HOT 1
- this dll let plugin crash
- GLIBC_2.34 error with IDAPro v8.3
- I don't see parameters being used within the code.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retdec-idaplugin.