Skip to content

StringExtractor

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Extracts strings from .NET assemblies across three sources: the #US heap (user string literals), the #Strings heap (metadata identifiers), and raw printable character sequences from the binary.

public sealed class StringExtractor

ObjectStringExtractor

Extracts strings from .NET assemblies across three sources: the #US heap (user string literals), the #Strings heap (metadata identifiers), and raw printable character sequences from the binary.

Parameters:

public StringExtractor(AssemblyAnalyzer analyzer)

Number of malformed entries skipped during the last ExtractMetadataStrings call.

Returns: Int32

public int SkippedMetadataStringCount { get; }

Number of malformed entries skipped during the last ExtractUserStrings call.

Returns: Int32

public int SkippedUserStringCount { get; }

Extracts all identifier strings from the #Strings metadata heap. These are type names, method names, namespace names, and other metadata identifiers.

Returns: IReadOnlyList<StringEntry>

A list of string entries from the metadata strings heap.

public IReadOnlyList<StringEntry> ExtractMetadataStrings()

Extracts raw printable character sequences from the binary file. Scans for consecutive ASCII printable characters (0x20-0x7E) of at least minLength bytes.

Parameters:

  • minLength (Int32): The minimum number of consecutive printable characters to consider a string.

Returns: IReadOnlyList<StringEntry>

A list of string entries extracted from the raw binary.

public IReadOnlyList<StringEntry> ExtractRawStrings(int minLength = 4)

Extracts all user string literals from the #US metadata heap. These are the string constants used in IL code via ldstr.

Returns: IReadOnlyList<StringEntry>

A list of string entries from the user strings heap.

public IReadOnlyList<StringEntry> ExtractUserStrings()