Skip to content

Instantly share code, notes, and snippets.

@anezih
Created April 24, 2023 00:50
Show Gist options
  • Save anezih/2581f718a8732302e74d3f2ab2f9af44 to your computer and use it in GitHub Desktop.
Save anezih/2581f718a8732302e74d3f2ab2f9af44 to your computer and use it in GitHub Desktop.
function unxor {
param (
[string]$text
)
$enc = [System.Text.Encoding]::BigEndianUnicode
$key = $enc.GetBytes("ş")
$bytes = $enc.GetBytes($text)
$cycle = 0
for ($i = 0; $i -lt $bytes.Length; $i++) {
$bytes[$i] = [byte]([char]( ([char]$bytes[$i]) -bxor ([char]$key[$cycle]) ) )
$cycle++
if ($cycle -eq 1) {
$cycle = 0
}
}
$unxored_text = $enc.GetString($bytes)
return $unxored_text
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment