public class

DataStringUtil

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.items.DataStringUtil

Class Overview

Utility methods to facilitate the creation of string items by the INativeDataAnalyzer.

Summary

Constants
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)
static String getStringAt(IVirtualMemory mem, long address, int minChars, int maxChars)
static boolean heurIsValidString(String s)
static boolean isValidStringAt(IVirtualMemory mem, long address, int minChars, int maxChars)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int maxStringItemNameLength

Constant Value: 64 (0x00000040)

Public Constructors

public DataStringUtil ()

Public Methods

public 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. If a non-null string item is returned, it must be registered to a memory model or immediately disposed.

Parameters
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; set to -1 for default (currently: 3)
maxChars maximum number of characters (not bytes) to be parsed; set to -1 for default (currently: 100_000)
Returns
  • a string item or null

public static String determineValue (INativeStringItem item, IVirtualMemory mem, boolean reEncodingValidation)

Determine the value of a given string data item.

public static String determineValue (StringType st, IVirtualMemory mem, long address, int size, boolean reEncodingValidation)

Determine the value of a string.

Parameters
st string type
mem virtual memory
address address to string in memory
size string size in bytes, including the terminator if any

public static String determineValue (StringType st, byte[] buffer, int offset, int size, boolean reEncodingValidation)

Determine the value of a string.

Parameters
st string type
buffer bytes
offset offset to string in buffer
size string size in byte, including the null terminator if any

public static String getStringAt (IVirtualMemory mem, long address, int minChars, int maxChars, StringType[] atype)

public static String getStringAt (IVirtualMemory mem, long address, int minChars, int maxChars)

public static boolean heurIsValidString (String s)

public static boolean isValidStringAt (IVirtualMemory mem, long address, int minChars, int maxChars)