Created
April 24, 2023 00:50
-
-
Save anezih/2581f718a8732302e74d3f2ab2f9af44 to your computer and use it in GitHub Desktop.
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
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