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

49 lines
2.1 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.IndexObject
// 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;
using System;
namespace Microsoft.InfoCards
{
internal class IndexObject
{
private object[] m_objects;
private byte[] m_compiledForm;
public IndexObject(object[] objects) => this.m_objects = objects;
public IndexObject(byte[] compiledForm) => this.m_compiledForm = compiledForm;
public bool IsCompiled => null != this.m_compiledForm;
public bool CanCompile => null != this.m_objects;
public byte[] CompiledForm => this.m_compiledForm;
public object[] ObjectList => this.m_objects;
internal void Compile(SecondaryIndexDefinition indexDef)
{
if (!this.CanCompile)
throw InfoCardTrace.ThrowHelperError((Exception) new InvalidOperationException(SR.GetString("StoreIndexObjectCanNotBeCompiled")));
byte[] destinationArray = new byte[60];
int destinationIndex = 0;
for (int index = 0; index < this.m_objects.Length; ++index)
{
if (!indexDef.Canonicalizer.CanCanonicalize(this.m_objects[index]))
throw InfoCardTrace.ThrowHelperError((Exception) new InvalidOperationException(SR.GetString("StoreIndexObjectCanNotBeCanonicalized", (object) this.m_objects[index].GetType())));
byte[] sourceArray = indexDef.Canonicalizer.Canonicalize(this.m_objects[index]);
if (sourceArray.Length + destinationIndex > destinationArray.Length)
throw InfoCardTrace.ThrowHelperError((Exception) new InvalidOperationException(SR.GetString("StoreIndexObjectBufferOverflow", (object) indexDef.Name)));
Array.Copy((Array) sourceArray, 0, (Array) destinationArray, destinationIndex, sourceArray.Length);
destinationIndex += sourceArray.Length;
}
this.m_compiledForm = destinationArray;
}
}
}