MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-67b630ead60119692b9abbdfd8717c96904ef041127c2cae033c86b718eaa61e/Microsoft/InfoCards/IndexObject.cs

49 lines
2.1 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.IndexObject
// 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;
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;
}
}
}