这些属性在 Mono.Cecil 中意味着什么?
我正在使用 Lokad 共享库,而该库又依赖于 Mono.Cecil。
我有点困惑以下属性的含义(它们与 .NET 内部结构有关,因此具有等效的 .NET 内部结构):
- PackingSize(它们与 TypeDefinition 中的类型有关)。
- Mvid(在模块定义中)。
- ExplicitThis(与我知道的 this 关键字有关,但在 方法定义)。
- 调用约定。
- GetSentinel(在 MethodReference 中返回 int 的方法)。
- RVA。
- 语义属性。
- IsHideBySig。
知道这些是什么意思/做什么吗?
I am using Lokad shared libraries, which in turn depends on Mono.Cecil.
I am a little confused what the following properties mean (they are to do with .NET internals and thus have equivalent .NET internals):
- PackingSize (they are to do with types as it is in TypeDefinition).
- Mvid (in ModuleDefinition).
- ExplicitThis (something to do with the this keyword I know, but in
MethodDefinition). - CallingConvention.
- GetSentinel (a method which returns int in MethodReference).
- RVA.
- SemanticsAttribute.
- IsHideBySig.
Any idea what these mean/do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 Cecil 不太熟悉,但其中大部分项目都与 IL 文件相关。以下是一些答案 - 全部摘自 Serge Lidin 的书:Expert .Net 2.0 IL Assembler。
打包大小 = 对齐因子(以字节为单位)。必须设置为 0 或 1 到 128 之间的 2 的幂。(在类布局元数据表中)(p122)
Mvid = 全局唯一标识符,在生成时分配给模块(或模块版本 ID)。 (在模块元数据表中)(p105)
显式 This = 方法调用签名。第一个显式指定的参数是实例指针。 ILAsm 的关键工作是明确的。 (p159)
CallingConvention = 签名的第一个字节标识签名的类型,由于历史原因,称为签名的调用约定。 (例如:default、vararg、field、localsig、property、unmgd、hasthis、explicitthis) p158-159
GetSentinel = 最有可能与 Sentinel 修饰符有关,它表示为 vararg 方法调用提供的可选参数的开始。 (p152)
RVA = 相对虚拟地址:项目加载到内存后的地址,并从中减去图像文件的基地址 - 换句话说,项目在图像文件中的偏移量加载到内存中。 (p42)
SemanticsAttribute - 最有可能与 MethodSemantics 表有关,该表将事件和属性与其关联的方法连接起来,并提供有关关联类型的信息。语义可以是 setter、getter、其他(属性)或插件、removeon 或 fire(事件)p317
IsHideBySig - 该方法隐藏具有匹配签名和名称的父类的所有方法(而不是具有仅匹配名称)。 p188
I'm not too familiar with Cecil, but the majority of those items are related to the IL file. Here are some answers - all taken from Serge Lidin's book: Expert .Net 2.0 IL Assembler.
Packing Size = The alignment factor in bytes. Must be set to 0 or a power of 2 from 1 to 128. (in the class layout metadata table) (p122)
Mvid = globally unique identifier, assigned to the module as it is generated (or module version id). (in the module metadata table) (p105)
Explicit This = Method call signature. The first explicitly specified parameter is the instance pointer. The ILAsm keywork is explicit. (p159)
CallingConvention = the first byte of a signature identifies the type of the signature, which for historical reasons is called the calling convention of the signature. (ex: default, vararg, field, localsig, property, unmgd, hasthis, explicitthis) p158-159
GetSentinel = most likely has to do with the sentinel modifier, which signifies the beginning of optional arguments supplied for a vararg method call. (p152)
RVA = Relative virtual address: the address of an item once it has been loaded into memory, with the base address of the image file subtracted from it - in other words, the offset of an item within the image file loaded into memory. (p42)
SemanticsAttribute - most likely something to do with the MethodSemantics table, which connects events and properties with their associated methods and provides information regarding the type of association. A Semantic can be a setter, getter, other (property) or addon, removeon or fire (event) p317
IsHideBySig - the method hides all methods of the parent classes that have a matching signature and name (as opposed to having a matching name only). p188