StringsSharp
1.0.0
파일에서 문자열을 추출합니다. Nuget 패키지를 사용할 수 있습니다. 샘플은 파일이 포함되어 있습니다.
PE 및 기타 파일에서 문자열을 추출하는 작은 유틸리티. 맬웨어 Analisis에 유용합니다.
Pagecode, 문자 범위, 최소 및 최대 추출 문자열 길이를 설정할 수 있습니다. 아래 예제를 참조하십시오.
거대한 파일은 고정 크기 덩어리로 분할하여 처리됩니다. 모든 후속 청크는 이전의 겹치고, 즉 덩어리 테두리에 위치한 문자열은 손실되지 않습니다.
결과를 필터링 할 수 있습니다. 정규 표현식이 포함 된 구성 파일을 기반으로합니다.
// 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
}
}
}
}
} VS 2017에서 구축
Ericzimmerman에게 특별한 감사를드립니다.