Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################
- ######################
- #PS XOR
- #Xor.ps1
- #08/21/2014
- #Twitter: @TechJLS3
- #Use: ./Xor.ps1 key file
- #Example: ./Xor.ps1 FF c:\test.txt
- ######################
- param([string] $key="6A",[string] $iFile)
- $key = "0x" + $key
- $oFile = $iFile + ".out"
- #Read file in bytes
- $bytes = [System.IO.File]::ReadAllBytes("$iFile")
- #Where the magic happens
- for($i=0; $i -lt $bytes.count ; $i++)
- {
- $bytes[$i] = $bytes[$i] -bxor $key
- }
- #write file out in bytes
- [System.IO.File]::WriteAllBytes("$oFile", $bytes)
- write-host "[!] " -foregroundcolor green -nonewline; Write-host "File: " -nonewline; Write-host "$iFile " -foregroundcolor yellow -nonewline;Write-host "XOR'd with key " -nonewline;Write-host "$key. " -foregroundcolor cyan -nonewline;Write-host "Saved to " -nonewline;Write-host "$oFile" -foregroundcolor yellow -nonewline;Write-host ".";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement