本文整理汇总了C#中PEReader.GetIndex方法的典型用法代码示例。如果您正苦于以下问题:C# PEReader.GetIndex方法的具体用法?C# PEReader.GetIndex怎么用?C# PEReader.GetIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEReader
的用法示例。
在下文中一共展示了PEReader.GetIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadNestedClassInfo
internal static void ReadNestedClassInfo(PEReader buff, uint num, uint[] parIxs)
{
for (int i = 0; i < parIxs.Length; i++) parIxs[i] = 0;
Contract.Requires(buff != null);
Contract.Requires(parIxs != null);
for (int i = 0; i < num; i++)
{
int ix = (int)buff.GetIndex(MDTable.TypeDef);
parIxs[ix - 1] = buff.GetIndex(MDTable.TypeDef);
}
}
示例2: Read
internal static void Read(PEReader buff, TableRow[] maps, MDTable tab)
{
Contract.Requires(maps != null);
Contract.Requires(buff != null);
if (tab == MDTable.NestedClass)
{
for (int i = 0; i < maps.Length; i++)
{
//maps[i] = new MapElem(buff,tab);
uint nestClassIx = buff.GetIndex(MDTable.TypeDef);
uint enclClassIx = buff.GetIndex(MDTable.TypeDef);
ClassDef parent = (ClassDef)buff.GetElement(MDTable.TypeDef, enclClassIx);
ClassDef nestClass = ((ClassDef)buff.GetElement(MDTable.TypeDef, nestClassIx)).MakeNestedClass(parent);
buff.InsertInTable(MDTable.TypeDef, nestClass.Row, nestClass);
}
}
else
{ // event or property map
MapElem prev = new MapElem(buff, tab);
maps[0] = prev;
for (int i = 1; i < maps.Length; i++)
{
maps[i] = new MapElem(buff, tab);
prev.endIx = ((MapElem)maps[i]).elemIx;
prev = (MapElem)maps[i];
}
switch (tab)
{
case MDTable.PropertyMap:
prev.endIx = buff.GetTableSize(MDTable.Property) + 1;
break;
case MDTable.EventMap:
prev.endIx = buff.GetTableSize(MDTable.Event) + 1;
break;
default:
prev.endIx = buff.GetTableSize(tab) + 1;
break;
}
}
}
示例3: MethodSemantics
internal MethodSemantics(PEReader buff)
{
Contract.Requires(buff != null);
type = (MethodType)buff.ReadUInt16();
methIx = buff.GetIndex(MDTable.Method);
assocIx = buff.GetCodedIndex(CIx.HasSemantics);
tabIx = MDTable.MethodSemantics;
}
示例4: MapElem
internal MapElem(PEReader buff, MDTable tab)
{
Contract.Requires(buff != null);
tabIx = tab;
classIx = buff.GetIndex(MDTable.TypeDef);
elemIx = buff.GetIndex(tab);
sortTable = tabIx == MDTable.NestedClass;
}
示例5: MethodImpl
internal MethodImpl(PEReader buff)
{
Contract.Requires(buff != null);
classIx = buff.GetIndex(MDTable.TypeDef);
methBodyIx = buff.GetCodedIndex(CIx.MethodDefOrRef);
methDeclIx = buff.GetCodedIndex(CIx.MethodDefOrRef);
tabIx = MDTable.MethodImpl;
}