Created
October 4, 2021 13:44
-
-
Save roobixx/4f3d23d3cd5ee158b562789cd2ac400e to your computer and use it in GitHub Desktop.
PowerRev.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Power Rev - v0.1 | |
$script = Read-Host "Enter the script's path you need to reserve" | |
$a = Get-Content -Path ..\..\DEV\deployer.ps1 -raw | |
$b = $a -split '' | |
[array]::Reverse($b) | |
$c = -join($b) | |
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($c) | |
$EncodedText =[Convert]::ToBase64String($Bytes) | |
$data = @" | |
`$Decoded = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String(`$EncodedText)) | |
`$jnt = `$Decoded -split '' | |
[array]::Reverse(`$jnt) | |
`$inverse = -join(`$jnt) | |
iex `$inverse | |
"@ | |
$out = Read-Host "Output file name fro reversed script" | |
Set-Content -Path $out -Value "`$EncodedText = `"$EncodedText`"" | |
Add-Content -Path $out -Value $data | |
Write-Host "Script reversed and saved as "$out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment