tintinweb / vscode-decompiler

Decompile things directly from VSCode
https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-decompiler
152 stars 26 forks source link

Decompilation fails on linux with ghidra, code 127 #3

Closed krk closed 4 years ago

krk commented 4 years ago

I have set the vscode-decompiler.tool.ghidra.path and analyzeHeadless script can find the JDK.

Failed to run decompiliation command. Check your configuration. {"code":127,"type":"single"}

tintinweb commented 4 years ago

Hey @krk,

just tested it on Kali with openjdk-11-jdk and it works fine (except the little utf8 icon that is missing in action 😀).

image

The errorcode 127 is returned from the os and indicates that the command was not found. Please make sure that the configured path exists (remove trailing spaces etc.) and the file is executable. For reference, this is my config:

image

Note that analyzeHeadless requires java11+ JDK to be installed.

I've tagged this issue as invalid unless we find out that there's indeed a bug. Thanks for the feedback though!

krk commented 4 years ago

Thank you for the fast respone!

This is what I get when I enter a path that does not exist:

Failed to run decompiliation command. Check your configuration. {"code":{"errno":"ENOENT","code":"ENOENT","syscall":"spawn /home/krk/ghidra/analyzeHeadlesss","path":"/home/krk/ghidra/analyzeHeadlesss","spawnargs":["/tmp/tmp-22124-6oan5rCqS5VK","vscode-decompiler","-import","/home/krk/X","-scriptPath","/home/krk/.vscode/extensions/tintinweb.vscode-decompiler-0.0.4/scripts","-postscript","ghidra_decompile.py","/tmp/tmp-22124-SCC4h5mAaLaI"]},"type":"single"}

I get the shorter message when the path is correct and the bash script itself cannot find a path. I used a wrapper script for setting Java 11 path and that had an error in it, causing error 127. Now that it is fixed, decompiler works!