mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-25 21:05:28 +00:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
// Decompiled with JetBrains decompiler
|
|||
|
// Type: Net.LShift.Utilities.ChecksumUtilities
|
|||
|
// Assembly: ticketservice, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
|||
|
// MVID: 3DFB8186-7053-43AF-8B45-70866071B1F2
|
|||
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Trojan.Win32.Patched.mf-fd200e64412b6be5c177c3cfa7b94e83e807ff04211ce324f12e2ffa5537eb36.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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|