MetaData specification (ECMA-335) contain PackedLen values.
But PackedLen not described in specification.
How to decode it?

Thanks,
Alex.

Re: ECMA-335: How to decode PackedLen by Mattias

Mattias
Thu Jun 10 20:07:19 CDT 2004

Alex,

>MetaData specification (ECMA-335) contain PackedLen values.
>But PackedLen not described in specification.
>How to decode it?

It's uses the compression algorithm described in 22.2



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Re: ECMA-335: How to decode PackedLen by Alex

Alex
Fri Jun 11 12:27:54 CDT 2004

22.2 describe how to decode encoded value. Probably PackedLen is not equal
to encoded value (?). For example in System.dll custom attribute signature
(22.3) contain follow bytes:
0x08 - blob length
0x01, 0x00 - Prolog
0xfc 0x17 0x00 0x00 - PackedLen? (incorrect encoded value)
0x00 0x00 - NumNamed

> Alex,
>
> >MetaData specification (ECMA-335) contain PackedLen values.
> >But PackedLen not described in specification.
> >How to decode it?
>
> It's uses the compression algorithm described in 22.2
>
>
>
> Mattias



Re: ECMA-335: How to decode PackedLen by Mattias

Mattias
Fri Jun 11 13:57:04 CDT 2004

Alex,

>22.2 describe how to decode encoded value. Probably PackedLen is not equal
>to encoded value (?).

Yes it is.


>For example in System.dll custom attribute signature
>(22.3) contain follow bytes:
>0x08 - blob length
>0x01, 0x00 - Prolog
>0xfc 0x17 0x00 0x00 - PackedLen? (incorrect encoded value)
>0x00 0x00 - NumNamed

I assume that blob is for the AttributeUsage attribute on
System.ComponentModel.EditorBrowsableAttribute, at least that's the
only occurance of that blob I found in System.dll.

If so, there's no PackedLen involved at all here. 0x000017fc is the
System.AttributeTargets value passed to the attributes first and only
positional parameter.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Re: ECMA-335: How to decode PackedLen by Alex

Alex
Fri Jun 11 14:47:58 CDT 2004

Thanks for answer Mattias,

1. Yes, this is attribute for
System.ComponentModel.EditorBrowsableAttribute.
Custom attribure parsed with method signature. Method signature is:
0x06 - blob size
0x20 - HASTHIS
0x01 - ParamCount
0x01 - ELEMENT_TYPE_VOID
0x11 - ELEMENT_TYPE_VALUETYPE
0x82, 0x6d - TypeRefOrDefEncoded: System.AttributeTargets

Probably, I something missing in spec. Before I think that Elem for
ELEMENT_VALUETYPE (0x11) must contain SerString (that include PackedLen as
prefix). This is wrong (?).
Spec says (syntax diagram on p. 145) that Elem contain Val for simple and
enum or contain SerString for string or type. Why custom attribute contain
value 0x000017fc?

2. If PackedLen is not equal to encoded value, than how to decode it? (this
is not described in ECMA-335).

Alex.

> >22.2 describe how to decode encoded value. Probably PackedLen is not
equal
> >to encoded value (?).
>
> Yes it is.
>
>
> >For example in System.dll custom attribute signature
> >(22.3) contain follow bytes:
> >0x08 - blob length
> >0x01, 0x00 - Prolog
> >0xfc 0x17 0x00 0x00 - PackedLen? (incorrect encoded value)
> >0x00 0x00 - NumNamed
>
> I assume that blob is for the AttributeUsage attribute on
> System.ComponentModel.EditorBrowsableAttribute, at least that's the
> only occurance of that blob I found in System.dll.
>
> If so, there's no PackedLen involved at all here. 0x000017fc is the
> System.AttributeTargets value passed to the attributes first and only
> positional parameter.
>
>
>
> Mattias



Re: ECMA-335: How to decode PackedLen by Alex

Alex
Fri Jun 11 15:06:19 CDT 2004

System.AttributeTargets is enum! (I forget verify that).
So one question staying:

2. If PackedLen is not equal to encoded value, than how to decode it? (this
is not described in ECMA-335).

> Thanks for answer Mattias,
>
> 1. Yes, this is attribute for
> System.ComponentModel.EditorBrowsableAttribute.
> Custom attribure parsed with method signature. Method signature is:
> 0x06 - blob size
> 0x20 - HASTHIS
> 0x01 - ParamCount
> 0x01 - ELEMENT_TYPE_VOID
> 0x11 - ELEMENT_TYPE_VALUETYPE
> 0x82, 0x6d - TypeRefOrDefEncoded: System.AttributeTargets
>
> Probably, I something missing in spec. Before I think that Elem for
> ELEMENT_VALUETYPE (0x11) must contain SerString (that include PackedLen as
> prefix). This is wrong (?).
> Spec says (syntax diagram on p. 145) that Elem contain Val for simple and
> enum or contain SerString for string or type. Why custom attribute contain
> value 0x000017fc?
>
> 2. If PackedLen is not equal to encoded value, than how to decode it?
(this
> is not described in ECMA-335).
>
> Alex.
>
> > >22.2 describe how to decode encoded value. Probably PackedLen is not
> equal
> > >to encoded value (?).
> >
> > Yes it is.
> >
> >
> > >For example in System.dll custom attribute signature
> > >(22.3) contain follow bytes:
> > >0x08 - blob length
> > >0x01, 0x00 - Prolog
> > >0xfc 0x17 0x00 0x00 - PackedLen? (incorrect encoded value)
> > >0x00 0x00 - NumNamed
> >
> > I assume that blob is for the AttributeUsage attribute on
> > System.ComponentModel.EditorBrowsableAttribute, at least that's the
> > only occurance of that blob I found in System.dll.
> >
> > If so, there's no PackedLen involved at all here. 0x000017fc is the
> > System.AttributeTargets value passed to the attributes first and only
> > positional parameter.
> >
> >
> >
> > Mattias
>
>



Re: ECMA-335: How to decode PackedLen by Mattias

Mattias
Mon Jun 14 05:08:12 CDT 2004

Alex,

>2. If PackedLen is not equal to encoded value, than how to decode it? (this
>is not described in ECMA-335).

It *is* equal.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.