コード例 #1
0
ファイル: N64JaboManager.cs プロジェクト: ddugovic/RASuite
		public void Scan()
		{
			//check whether the file is patched and intact
			if (File.Exists(patchedPath))
			{
				using (var md5 = MD5.Create())
				{
					byte[] hash = md5.ComputeHash(File.ReadAllBytes(patchedPath));
					string hash_string = BitConverter.ToString(hash).Replace("-", "");
					if (hash_string == "F4D6E624489CD88C68A5850426D4D70E")
					{
						Status = JaboStatus.Ready;
					}
				}
			}
			else if (File.Exists(rawPath))
			{
				using (var md5 = MD5.Create())
				{
					byte[] hash = md5.ComputeHash(File.ReadAllBytes(rawPath));
					string hash_string = BitConverter.ToString(hash).Replace("-", "");
					if (hash_string == "4F353AA71E7455B81205D8EC0AA339E1")
					{
						// jabo will be patched when a rom is loaded. user is ready to go
						Status = JaboStatus.ReadyToPatch;
					}
					if (hash_string == "4A4173928ED33735157A8D8CD14D4C9C")
					{
						// wrong jabo installed (2.0)
						Status = JaboStatus.WrongVersion21;
					}
					else if (hash_string == "FF57F60C58EDE6364B980EDCB311873B")
					{
						// wrong jabo installed (1.6)
						Status = JaboStatus.WrongVersion16;
					}
				}
			}
		}
コード例 #2
0
ファイル: N64JaboManager.cs プロジェクト: stuff2600/RAEmus
 public void Scan()
 {
     //check whether the file is patched and intact
     if (File.Exists(patchedPath))
     {
         using (var md5 = MD5.Create())
         {
             byte[] hash        = md5.ComputeHash(File.ReadAllBytes(patchedPath));
             string hash_string = BitConverter.ToString(hash).Replace("-", "");
             if (hash_string == "F4D6E624489CD88C68A5850426D4D70E")
             {
                 Status = JaboStatus.Ready;
             }
         }
     }
     else if (File.Exists(rawPath))
     {
         using (var md5 = MD5.Create())
         {
             byte[] hash        = md5.ComputeHash(File.ReadAllBytes(rawPath));
             string hash_string = BitConverter.ToString(hash).Replace("-", "");
             if (hash_string == "4F353AA71E7455B81205D8EC0AA339E1")
             {
                 // jabo will be patched when a rom is loaded. user is ready to go
                 Status = JaboStatus.ReadyToPatch;
             }
             if (hash_string == "4A4173928ED33735157A8D8CD14D4C9C")
             {
                 // wrong jabo installed (2.0)
                 Status = JaboStatus.WrongVersion21;
             }
             else if (hash_string == "FF57F60C58EDE6364B980EDCB311873B")
             {
                 // wrong jabo installed (1.6)
                 Status = JaboStatus.WrongVersion16;
             }
         }
     }
 }