java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.items.DataStringUtil |
Utility methods to facilitate the creation of string items by the INativeDataAnalyzer
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | NAME_DEFAULT_LENGTH | ||||||||||
String | NAME_PREFIX | ||||||||||
int | maxStringItemNameLength |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DataStringUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static INativeStringItem |
createFromMemory(INativeDataAnalyzer dataParser, ILabelManager labelman, IVirtualMemory mem, long address, long addressMax, StringType stringType, int minChars, int maxChars)
Parse a memory area as a string.
| ||||||||||
static String |
determineValue(INativeStringItem item, IVirtualMemory mem, boolean reEncodingValidation)
Determine the value of a given string data item.
| ||||||||||
static String |
determineValue(StringType st, IVirtualMemory mem, long address, int size, boolean reEncodingValidation)
Determine the value of a string.
| ||||||||||
static String |
determineValue(StringType st, byte[] buffer, int offset, int size, boolean reEncodingValidation)
Determine the value of a string.
| ||||||||||
static String |
getStringAt(IVirtualMemory mem, long address, int minChars, int maxChars, StringType[] atype)
Attempt to create a string from the memory bytes located at the provided address.
| ||||||||||
static String |
getStringAt(IVirtualMemory mem, long address, int minChars, int maxChars)
Attempt to create a string from the memory bytes located at the provided address.
| ||||||||||
static StringEntry |
getStringAt(IVirtualMemory mem, long address, long addressMax, int minChars, int maxChars)
Attempt to create a string from the memory bytes located at the provided address.
| ||||||||||
static boolean | heurIsValidString(String s, int minChars) | ||||||||||
static boolean |
isSafeAsciiStringAt(IVirtualMemory mem, long address, StringType st, int minChars, int maxChars)
Indicate if a data in memory is a safe ASCII (meaning containing only printable character in
the ASCII range).
| ||||||||||
static boolean | isSafeAsciiStringAt(IVirtualMemory mem, long address, int minChars, int maxChars) | ||||||||||
static boolean |
isValidStringAt(IVirtualMemory mem, long address, int minChars, int maxChars)
Determine whether the memory bytes at the provided address look like a string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Parse a memory area as a string. If a non-null string item is returned, it must be registered to a memory model or immediately disposed.
labelman | label manager |
---|---|
mem | virtual memory |
address | mandatory start address |
addressMax | optional maximum (final) address for the string; use -1 for no limit |
stringType | the string type hint; null to let this method determine the best string type heuristically |
minChars | minimum number of characters to be found in the string for it to be considered valid (inclusive); set to -1 for default (currently: 3) |
maxChars | maximum number of characters (not bytes) to be parsed (exclusive); set to -1 for default (currently: 100_000) |
Determine the value of a given string data item.
Determine the value of a string.
st | string type |
---|---|
mem | virtual memory |
address | address to string in memory |
size | string size in bytes, including the terminator if any |
Determine the value of a string.
st | string type |
---|---|
buffer | bytes |
offset | offset to string in buffer |
size | string size in byte, including the null terminator if any |
Attempt to create a string from the memory bytes located at the provided address.
mem | virtual memory |
---|---|
address | start address |
minChars | minimum number of characters allowed for the string |
maxChars | maximum number of characters allowed for the string |
atype | optional single-element array to collect the string output type |
Attempt to create a string from the memory bytes located at the provided address.
mem | virtual memory |
---|---|
address | start address |
minChars | minimum number of characters allowed for the string |
maxChars | maximum number of characters allowed for the string |
Attempt to create a string from the memory bytes located at the provided address.
mem | virtual memory |
---|---|
address | start address |
addressMax | max address (use -1 to specify no-max) |
minChars | minimum number of characters allowed for the string |
maxChars | maximum number of characters allowed for the string |
Indicate if a data in memory is a safe ASCII (meaning containing only printable character in
the ASCII range). Does not consider extended ASCII. Note that String Type can be different
from ASCII_ZERO
: it will still check the ASCII range.
mem | virtual memory |
---|---|
address | String address |
st | String type |
minChars | minimum number of characters expected |
maxChars | maximum number of characters to be parsed (withouh the final zero if any) |
Determine whether the memory bytes at the provided address look like a string.
mem | virtual memory |
---|---|
address | start address |
minChars | minimum number of characters allowed for the string |
maxChars | maximum number of characters allowed for the string |