in Core/src/Impl/PathUtil.cs [148:176]
public static bool IsPeFileWithWeakHash(this SymbolStoragePath path)
{
var extension = SymbolStoragePath.GetExtension(path.AsRef());
if (extension.Length != 4)
return false;
Span<char> loweredExt = stackalloc char[4];
extension.ToLowerInvariant(loweredExt);
// Check extension
if (!(loweredExt is ".exe" || loweredExt is ".dll" || loweredExt is ".sys" ||
loweredExt is ".ex_" || loweredExt is ".dl_" || loweredExt is ".sy_"))
{
return false;
}
// Check for weak hash
var directory = SymbolStoragePath.GetFileName(SymbolStoragePath.GetDirectoryName(path.AsRef()));
if (directory.Length <= 8 || directory.Length > 18)
return false;
for (int i = 0; i < directory.Length; i++)
{
if (!IsHex(directory[i]))
return false;
}
return true;
}