04-12-2007, 03:34 AM
I want to make a program, very basic, that will XOR the first byte in a file with a code, and replace that byte with the new character.
It simply doesn't work. It ruins the file, adding extra characters and changing the size of the file. Any insight?
Code:
dim as string infile
input "infile: ",infile
dim as ubyte code
input "code:",code
open infile for binary as #1
dim as ubyte temp,c
get #1,1,temp
c=temp xor code
put #1,1,temp xor code
close #1
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
--------------------------------------
Freebasic is like QB, except it doesn't suck.