Skip to content

Instantly share code, notes, and snippets.

@renini
Created January 10, 2024 19:55
Show Gist options
  • Save renini/7a229de15d8435c870d89cbd53d65ed1 to your computer and use it in GitHub Desktop.
Save renini/7a229de15d8435c870d89cbd53d65ed1 to your computer and use it in GitHub Desktop.
$counter = 0
$decodedctr = 0
Push-Location C:\ioncube_priv8_decoder_v1\php\IC6_5.2
foreach ($file in Get-Content zend-encrypted-files.txt) {
$targetfile = $file.Replace('C:\source\', 'C:\source-decoded\')
$targetdir = [System.IO.Path]::GetDirectoryName($targetfile)
Write-Host Decoding $file to $targetdir
[System.IO.Directory]::CreateDirectory($targetdir)
./php.exe $file /execute /path:$targetdir
$counter++
$decodedfile = $targetfile -replace "\.php$", ".de.php"
if (Test-Path $decodedfile) {
Write-Host $decodedfile exist, now rename to $targetfile
$decodedctr++
Rename-Item -Path $decodedfile -NewName $targetfile
}
}
Pop-Location
Write-Host total php files: $counter
Write-Host total converted files: $decodedctr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment