Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ######################
  2. ######################
  3. #PS XOR
  4. #Xor.ps1
  5. #08/21/2014
  6. #Twitter: @TechJLS3
  7. #Use: ./Xor.ps1 key file
  8. #Example: ./Xor.ps1 FF c:\test.txt
  9. ######################
  10. param([string] $key="6A",[string] $iFile)
  11.  
  12. $key = "0x" + $key
  13. $oFile = $iFile + ".out"
  14. #Read file in bytes
  15. $bytes = [System.IO.File]::ReadAllBytes("$iFile")
  16.  
  17. #Where the magic happens
  18. for($i=0; $i -lt $bytes.count ; $i++)
  19. {
  20. $bytes[$i] = $bytes[$i] -bxor $key
  21. }
  22.  
  23. #write file out in bytes
  24. [System.IO.File]::WriteAllBytes("$oFile", $bytes)
  25. 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