Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why CustomAttribute `Parent` column ` HasCustomAttribute` is different with ECMA335 ? and what is last two 0?

See original GitHub issue

ecma 22.10 say CustomAttribute Parent column HasCustomAttribute:

• Parent (an index into any metadata table, except the CustomAttribute table itself; more precisely, a HasCustomAttribute (§24.2.6) coded index)

why in dnlib is only 24 table ? and last two is 0?

public static readonly CodedToken HasCustomAttribute = new CodedToken(5, new Table[24] {
	Table.Method, Table.Field, Table.TypeRef, Table.TypeDef,
	Table.Param, Table.InterfaceImpl, Table.MemberRef, Table.Module,
	Table.DeclSecurity, Table.Property, Table.Event, Table.StandAloneSig,
	Table.ModuleRef, Table.TypeSpec, Table.Assembly, Table.AssemblyRef,
	Table.File, Table.ExportedType, Table.ManifestResource, Table.GenericParam,
	Table.GenericParamConstraint, Table.MethodSpec, 0, 0,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

WillDawnlllcommented, Dec 31, 2021

sorry , dnlib is same with ECMA335, I set wrong HasCustomAttribute relate tables .so table bits calculate wrong … thanks for help again.

WillDawnlllcommented, Dec 31, 2021

yes, but in dnlib ,maxRows compare with total 0xffff , is that mean all 16bits coded rid and no bit for table index? i notice some .net pe use 2bytes for coded index column , and one of relate coded table row number > remaining byte(for rid) , in ECMA335 it should be 4bytes , but in dnlib is 2bytes , and these files seem like dnlib is right .

Read more comments on GitHub >

github_iconTop Results From Across the Web

ECMA-335, 5th edition, December 2010
This Ecma Standard has been adopted by the General Assembly of December 2010. "DISCLAIMER ... of which the final character has the value...
Read more >
c# - Check if property has attribute
There's no fast way to retrieve attributes. But code ought to look like this (credit to Aaronaught): var t = typeof(YourClass); var pi...
Read more >
Partition II : Metadata
All standardized assemblies shall have the last two 32-bit integers set to 0. This standard places no other requirement on the use of...
Read more >
System.Reflection.Metadata.xml 1.3.0
Custom attribute value blob. </param> <remarks> Entries may be added in any order. The table is automatically sorted when serialized. </remarks>
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found