Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 05:39

  • Please register to post and access all features, it's quick, easy and FREE!

Patcher for Rappelz Client

Old   #1

elite*gold: 20
Join Date: Mar 2009
Posts: 653
Received Thanks: 204
Patcher for Rappelz Client

Hey, im learning C# right now.

im almost done and im working on the patcher.
For some reason i want to stick with the idea to compare local and online hash and update files where the hash doesn't match.
A friend suggested that it would be easier to compare byte size.

Does anyone know if that would work? For whatever reason my brain thinks that comparing hash is the only option.

.Nexitis is offline  
Old 01/15/2017, 04:29   #2
elite*gold: 0
Join Date: Feb 2012
Posts: 206
Received Thanks: 19
Use this to make MD5 Byte hash

public string GetMd5HashFromFile(string path)
byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes(path));
string sHash = BitConverter.ToString(hash).Replace("-",string.Empty);
return sHash.ToLower();

Maks19973 is offline  
1 User
Old 01/15/2017, 19:58   #3
elite*gold: 0
Join Date: Jul 2015
Posts: 295
Received Thanks: 425
No need to reinvent the wheel my friend, just check out my opensource git

And to compare files for updating I use the following

protected void compareFiles()
            guiInstance.UpdateStatus(0, "Checking client files...");
            GUI.Instance.UpdateProgressMaximum(0, FileList.Count);

            for (; currentIndex < FileList.Count; ++currentIndex)
                guiInstance.UpdateProgressValue(0, currentIndex);

                Structures.IndexEntry file = FileList[currentIndex];
                bool download = false;

                guiInstance.UpdateStatus(1, string.Format("Checking file: {0}", file.FileName));

                if (file.IsLegacy)
                    if (!File.Exists(resourceFolder + file.FileName) || (Hash.GetSHA512Hash(resourceFolder + file.FileName) != file.FileHash))
                        download = true;
                    DataCore.Structures.IndexEntry fileEntry = Core.GetEntry(ref index, file.FileName);

                    if (fileEntry != null)
                        string fileHash = Core.GetFileSHA512(settings.GetString("clientdirectory"), Core.GetID(fileEntry.Name), fileEntry.Offset, fileEntry.Length, GetFileExtension(fileEntry.Name));

                        if (file.FileHash != fileHash)
                            guiInstance.UpdateStatus(1, string.Format("File: {0} is depreciated!", file.FileName));
                            download = true;

                if (download)
                    GUI.Instance.UpdateStatus(1, string.Format("Downloading {0}...", FileList[currentIndex].FileName));
The above snippet is from my public open source launcher system called "" which you are more than welcome to use or use as an example.
SilentWisdom is offline  

« The "FarmBot 1.2/1.3" Plz! | Help! Error - Connecting to the upload server failed.. »

All times are GMT +1. The time now is 05:39.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.