mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +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.
|
// Store the default python path in case we need to reset it later.
|
||||||
defaultPythonPath = new ArrayList<>();
|
defaultPythonPath = new ArrayList<>();
|
||||||
for (Object object : systemState.path) {
|
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
|
// 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
|
// Add in Ghidra script source directories
|
||||||
for (ResourceFile resourceFile : GhidraScriptUtil.getScriptSourceDirectories()) {
|
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()) {
|
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
|
// Add in the PyDev remote debugger module
|
||||||
if (!SystemUtilities.isInDevelopmentMode()) {
|
if (!SystemUtilities.isInDevelopmentMode()) {
|
||||||
File pyDevSrcDir = PyDevUtils.getPyDevSrcDir();
|
File pyDevSrcDir = PyDevUtils.getPyDevSrcDir();
|
||||||
if (pyDevSrcDir != null) {
|
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