mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-01-07 21:24:00 -05:00
GP-6248 fix text in title bar of search for encoded strings dialog
if selection does not have addresses, or if address map is empty, don't show "null - null".
This commit is contained in:
@@ -1103,9 +1103,11 @@ public class EncodedStringsDialog extends DialogComponentProvider {
|
||||
}
|
||||
|
||||
private static String makeTitleString(AddressSetView addrs) {
|
||||
return "Search For Encoded Strings - %s (%s - %s)".formatted(
|
||||
formatLength(addrs.getNumAddresses(), "addresses"), addrs.getMinAddress(),
|
||||
addrs.getMaxAddress());
|
||||
String addrRangeStr = !addrs.isEmpty()
|
||||
? "(%s - %s)".formatted(addrs.getMinAddress(), addrs.getMaxAddress())
|
||||
: "";
|
||||
return "Search For Encoded Strings - %s %s"
|
||||
.formatted(formatLength(addrs.getNumAddresses(), "addresses"), addrRangeStr);
|
||||
}
|
||||
|
||||
private static boolean charsetExists(String charsetName) {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -113,7 +113,7 @@ public class EncodedStringsPlugin extends ProgramPlugin {
|
||||
}
|
||||
|
||||
private void showSearchForEncodedStrings(NavigatableActionContext lac) {
|
||||
AddressSetView addrs = lac.hasSelection()
|
||||
AddressSetView addrs = lac.hasSelection() && !lac.getSelection().isEmpty()
|
||||
? lac.getSelection()
|
||||
: lac.getProgram().getMemory().getAllInitializedAddressSet();
|
||||
EncodedStringsDialog dlg = new EncodedStringsDialog(this, lac.getProgram(), addrs);
|
||||
|
||||
Reference in New Issue
Block a user