mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-09 20:18:01 +08:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
@@ -23,6 +23,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.framework.generic.auth.Password;
|
||||
import ghidra.framework.model.DomainFile;
|
||||
import ghidra.framework.model.DomainFolder;
|
||||
import ghidra.program.model.address.Address;
|
||||
@@ -117,6 +118,10 @@ public class AskScript extends GhidraScript {
|
||||
boolean yesOrNo = askYesNo("yes or no", "is this a yes/no question?");
|
||||
println("Yes or No? " + yesOrNo);
|
||||
|
||||
try (Password password = askPassword("Password", null)) {
|
||||
println("Password has %d characters".formatted(password.getPasswordChars().length));
|
||||
// try-with-resources ensures buffer is zeroed out before garbage collected
|
||||
}
|
||||
}
|
||||
catch (IllegalArgumentException iae) {
|
||||
Msg.warn(this, "Error during headless processing: " + iae.toString());
|
||||
|
||||
Reference in New Issue
Block a user