Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if wsh.arguments.count < 3 then
- wsh.echo "Usage: xor {xor value} {source file} {destination file}"
- wsh.quit
- end if
- xval = cbyte(wsh.arguments(0))
- set ds = createobject("adodb.stream")
- ds.open
- ds.type = 1
- ds.loadfromfile wsh.arguments(1)
- ds.position = 0
- ds.type = 2
- ds.charset = "x-user-defined"
- s = ds.readtext(ds.size)
- l = len(s)
- d = ""
- for i = 1 to l
- d = d & chr(asc(mid(s, i, 1)) xor xval)
- next
- ds.position = 0
- ds.seteos
- ds.writetext d
- ds.savetofile wsh.arguments(2), 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement