mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-01-09 22:17:55 -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) {
|
private static String makeTitleString(AddressSetView addrs) {
|
||||||
return "Search For Encoded Strings - %s (%s - %s)".formatted(
|
String addrRangeStr = !addrs.isEmpty()
|
||||||
formatLength(addrs.getNumAddresses(), "addresses"), addrs.getMinAddress(),
|
? "(%s - %s)".formatted(addrs.getMinAddress(), addrs.getMaxAddress())
|
||||||
addrs.getMaxAddress());
|
: "";
|
||||||
|
return "Search For Encoded Strings - %s %s"
|
||||||
|
.formatted(formatLength(addrs.getNumAddresses(), "addresses"), addrRangeStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean charsetExists(String charsetName) {
|
private static boolean charsetExists(String charsetName) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* 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) {
|
private void showSearchForEncodedStrings(NavigatableActionContext lac) {
|
||||||
AddressSetView addrs = lac.hasSelection()
|
AddressSetView addrs = lac.hasSelection() && !lac.getSelection().isEmpty()
|
||||||
? lac.getSelection()
|
? lac.getSelection()
|
||||||
: lac.getProgram().getMemory().getAllInitializedAddressSet();
|
: lac.getProgram().getMemory().getAllInitializedAddressSet();
|
||||||
EncodedStringsDialog dlg = new EncodedStringsDialog(this, lac.getProgram(), addrs);
|
EncodedStringsDialog dlg = new EncodedStringsDialog(this, lac.getProgram(), addrs);
|
||||||
|
|||||||
Reference in New Issue
Block a user