Skip to content

InitialValue Of a Field #596

Answered by Washi1337
dashne asked this question in Q&A
Nov 18, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The initial value for fields are stored in a FieldRva row, which can be obtained by the FieldRva property:

FieldDefinition field = ...;

if (field.FieldRva is ISegment segment)
{
   // Field has FieldRva data (initial value).
   byte[] rawData = segment.WriteIntoArray();
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dashne
Comment options

Answer selected by dashne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question dotnet Issues related to AsmResolver.DotNet
2 participants