File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 855849256
1+ 858404805
Original file line number Diff line number Diff line change 99- Split misc checks into multiple files.
1010- Reorganize code of main file.
1111
12+ ### Fixed
13+
14+ - Handle DOS paths starting with "\\ ?\" in COM image file permission check to avoid "illegal characters in path" exceptions (issue #82 ).
15+
1216## 2026-04-25
1317
1418### Modified
Original file line number Diff line number Diff line change @@ -509,6 +509,24 @@ function Get-ModifiableComClassEntryImagePath {
509509
510510 if ([String ]::IsNullOrEmpty($CandidatePath )) { continue }
511511
512+ # If a path starts with "\\?\", it may cause an "Illegal characters in path"
513+ # exception when calling Get-Item. Normally, we would have to convert this
514+ # type of path properly, but we don't expect paths other than "\\?\C:\...",
515+ # so we can safely remove the prefix "\\?\" (and hope for the best ^^').
516+ #
517+ # Note that this behavior seems to only be triggered by a few EDRs. There is
518+ # no issue with this type of path on a standard Windows installation. For
519+ # instance, the following command works as intended on Windows 11 + Defender.
520+ #
521+ # PS C:> Get-Item -Path "\\?\C:\Windows"
522+ #
523+ # Directory: \\?\C:
524+ #
525+ # Mode LastWriteTime Length Name
526+ # ---- ------------- ------ ----
527+ # d----- 24/04/2026 19:15 Windows
528+ if ($CandidatePath.StartsWith (" \\?\" )) { $CandidatePath = $CandidatePath.Replace (" \\?\" , " " ) }
529+
512530 $ModifiablePaths = Get-ModifiablePath - Path $CandidatePath | Where-Object { $_ -and (-not [String ]::IsNullOrEmpty($_.ModifiablePath )) }
513531 if ($null -eq $ModifiablePaths ) { continue }
514532
You can’t perform that action at this time.
0 commit comments