2009-03-08, 03:27 PM
whats so special about a patch maker?
Quote: private void buildmp(string patcher, string txt, string datapath, string outpath)i made one that automatically checks for new patches on the ftp and when available makes a prepatcher and post the wz extractions for my extraction bot, but didnt bother to post it as there are many free tools (maststef's patch builder is a nice one) that do it.
{
FileStream pbfs = new FileStream(patcher,FileMode.Open);
byte[] pbdata = new byte[pbfs.Length];
pbfs.Read(pbdata, 0, Convert.ToInt32(pbfs.Length));
FileStream noticefs = new FileStream(txt, FileMode.Open);
byte[] noticelen = ConvertToDword(Convert.ToInt32(noticefs.Length));
byte[] notice = new byte[noticefs.Length];
noticefs.Read(notice, 0, Convert.ToInt32(noticefs.Length));
FileStream datafs = new FileStream(datapath, FileMode.Open);
byte[] datalen = ConvertToDword(Convert.ToInt32(datafs.Length));
byte[] data = new byte[datafs.Length];
datafs.Read(data, 0, Convert.ToInt32(datafs.Length));
byte[] footer = new byte[] {0xF3,0xFB,0xF7,0xF2};
FileStream output = new FileStream(outpath, FileMode.Create);
output.Write(pbdata, 0, Convert.ToInt32(pbfs.Length));
output.Write(data, 0, Convert.ToInt32(datafs.Length));
output.Write(notice, 0, Convert.ToInt32(noticefs.Length));
output.Write(datalen, 0, 4);
output.Write(noticelen, 0, 4);
output.Write(footer, 0, 4);
pbfs.Close();
noticefs.Close();
datafs.Close();
output.Close();
}
