1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
//! Raw `AssemblyRef` table representation.
//!
//! This module provides the [`crate::metadata::tables::assemblyref::raw::AssemblyRefRaw`] struct
//! for low-level access to `AssemblyRef` metadata table data with unresolved heap indexes. This
//! represents the binary format of assembly reference records as they appear in the metadata
//! tables stream before heap resolution.
//!
//! # Architecture
//!
//! The raw representation stores data exactly as it appears in the metadata tables stream,
//! with heap indexes that require resolution through the string and blob heaps. This is
//! part of the dual variant pattern used throughout the metadata system.
//!
//! # Key Components
//!
//! - [`crate::metadata::tables::assemblyref::raw::AssemblyRefRaw`] - Raw table row structure
//! - [`crate::metadata::tables::assemblyref::AssemblyRefRc`] - Reference-counted owned representation
//! - [`crate::metadata::tables::types::RowReadable`] - Table parsing interface implementation
//!
//! # `AssemblyRef` Table Format
//!
//! The `AssemblyRef` table (0x23) contains zero or more rows with these fields:
//! - **`MajorVersion`** (2 bytes): Major version number
//! - **`MinorVersion`** (2 bytes): Minor version number
//! - **`BuildNumber`** (2 bytes): Build number
//! - **`RevisionNumber`** (2 bytes): Revision number
//! - **Flags** (4 bytes): Assembly flags bitmask
//! - **`PublicKeyOrToken`** (2/4 bytes): Blob heap index for public key/token data
//! - **Name** (2/4 bytes): String heap index for assembly name
//! - **Culture** (2/4 bytes): String heap index for culture name
//! - **`HashValue`** (2/4 bytes): Blob heap index for hash data
//!
//! # Integration
//!
//! This module integrates with:
//! - [`crate::metadata::tables`] - Core metadata table infrastructure
//! - [`crate::metadata::streams`] - String and blob heap access
//! - [`crate::metadata::token`] - Token representation for metadata references
//! - [`crate::file::io`] - Binary data reading utilities
//!
//! # References
//!
//! - [ECMA-335 II.22.5](https://ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf) - `AssemblyRef` table specification
use ;
use crate::;
/// Raw `AssemblyRef` table row with unresolved heap indexes
///
/// Represents the binary format of an `AssemblyRef` metadata table entry (table ID 0x23) as stored
/// in the metadata tables stream. All string and blob references are stored as heap indexes
/// that must be resolved using the appropriate heaps to access the actual data.
///
/// The `AssemblyRef` table contains dependency information for external assemblies required by
/// the current assembly, including version requirements and strong name verification data.
///
/// # Table Layout
///
/// Each `AssemblyRef` table row occupies a fixed number of bytes determined by the heap index sizes:
/// - Version fields: 8 bytes (4 × 2-byte values)
/// - Flags: 4 bytes
/// - Heap indexes: Variable size based on heap sizes (2 or 4 bytes each)