GP-2628 Add 'Search|For Encoded Strings'

This commit is contained in:
dev747368 2023-11-30 18:14:29 -05:00
parent 5fd01c739d
commit c91e9aac3f
41 changed files with 3716 additions and 72 deletions

View file

@ -26,8 +26,7 @@ import java.util.*;
import generic.stl.Pair;
import ghidra.docking.settings.*;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressOutOfBoundsException;
import ghidra.program.model.address.*;
import ghidra.program.model.data.RenderUnicodeSettingsDefinition.RENDER_ENUM;
import ghidra.program.model.data.StringRenderParser.StringParseException;
import ghidra.program.model.lang.Endian;
@ -380,6 +379,19 @@ public class StringDataInstance {
return buf.getAddress();
}
public Address getEndAddress() {
try {
return length > 0 ? buf.getAddress().addNoWrap(length - 1) : buf.getAddress();
}
catch (AddressOverflowException e) {
return buf.getAddress();
}
}
public AddressRange getAddressRange() {
return new AddressRangeImpl(getAddress(), getEndAddress());
}
private boolean isBadCharSize() {
return (paddedCharSize < 1 || paddedCharSize > 8) ||
!(charSize == 1 || charSize == 2 || charSize == 4) || (paddedCharSize < charSize);