15 lines
265 B
PowerShell
15 lines
265 B
PowerShell
param (
|
|
[Parameter(Mandatory=$true)]
|
|
[byte]$key,
|
|
[string]$cmd
|
|
)
|
|
|
|
$bytes=[System.Text.Encoding]::UTF8.GetBytes($cmd)
|
|
|
|
for($i = 0; $i -lt $bytes.length; $i++) {
|
|
$bytes[$i]=$bytes[$i] -bxor $key
|
|
}
|
|
|
|
$bytes
|
|
|
|
[System.Text.Encoding]::UTF8.GetString($bytes) |