I ran into a scenario where I was able to upload ASCII files, but executable files were being saved improperly. A common workaround for this is to use base64 to encode the executable, transfer the encoded data, then decode it on the recipient machine.
The version of Windows I was using did not have base64 or uuencode. I was able to use “certutil” to decode my base64 encoded executable:
The -encode and -decode flags do exactly what I wanted. I transferred my file as foo.asc and decoded it like so:
certutil -decode c:\foo.asc c:\foo.exe
Encoding a file on Windows would work the same way:
certutil -encode c:\foo.exe c:\foo.asc
It worked! foo.exe matches the md5sum of the executable I initially encoded and runs as intended!