mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 19:36:11 +00:00
f2ac1ece55
add
93 lines
3.2 KiB
C#
93 lines
3.2 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Microsoft.InfoCards.InfoCardClaim
|
|
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
|
|
// MVID: ADE0A079-11DB-4A46-8BDE-D2A592CA8DEA
|
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-67b630ead60119692b9abbdfd8717c96904ef041127c2cae033c86b718eaa61e.exe
|
|
|
|
using Microsoft.InfoCards.Diagnostics;
|
|
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
namespace Microsoft.InfoCards
|
|
{
|
|
internal class InfoCardClaim
|
|
{
|
|
private string m_id;
|
|
private string m_claimValue;
|
|
private string m_displayTag;
|
|
private string m_description;
|
|
|
|
public InfoCardClaim()
|
|
{
|
|
}
|
|
|
|
public InfoCardClaim(string id, string value)
|
|
: this(id, value, (string) null, (string) null)
|
|
{
|
|
}
|
|
|
|
public InfoCardClaim(string id, string value, string description, string displaytag)
|
|
{
|
|
this.m_id = !string.IsNullOrEmpty(id) ? id : throw InfoCardTrace.ThrowHelperArgumentNull(nameof (id));
|
|
this.m_claimValue = value;
|
|
this.m_displayTag = displaytag;
|
|
this.m_description = description;
|
|
}
|
|
|
|
public string Id => this.m_id;
|
|
|
|
public string Value
|
|
{
|
|
get => this.m_claimValue;
|
|
set => this.m_claimValue = value;
|
|
}
|
|
|
|
public string DisplayTag => this.m_displayTag;
|
|
|
|
public string Description => this.m_description;
|
|
|
|
public override string ToString() => this.m_claimValue;
|
|
|
|
public void ThrowIfNotComplete()
|
|
{
|
|
if (string.IsNullOrEmpty(this.m_id))
|
|
throw InfoCardTrace.ThrowHelperError((Exception) new SerializationIncompleteException(this.GetType()));
|
|
}
|
|
|
|
public void Serialize(BinaryWriter writer)
|
|
{
|
|
this.ThrowIfNotComplete();
|
|
if (writer == null)
|
|
throw InfoCardTrace.ThrowHelperArgumentNull(nameof (writer));
|
|
Utility.SerializeString(writer, this.m_id);
|
|
Utility.SerializeString(writer, this.m_displayTag);
|
|
Utility.SerializeString(writer, this.m_description);
|
|
Utility.SerializeString(writer, this.m_claimValue);
|
|
}
|
|
|
|
public void DeSerialize(BinaryReader reader)
|
|
{
|
|
this.m_id = Utility.DeserializeString(reader);
|
|
this.m_displayTag = Utility.DeserializeString(reader);
|
|
this.m_description = Utility.DeserializeString(reader);
|
|
this.m_claimValue = Utility.DeserializeString(reader);
|
|
}
|
|
|
|
public void Encrypt(PinProtectionHelper pinHelper)
|
|
{
|
|
byte[] bytes = new UnicodeEncoding().GetBytes(this.m_claimValue);
|
|
this.m_claimValue = Convert.ToBase64String(pinHelper.Encrypt(bytes));
|
|
}
|
|
|
|
public void Decrypt(PinProtectionHelper pinHelper)
|
|
{
|
|
UnicodeEncoding unicodeEncoding = new UnicodeEncoding();
|
|
byte[] encrypted = Convert.FromBase64String(this.m_claimValue);
|
|
this.m_claimValue = unicodeEncoding.GetString(pinHelper.Decrypt(encrypted));
|
|
}
|
|
|
|
public InfoCardClaim Clone() => new InfoCardClaim((string) this.m_id.Clone(), string.IsNullOrEmpty(this.m_claimValue) ? (string) null : (string) this.m_claimValue.Clone(), string.IsNullOrEmpty(this.m_description) ? (string) null : (string) this.m_description.Clone(), string.IsNullOrEmpty(this.m_displayTag) ? (string) null : (string) this.m_displayTag.Clone());
|
|
}
|
|
}
|