public static Task ScanDirectoryAsync(string Source, string Dest, string glob = "*", bool Recursive = false)
{
if (!Directory.Exists(Source))
{
WriteLine($"Can not find scan folder {Source} to import PE files from");
return null;
}
else {
WriteLine($"Scanning folder {Source} and saving relocs into {Dest}.");
return CompileEachFileAsync(Source, glob, Dest, Recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly,
(f, g) => new Extract().ScanFile(f, g));
// this exception handling not working well
//.ContinueWith(t => {
// if (Verbose > 0)
// WriteLine($"{t.Exception.Message}. InnerException: {t.Exception.InnerExceptions}", );
}
}