diff --git a/delink/delink.sh b/delink/delink.sh index 2df52e2..161fda4 100755 --- a/delink/delink.sh +++ b/delink/delink.sh @@ -17,7 +17,7 @@ main() { set -- $line set +f; IFS=$IFS_PREV - if [ "$2" = true ]; then # If object is marked for extraction + if [ "$2" == true ]; then # If object is marked for extraction object_name=$1 printf '\n--- %s ---\n' "$object_name" @@ -58,12 +58,6 @@ delink() { else suffix= fi - # POSIX compatibility layers for Windows (like in git bash) will - # interpret arguments like /exporter as filepaths and attempt to - # convert them to Windows paths, breaking them; this variable disables - # that - export MSYS_NO_PATHCONV=1 - "$1/support/analyzeHeadless$suffix" "$2" "$3"\ -process default.xbe\ -noanalysis\ diff --git a/documentation/gettingstarted.md b/documentation/gettingstarted.md index 3bed97c..3b1e9ac 100644 --- a/documentation/gettingstarted.md +++ b/documentation/gettingstarted.md @@ -93,10 +93,10 @@ should be all ready for creating object files for objdiff. ### Producing Object Files -Close all of your Ghidra windows and open a Unix-style shell (e.g. Git Bash if -on Windows) in the decompilation repository's `delink/` directory. The -`delink.sh` script is our automated tool for extracting all the object files -that have been identified so far. Invoke it with three arguments: +Close all of your Ghidra windows and open a shell in the decompilation +repository's `delink/` directory. The `delink.sh` script is our automated tool +for extracting all the object files that have been identified so far. Invoke +it with three arguments: - The path to your Ghidra installation (the directory with files like `ghidraRun` and `ghidraRun.bat`, and directories like `docs/` and @@ -105,27 +105,13 @@ that have been identified so far. Invoke it with three arguments: directory with a name ending in `.rep`) - The name of your JSRF Ghidra project -If you're on Windows, the paths you provide should be Windows filepaths, not -Unix-style paths. Make sure the paths are surrounded by quotes, too (e.g. -`'C:\path\to\whatever'`), else the shell won't understand the backslashes -correctly. - -There are a couple errors you might get here: +There are two common errors you might get here: - `Unable to lock project!`: This means that Ghidra isn't fully closed. Make sure you've completely closed every Ghidra window before running `delink.sh`. - `Script not found: DelinkProgram.java` and - `Invalid script: DelinkProgram.java`: This means that the either the Ghidra - delinker extension isn't properly installed, or you've somehow invoked the - script in a way that can't see the extension (e.g. installing Ghidra on - Windows and then invoking the script from WSL). Ensure it's installed and - enabled first, and that you're not running in some kind of environment - different from where you installed Ghidra. -- `java.lang.RuntimeException: Failed to export ...`: This means that the - delinker extension doesn't like something about what it was told to delink. - One known cause is duplicate symbol names. If you haven't modified - `objects.csv` or `symboltable.tsv`, let other people on the project know so - that they can look into fixing it. + `Invalid script: DelinkProgram.java`: This means that the Ghidra delinker + extension isn't properly installed. Ensure it's installed and enabled first. If all goes well, you'll see the message `Delinking complete!` at the end of the script's output, and the extracted object files will be in the