tintinweb / vscode-decompiler

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

How to do you fully setup and use the extension for windows using either ghidra #4

Closed oyedejioyewole closed 4 years ago

oyedejioyewole commented 4 years ago

Setup

I installed everything but I am still not yet sure its correct

Please show me how to install and setup the extension for using ghidra on windows 10, and how to use it on visual studio code.

Alt + F + P + S = Settings = vscode.decompile.ghidra.path

C:/Path Applications/Ghidra-9.1.2/support/analyzeHeadless.bat

https://user-images.githubusercontent.com/57059138/82381546-4ecf5e80-9a22-11ea-94c6-62ca5c7b0261.png

tintinweb commented 4 years ago

Hi @LokotamaTheMastermind,

  1. install visual studio code
  2. install the vscode-decompiler extension (vscode -> extensions -> search: vscode-decompiler -> install). reload vscode.
  3. download ghidra (https://ghidra-sre.org/) and unpack it
  4. make sure java11+ JDK is installed (e.g. https://www.oracle.com/java/technologies/javase-jdk14-downloads.html)
  5. run analyzeHeadless.bat once and check if it is missing something (e.g. the JDK is not in path or something else). if it runs fine and prints its usage you're all set.
  6. configure the path to analyzeHeadless.bat in code -> preferences -> settings -> vscode.decompile.ghidra.path
  7. in the explorer view, right-click on an executable (.exe) and select decompile.
  8. wait until the c-like pseudocode pops up

note: I've seen some issues with node not being able to execute binaries that have spaces in their path. You might want to place ghidra or the target binary in a dir that does not contain spaces (same goes for filenames; avoid spaces; it's dirty anyway :p). Need to investigate this at some point.

note: Use the OS native path delimiter. Your screenshot show's that you've added the path with forward slashes and this might not be valid. use backslashes on windows: C:\Path Applications\Ghidra-9.1.2\support\analyzeHeadless.bat

tintinweb commented 4 years ago

likely the same issue as #6 - closing.