MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07/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: 516D8B44-4448-4D2C-8B8E-FFBB3FFE472B
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07.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;
}
}
}