MalwareSourceCode/MSIL/Trojan/Win32/P/Trojan.Win32.Patched.mf-9c4f7eb57e580673b883e57f31931bcbce8bd5d8de1a509a25b8b5a175335d9f/Net/LShift/Utilities/ChecksumUtilities.cs
2022-08-18 06:28:56 -05:00

41 lines
1.2 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Net.LShift.Utilities.ChecksumUtilities
// Assembly: updateservice, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A6A1FC23-14F7-4CCE-B702-0F9FFD2CD5AC
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Trojan.Win32.Patched.mf-9c4f7eb57e580673b883e57f31931bcbce8bd5d8de1a509a25b8b5a175335d9f.exe
using System.IO;
using System.Security.Cryptography;
namespace Net.LShift.Utilities
{
public class ChecksumUtilities
{
public static byte[] GetSha1Sum(FileInfo file)
{
using (Stream inputStream = (Stream) file.OpenRead())
return SHA1.Create().ComputeHash(inputStream);
}
public static bool ByteArraysAreEqual(byte[] a, byte[] b)
{
if (a.Length != b.Length)
return false;
for (int index = 0; index < a.Length; ++index)
{
if ((int) a[index] != (int) b[index])
return false;
}
return true;
}
public static string HexEncode(byte[] array)
{
StringWriter stringWriter = new StringWriter();
foreach (byte num in array)
stringWriter.Write("{0:x2}", (object) num);
return stringWriter.ToString();
}
}
}