You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error running script: Cantordust.java
java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/nangl/d/code/test/sdlstasy.exe
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at resources.GhidraSrc.getJavaData(GhidraSrc.java:121)
at resources.GhidraSrc.getData(GhidraSrc.java:78)
at Cantordust.run(Cantordust.java:36)
at ghidra.app.script.GhidraScript.executeNormal(GhidraScript.java:405)
at ghidra.app.script.GhidraScript.doExecute(GhidraScript.java:260)
at ghidra.app.script.GhidraScript.execute(GhidraScript.java:238)
at ghidra.app.plugin.core.script.RunScriptTask.run(RunScriptTask.java:47)
at ghidra.util.task.Task.monitoredRun(Task.java:134)
at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
To Reproduce
Steps to reproduce the behavior:
Analyze the attached exe with the default settings
Open Script Manager, click Manage Script Directories button.
As a general java programming issue, I've found that creating Path objects from random strings is something that needs to be done carefully, because of the exception you are running into.
Rather than checking the OS name, doing something like new File(randomstring).toPath() is a bit safer and File gives you some automatic fixing of those java-fied strings with the leading '/'.
The location that is causing the problem seems to be resources.GhidraSrc, which is a Cantordust file, not a Ghidra file.
As a general java programming issue, I've found that creating Path objects from random strings is something that needs to be done carefully, because of the exception you are running into.
Rather than checking the OS name, doing something like new File(randomstring).toPath() is a bit safer and File gives you some automatic fixing of those java-fied strings with the leading '/'.
The location that is causing the problem seems to be resources.GhidraSrc, which is a Cantordust file, not a Ghidra file.
Yeah. System.getProperty("os.name").equals("Windows 10") looks really crufty. Wonder what happens on Windows 7.
Describe the bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Ghidra handles Windows pathes properly
Attachments
sdlstasy.zip
Environment (please complete the following information):
Additional context
The exception doesn't appear to be related to Cantordust, but to the Ghidra prefixing the Windows path with '/'.
The text was updated successfully, but these errors were encountered: