MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed/Microsoft/InfoCards/DataRow.cs
2022-08-18 06:28:56 -05:00

117 lines
3.3 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.DataRow
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 1D4D5564-A025-490C-AF1D-DF4FBB709D1F
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed.exe
using Microsoft.InfoCards.Diagnostics;
namespace Microsoft.InfoCards
{
internal class DataRow
{
private string m_instanceId;
private string m_sourceId;
private int m_localId;
private int m_objectType;
private long m_lastChange;
private int m_objectSize;
private GlobalId m_globalId;
private byte[] m_buffer;
private DataRowIndexBuffer m_indexBuffer;
public DataRow()
: this((string) null, (string) null)
{
}
private DataRow(string instanceId, string sourceId)
{
this.m_instanceId = instanceId;
this.m_sourceId = sourceId;
this.m_indexBuffer = new DataRowIndexBuffer();
}
public GlobalId GlobalId
{
get => this.m_globalId;
set
{
this.m_globalId = !(GlobalId.Empty == value) ? value : throw InfoCardTrace.ThrowHelperArgumentNull(nameof (value));
this.SetIndexValue("ix_globalid", (object) value);
}
}
public string InstanceId
{
get => this.m_instanceId;
internal set => this.m_instanceId = value;
}
public string SourceId
{
get => this.m_sourceId;
internal set => this.m_sourceId = value;
}
public long LastChange
{
get => this.m_lastChange;
internal set => this.m_lastChange = value;
}
public int LocalId
{
get => this.m_localId;
internal set => this.m_localId = value;
}
public int ObjectType
{
get => this.m_objectType;
set
{
this.m_objectType = value;
this.SetIndexValue("ix_objecttype", (object) value);
}
}
internal DataRowIndexBuffer IndexBuffer => this.m_indexBuffer;
public void SetDataField(byte[] buffer) => this.SetDataField(buffer, buffer.Length);
public void SetDataField(byte[] buffer, int size)
{
this.m_buffer = buffer;
this.m_objectSize = size;
}
public byte[] GetDataField() => this.m_buffer;
public void SetMultiIndexValue(string name, params object[][] multiValues)
{
IndexObject[] indexObjects = new IndexObject[multiValues.Length];
for (int index = 0; index < multiValues.Length; ++index)
indexObjects[index] = new IndexObject(multiValues[index]);
this.m_indexBuffer.SetIndexValues(name, indexObjects);
}
public void SetIndexValue(string name, params object[] values)
{
object[][] objArray = new object[values.Length][];
for (int index = 0; index < objArray.Length; ++index)
objArray[index] = new object[1]{ values[index] };
this.SetMultiIndexValue(name, objArray);
}
internal static unsafe DataRow Create(EncryptedObjectHeader* pHeader, DataSource source) => new DataRow(source.InstanceId, source.SourceId)
{
LastChange = pHeader->LastChange,
ObjectType = pHeader->ObjectType,
LocalId = pHeader->LocalId,
GlobalId = pHeader->GlobalId,
m_objectSize = pHeader->DataSize
};
}
}