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

Script AutoRenameSimpleLabels not handling some characters (invalid characters) #7494

Open
bukowa opened this issue Feb 13, 2025 · 0 comments
Assignees
Labels
Feature: Scripting Status: Triage Information is being gathered

Comments

@bukowa
Copy link

bukowa commented Feb 13, 2025

I just tried the script script and seems like it can't handle some names:

println("Renaming BR @ " + startAddr.toString(false).toUpperCase() + ": " +
s.getName() + " to " + newName);
s.setName(newName, SourceType.ANALYSIS);
modified_count += 1;

AutoRenameSimpleLabels.java> Renaming BR @ 10029BE5: switchD to branch_10029BE5_dword ptr [EBP*0x4 + 0x10029dec]
Symbol name contains invalid characters: branch_10029BE5_dword ptr [EBP*0x4 + 0x10029dec]
ghidra.util.exception.InvalidInputException: Symbol name contains invalid characters: branch_10029BE5_dword ptr [EBP*0x4 + 0x10029dec]
	at ghidra.program.model.symbol.SymbolUtilities.validateName(SymbolUtilities.java:238)
	at ghidra.program.database.symbol.SymbolDB.doSetNameAndNamespace(SymbolDB.java:606)
	at ghidra.program.database.symbol.SymbolDB.setNameAndNamespace(SymbolDB.java:674)
	at ghidra.program.database.symbol.SymbolDB.setName(SymbolDB.java:540)
	at AutoRenameSimpleLabels.run(AutoRenameSimpleLabels.java:143)
	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:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

---------------------------------------------------
Build Date: 2025-Feb-05 1536 EST
Ghidra Version: 11.3
Java Home: C:\ghidra\ghidra_11.3\Contrib\jdk-21.0.6+7
JVM Version: Eclipse Adoptium 21.0.6
OS: Windows 10 10.0 amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Scripting Status: Triage Information is being gathered
Projects
None yet
Development

No branches or pull requests

3 participants