' decodefile.vbs
'
' Decodes a hex-encoded a binary file.
'
' Copyright (C) 2009 Ryan O'Horo www.cravediy.com
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU General Public License for more details.
'


Set fso = CreateObject("Scripting.FileSystemObject")

Set fin = fso.OpenTextFile("hexencoded.txt", 1)
Set fout = fso.OpenTextFile("hello.exe", 2, true)
Do Until fin.AtEndOfStream
	fout.Write Chr("&H" & fin.Read(2))
Loop
fin.Close
fout.Close

msgbox "Completed"