What do these properties mean in Mono.Cecil?

I use the general Lokad libraries, which in turn are dependent on Mono.Cecil.

I am a bit confused about what the following properties mean (they are related to the internal components of .NET and therefore have equivalent internal components of .NET):

  • PackingSize (they refer to types, as in TypeDefinition).
  • Mvid (in ModuleDefinition).
  • ExplicitThis (something related to this keyword that I know, but in MethodDefinition).
  • CallingConvention.
  • GetSentinel (a method that returns an int in a MethodReference).
  • RVA
  • Semantics Attribute.
  • IsHideBySig.

Any idea what they mean / do?

+6
mono mono.cecil
source share
1 answer

I am not very familiar with Cecil, but most of these elements are associated with the IL file. Here are some answers - all taken from Serge Lidin's book: Expert.Net 2.0 IL Assembler.

  • Pack size = alignment factor in bytes. Must be set to 0 or power 2 from 1 to 128. (in the class layout metadata table) (p122)

  • Mvid = A globally unique identifier assigned to a module as it is created (or a module version identifier). (in the module metadata table) (p105)

  • Explicitly this = method call signature. The first parameter explicitly specified is the instance pointer. The ILAsm key is explicit. (P159)

  • CallingConvention = the first byte of the signature identifies the type of signature, which for historical reasons is called the calling signature agreement. (ex: default, vararg, field, localsig, property, unmgd, hasthis, explicitthis) p158-159

  • GetSentinel = most likely refers to the sentinel modifier, which means the start of the optional arguments provided to invoke the vararg method. (P152)

  • RVA = relative virtual address: the address of an element after it is loaded into memory with the base address of the image file subtracted from it, in other words, the offset of the element in the image file is loaded into memory. (P42)

  • SemanticsAttribute - most likely, something is related to the MethodSemantics table, which associates events and properties with methods associated with them and provides information about the type of association. Semantics can be a setter, getter, another (property) or addon, delete or fire (event) p317

  • IsHideBySig - the method hides all methods of the parent classes that have a consistent signature and name (as opposed to having only the corresponding name). P188

+6
source share

All Articles