I'm trying to make a gamemap cryptor/decryptor... i decrypted it fine, but i have problem encrypting it.
i decrypted it like
FileStream fs = blabla bla(file, FileMode.Open);
BinaryReader br = .....(fs);
so i read it in this way.
uint MapCount = br.ReadUint32();
uint ID = br.ReadUint32();
int Length = br.ReadInt32();
string name = ..........//i get it witl help of intellisense :$
int size = br.ReadInt32();
but when i try to encrypt it i have problems.
i have converted the data that i read from the GameMap.txt generated when decrypting so i make it look like
bw = new BinaryWriter(file, FileMode.Create)
uint mapcount = uint.Parse(data loaded from gamemap.txt)
uint ID = ...... same thing
int Length = .... samething with int
string Path = ......
int Size = .......
then i write with BinaryWriter all to the File GameMap2.dat
yes, i write mapcount just one time.
i write it in this order.
count
loop()//i tried differents ones lOl
{
bw.Write(ID)
bw.Write(Length)
bw.Write(Path)
bw.Write(Size)
}
but the new gamemap.dat's size is like 200 bytes major to the original one
6.22 kb original
6.42 kb new one
and i cant decrypt it, the file NEVER finish of being decrypted!
also never finish of loading(in the source side)...
so i dk what can i do now...
srry but i'm not in home so i can't provide u the exact codes i tried...
i made it decrypt to the file really simple for try encrypt again faster, but that wasn't the error.
i hope someone give me some guidance with this...
thanks
srry for my bad english







