Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g2llvm: locate src/GhidraToXML.java relative to Ghidra-to-LLVM directory #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mewmew
Copy link

@mewmew mewmew commented Jun 9, 2020

Prior to this commit, invoking g2llvm.py from a directory outside of
Ghidra-to-LLVM would result in a failure to locate src/GhidraToXML.java.

ERROR REPORT SCRIPT ERROR: ./src/GhidraToXML.java : Script not found: ./src/GhidraToXML.java (HeadlessAnalyzer)

With this commit, the directory of Ghidra-to-LLVM is determined by
taking the realpath of sys.path[0], which either holds the parent
directory of the g2llvm.py script, or an empty string if invoked
from the interpreter. In both cases, realpath will resolve the full
path to the Ghidra-to-LLVM directory, as realpath on an empty string
uses the current working directory to resolve the full path.

Prior to this commit, invoking g2llvm.py from a directory outside of
Ghidra-to-LLVM would result in a failure to locate src/GhidraToXML.java.

	ERROR REPORT SCRIPT ERROR: ./src/GhidraToXML.java : Script not found: ./src/GhidraToXML.java (HeadlessAnalyzer)

With this commit, the directory of Ghidra-to-LLVM is determined by
taking the realpath of sys.path[0], which either holds the parent
directory of the g2llvm.py script, or an empty string if invoked
from the interpreter. In both cases, realpath will resolve the full
path to the Ghidra-to-LLVM directory, as realpath on an empty string
uses the current working directory to resolve the full path.
@mewmew
Copy link
Author

mewmew commented Jun 9, 2020

Also wanted to take the chance to thank you Tejvinder for creating this project and sharing it with the reverse engineering community! It was just what I was looking for :)

Cheerful regards,
Robin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant