Exemplo n.º 1
0
 /// ---------------------------------------------------------------------------------------
 /// <summary>
 /// Computes the hash value for a file.
 /// </summary>
 /// <param name="fileName">Name of the file.</param>
 /// <returns>Hash value</returns>
 /// ---------------------------------------------------------------------------------------
 private byte[] ComputeHash(string fileName)
 {
     using (PeFileProcessor fileProcessor = new PeFileProcessor(fileName))
     {
         byte[] buffer = m_md5.ComputeHash(fileProcessor.Stream);
         if (Properties.Settings.Default.Verbose)
         {
             Console.WriteLine("{0}: {1}", fileName, Convert.ToBase64String(buffer));
         }
         return(buffer);
     }
 }
Exemplo n.º 2
0
		/// ---------------------------------------------------------------------------------------
		/// <summary>
		/// Computes the hash value for a file.
		/// </summary>
		/// <param name="fileName">Name of the file.</param>
		/// <returns>Hash value</returns>
		/// ---------------------------------------------------------------------------------------
		private byte[] ComputeHash(string fileName)
		{
			using (PeFileProcessor fileProcessor = new PeFileProcessor(fileName))
			{
				byte[] buffer = m_md5.ComputeHash(fileProcessor.Stream);
				if (Properties.Settings.Default.Verbose)
					Console.WriteLine("{0}: {1}", fileName, Convert.ToBase64String(buffer));
				return buffer;
			}
		}