Skip to content

Instantly share code, notes, and snippets.

@roobixx
Created October 4, 2021 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roobixx/4f3d23d3cd5ee158b562789cd2ac400e to your computer and use it in GitHub Desktop.
Save roobixx/4f3d23d3cd5ee158b562789cd2ac400e to your computer and use it in GitHub Desktop.
PowerRev.ps1
## 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