StringsSharp
1.0.0
ファイルから文字列を抽出します。 Nugetパッケージが利用可能です。サンプルはファイルが含まれています。
PEおよびその他のファイルから文字列を抽出する小さなユーティリティ。マルウェアアナリシスに役立ちます。
ページコード、文字範囲、最小および最大抽出ストリングの長さをセットアップできます。以下の例を参照してください。
巨大なファイルは、固定サイズのチャンクに分割することにより処理されます。その後のチャンクのすべてのオーバーラップ前のもの、つまりチャンクスボーダーにある文字列は失われません
結果をフィルタリングする機能があります。正規表現を含む構成ファイルに基づいています。
// Desired file
string filename = "<filename>" ;
// Unicode. Char range: [u0020-u007E]. Min string length: 4. Max string length: 16
using ( StringsSharp . StringsSharp ss = new StringsSharp . StringsSharp ( 1200 , "[ u0020 - u007E ]" , 4 , 16 ) )
{
// Default chunk size is used
foreach ( MatchCollection matches in ss . Scan ( filename ) )
{
// Process matches here
}
}
// ASCII. Char range: [x20-x7E]. Min and string length are set to default
using ( StringsSharp . StringsSharp ss = new StringsSharp . StringsSharp ( 1251 , "[ x20 - x7E ]" ) )
{
using ( StringsSharp . StringFilter sf = new StringFilter ( configurationFile ) )
{
// Chunk size is set to 256
foreach ( MatchCollection matches in ss . Scan ( filename , 256 ) )
{
foreach ( Match match in matches )
{
// Result filtration in action
if ( sf . Scan ( match . Value ) )
{
// Process string here
}
foreach ( string regexpTag in sf . Scan ( match . Value ) )
{
// Process tags here
}
}
}
}
} 2017年と2017年のビルド
Ericzimmermanに感謝します。