mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Py.newString fails on non-ascii Java strings, use Py.newStringOrUnicode
This commit is contained in:
parent
a1687a17e1
commit
4c7319c45f
1 changed files with 4 additions and 4 deletions
|
@ -100,7 +100,7 @@ public class GhidraPythonInterpreter extends InteractiveInterpreter {
|
|||
// Store the default python path in case we need to reset it later.
|
||||
defaultPythonPath = new ArrayList<>();
|
||||
for (Object object : systemState.path) {
|
||||
defaultPythonPath.add(Py.newString(object.toString()));
|
||||
defaultPythonPath.add(Py.newStringOrUnicode(object.toString()));
|
||||
}
|
||||
|
||||
// Allow interruption of python code to occur when various code paths are
|
||||
|
@ -135,18 +135,18 @@ public class GhidraPythonInterpreter extends InteractiveInterpreter {
|
|||
|
||||
// Add in Ghidra script source directories
|
||||
for (ResourceFile resourceFile : GhidraScriptUtil.getScriptSourceDirectories()) {
|
||||
systemState.path.append(Py.newString(resourceFile.getFile(false).getAbsolutePath()));
|
||||
systemState.path.append(Py.newStringOrUnicode(resourceFile.getFile(false).getAbsolutePath()));
|
||||
}
|
||||
|
||||
for (ResourceFile resourceFile : GhidraScriptUtil.getExplodedCompiledSourceBundlePaths()) {
|
||||
systemState.path.append(Py.newString(resourceFile.getFile(false).getAbsolutePath()));
|
||||
systemState.path.append(Py.newStringOrUnicode(resourceFile.getFile(false).getAbsolutePath()));
|
||||
}
|
||||
|
||||
// Add in the PyDev remote debugger module
|
||||
if (!SystemUtilities.isInDevelopmentMode()) {
|
||||
File pyDevSrcDir = PyDevUtils.getPyDevSrcDir();
|
||||
if (pyDevSrcDir != null) {
|
||||
systemState.path.append(Py.newString(pyDevSrcDir.getAbsolutePath()));
|
||||
systemState.path.append(Py.newStringOrUnicode(pyDevSrcDir.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue