Jump to content
Tuts 4 You

[INFO] Compressed Integer In .NET/CLI Metadata


sirp

Recommended Posts

Compressed Integer In .NET/CLI Metadata

In short, the compression algorithm is used to place a 32-bit integer (takes 4 bytes) into

as little as possible number of storage (1, 2, or 4 bytes).

This compression algorithm is widely used in .NET/CLI PE files, such as metadata signatures

,#blob stream and #US stream. In such cases, integers are used to save the number of records,

or size of data blocks. Since such numbers and sizes are all very small, use 32-bit integers

will cause many bytes set to 0, which makes no sense. In such cases, compressed integer can

effectively reduce the disk space a PE file takes, and saves network bandwidth.

Some scenarios of using compressed integer within a PE file are listed below:

In the beginning of each record in Blob heap (storage format of #Blob stream and #US stream),

compressed unsigned integer is used to store the size of the record data.

In the method metadata signature, compressed unsigned integer is used to store the number of

parameters.

In metadata signatures, lower bounds of each array are saved in compressed signed integer.

Note, all compression and decompression algorithm referred here are applied for 32-bit integer.

Also, if not special mentioned, all integers are present as big-endian (most significant

byte presents in left or on top).

check pdf

Compressed Integer In NET CLI Metadata.pdf

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...