forked from winter0729/windows-driver-blacklist-extractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess-p7b.ps1
24 lines (20 loc) · 904 Bytes
/
process-p7b.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
git clone https://github.com/nechyo/WDACTools
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
Import-Module .\WDACTools\WDACTools.psd1
# output/*.p7b 파일을 blacklists/*.xml로 변환하는 스크립트
$inputDirectory = "output"
$outputDirectory = "blacklists"
if (!(Test-Path $outputDirectory)) {
New-Item -ItemType Directory -Path $outputDirectory
}
$p7bFiles = Get-ChildItem -Path $inputDirectory -Filter "*.p7b"
foreach ($file in $p7bFiles) {
$outputFileName = [System.IO.Path]::ChangeExtension($file.Name, ".xml")
$outputFilePath = Join-Path -Path $outputDirectory -ChildPath $outputFileName
try {
ConvertTo-WDACCodeIntegrityPolicy -BinaryFilePath $file.FullName -XmlFilePath $outputFilePath
Write-Host "Converted: $($file.FullName) -> $outputFilePath"
} catch {
Write-Error "Error converting file: $($file.FullName). $_"
}
}