forked from synopse/mORMot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mormot.misc.iso.pas
739 lines (664 loc) · 21 KB
/
mormot.misc.iso.pas
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
/// ISO 9660 CD/DVD File System Reader
// - this unit is a part of the Open Source Synopse mORMot framework 2,
// licensed under a MPL/GPL/LGPL three license - see LICENSE.md
unit mormot.misc.iso;
{
*****************************************************************************
ISO 9660 File System Reader, as used for optical disc media
- Low-Level ISO 9660 Encoding Structures
- Low-Level UDF Encoding Structures
- High-Level .iso File Reader
*****************************************************************************
}
interface
{$I ..\mormot.defines.inc}
uses
sysutils,
classes,
mormot.core.base,
mormot.core.os;
{ ************ Low-Level ISO 9660 Encoding Structures }
type
/// Date/Time encoded as 7 bytes
TVolumeDateTime = packed record
/// Number of years since 1900
Year: byte;
/// Month of the year from 1 to 12
Month: byte;
/// Day of the Month from 1 to 31
Day: byte;
/// Hour of the day from 0 to 23
Hour: byte;
/// Minute of the hour from 0 to 59
Minute: byte;
/// second of the minute from 0 to 59
Second: byte;
/// Offset from Greenwich Mean Time
// - number of 15 minute intervals from -48(West) to +52(East)
Zone: shortint;
end;
PVolumeDateTime = ^TVolumeDateTime;
TFileFlag = (
ffHidden,
ffDirectory,
ffAssociated,
ffInformationAvailable,
ffOwnerAvailable,
ffReserved5,
ffReserved6,
ffMoreThanOneDirectoryRecord);
TFileFlags = set of TFileFlag;
/// defines one directory/folder record
TDirectoryRecord = packed record
/// size of this Directory entry, in bytes
LengthOfDirectoryRecord: byte;
/// optional Extended Attribute Record size, in bytes
ExtendedAttributeRecordLength: byte;
/// logical extended block number, in bytes
LocationOfExtent: int64;
/// file section length, in bytes
DataLength: int64;
/// when the file was stored
RecordingDateAndTime: TVolumeDateTime;
/// define some file attriutes
FileFlags: TFileFlags;
/// is usually 0 - unless interleave mode is used
FileUnitSize: byte;
/// is usually 0 - unless interleave mode is used
InterleaveGapSize: byte;
/// ordinal number of the volume in the Volume
VolumeSequenceNumber: integer;
/// file identifier used size, in bytes
LengthOfFileIdentifier: byte;
/// file identifier content
FileIdentifier: array[0..0] of byte;
end;
PDirectoryRecord = ^TDirectoryRecord;
/// define one entry in the Path Table
TPathTableRecord = packed record
/// size of this Directory Identifier entry, in bytes
LengthOfDirectoryIdentifier: byte;
/// optional Extended Attribute Record size, in bytes
ExtendedAttributeRecordLength: byte;
/// logical extended block number, in bytes
LocationOfExtent: cardinal;
/// record number of the parent directory of this entry
ParentDirectoryNumber: word;
/// directory identifier content
DirectoryIdentifier: array[0..0] of byte;
end;
PPathTableRecord = ^TPathTableRecord;
TXBoxFileFlag = (
xfReadOnly,
xfHidden,
xfSystem,
xfReserved4,
xfDirectory,
xfArchive,
xfReserved7,
xfNormal);
TXBoxFileFlags = set of TXBoxFileFlag;
/// directory definition in XBOX format
TXBoxDirectoryRecord = packed record
/// offset to the left sub-tree entry
LeftSubTree: smallint;
/// offset to the right sub-tree entry
RightSubTree: smallint;
/// starting sector of the file
LocationOfExtent: cardinal;
/// total file size
DataLength: cardinal;
/// define some XBOX file attriutes
FileFlags: TXBoxFileFlags;
/// file identifier used size, in bytes
LengthOfFileIdentifier: byte;
/// file identifier content
FileIdentifier: array[0..0] of byte;
end;
PXBoxDirectoryRecord = ^TXBoxDirectoryRecord;
TMagicID = array[0..4] of AnsiChar;
TXBoxID = array[0..19] of AnsiChar;
TToritoID = array[0..31] of AnsiChar;
TAscDateTime = array[0..16] of AnsiChar;
TIdentifier8 = array[0..7] of AnsiChar;
TIdentifier23 = array[0..22] of AnsiChar;
TIdentifier24 = array[0..23] of AnsiChar;
TIdentifier28 = array[0..27] of AnsiChar;
TIdentifier32 = array[0..31] of AnsiChar;
TIdentifier36 = array[0..35] of AnsiChar;
TIdentifier37 = array[0..36] of AnsiChar;
TIdentifier62 = array[0..61] of AnsiChar;
TIdentifier128 = array[0..127] of AnsiChar;
const
CDSIGNATURE: TMagicID = 'CD001';
UDFBEA: TMagicID = 'BEA01';
UDFNSR02: TMagicID = 'NSR02';
UDFNSR03: TMagicID = 'NSR03';
UDFTEA: TMagicID = 'TEA01';
XBOXSIGNATURE: TXBoxID = 'MICROSOFT*XBOX*MEDIA';
TORITO: TToritoID = 'EL TORITO SPECIFICATION'; // padded with zeros
type
/// defines a Volume
TPrimaryVolumeDescriptor = packed record
VolumeDescriptorType: byte;
StandardIdentifier: TMagicID;
VolumeDescriptorVersion: byte;
Ununsed: byte;
SystemIdentifier: TIdentifier32;
VolumeIdentifier: TIdentifier32;
Unused2: array[0..7] of byte;
/// number of logical blocks in the Volume
VolumeSpaceSize: int64;
Unused3: array[0..31] of byte;
/// assigned Volum Set size
VolumeSetSize: cardinal;
/// ordinal number in the Volume Set
VolumeSequenceNumber: cardinal;
/// logical block size, in bytes
LogicalBlockSize: cardinal;
/// length of the Path Table, in bytes
PathTableSize: int64;
LocationOfTypeLPathTable: cardinal;
LocationOfOptionalTypeLPathTable: cardinal;
LocationOfTypeMPathTable: cardinal;
LocationOfOptionalTypeMPathTable: cardinal;
/// actual directory record the for root folder of this volume
DirectoryRecordForRootDirectory: TDirectoryRecord;
VolumeSetIdentifier: TIdentifier128;
PublisherIdentifier: TIdentifier128;
DataPreparerIdentifier: TIdentifier128;
ApplicationIdentifier: TIdentifier128;
CopyrightFileIdentifier: TIdentifier37;
AbstractFileIdentifier: TIdentifier37;
BibliographicFileIdentifier: TIdentifier37;
VolumeCreationDateAndTime: TAscDateTime;
VolumeModificationDateAndTime: TAscDateTime;
VolumeExpirationDateAndTime: TAscDateTime;
VolumeEffectiveDateAndTime: TAscDateTime;
FileStructureVersion: byte;
ReservedForFutureStandardization: byte;
ApplicationUse: array[0..511] of byte;
ReservedForFutureStandardization2: array[0..652] of byte;
end;
PPrimaryVolumeDescriptor = ^TPrimaryVolumeDescriptor;
TXBoxPrimaryVolumeDescriptor = packed record
/// should contain XBOXSIGNATURE constant
StandardIdentifier: TXBoxID;
LocationOfExtent: cardinal;
DataLength: cardinal;
/// Windows FILETIME 64-bit structure
FileTime: QWord;
Unused: array[0..1991] of byte;
/// should contain XBOXSIGNATURE constant
StandardIdentifier2: TXBoxID;
end;
PXBoxPrimaryVolumeDescriptor = ^TXBoxPrimaryVolumeDescriptor;
TXBoxVolumeDescriptor = TXBoxPrimaryVolumeDescriptor;
/// Volume with El Torito extension
TBootRecordVolumeDescriptor = packed record
/// must be 0
BootRecordIndicator: byte;
/// must equal CDSIGNATURE
StandardIdentifier: TMagicID;
/// must be 1
VersionOfDescriptor: byte;
/// must equal TORITO with zero padding
BootSystemIdentifier: TToritoID;
Unused: array[0..31] of byte;
/// absolute position to the Boot Catalog first sector
BootCatalogPointer: cardinal;
Unused2: array[0..1972] of byte;
end;
PBootRecordVolumeDescriptor = ^TBootRecordVolumeDescriptor;
TPlatformID = (
pi80x86,
piPowerPC,
piMac);
TValidationEntry = packed record
HeaderID: byte;
PlatformID: TPlatformID;
Reserved: word;
/// manufacturer of the CD-ROM
ID: TIdentifier24;
Checksum: word;
/// must be AA55
KeyWord: word;
end;
PValidationEntry = ^TValidationEntry;
TBootMediaType = (
bmtNone,
bmt12M,
bmt144M,
bmt288M,
bmtHardDisk);
/// define the initial entry of this media
TInitialEntry = packed record
/// Boot Indicator: 88 = Bootable, 00 = Not Bootable
Bootable: byte;
BootMediaType: TBootMediaType;
/// load segment
// - if 0 the system will use the traditional segment of 7C0
LoadSegment: word;
/// copy of byte 5 (System Type) from the Partition Table
SystemType: byte;
Reserved: byte;
/// number of virtual/emulated sectors loaded at boot
SectorCount: word;
/// start address of the virtual disk
LoadRBA: cardinal;
Reserved2: array[0..19] of byte;
end;
PInitialEntry = ^TInitialEntry;
TSectionHeaderEntry = packed record
/// flag 90 = more headers follow, 91 = final header
HeaderIndicator: byte;
PlatformID: TPlatformID;
NumberOfSectionEntries: word;
/// BIOS will check this identifier at startup
ID: TIdentifier28;
end;
PSectionHeaderEntry = ^TSectionHeaderEntry;
TSectionEntry = packed record
/// Boot Indicator: 88 = Bootable, 00 = Not Bootable
BootIndicator: byte;
/// low 0-3 bits = TBootMediaType
BootMediaType: byte;
LoadSegment: word;
SystemType: byte;
Reserved: byte;
SectorCount: word;
LoadRBA: cardinal;
SelectionCriteriaType: byte;
SelectionCriteria: array[0..18] of byte;
end;
TSectionEntryExtension = packed record
/// must be 44
ExtensionIndicator: byte;
/// bit 5 set = Extension Record follows, unset: this is final Extension
Bits: byte;
/// Vendor unique selection criteria
SelectionCriteria: array[0..29] of byte;
end;
TCatalogEntry = packed record
case integer of
0: (
Initial: TInitialEntry );
1: (
Header: TSectionHeaderEntry );
2: (
Entry: TSectionEntry );
3: (
Extension: TSectionEntryExtension );
end;
PCatalogEntry = ^TCatalogEntry;
TBootCatalog = packed record
Validation: TValidationEntry;
Entry: array[0..1] of TCatalogEntry;
end;
PBootCatalog = ^TBootCatalog;
TPartition = packed record
/// 0x80 - active
boot_ind: byte;
/// starting head
head: byte;
/// starting sector
sector: byte;
/// starting cylinder
cyl: byte;
/// What partition type
sys_ind: byte;
/// end head
end_head: byte;
/// end sector
end_sector: byte;
/// end cylinder
end_cyl: byte;
/// starting sector counting from 0
start_sect: cardinal;
/// nr of sectors in partition
nr_sects: cardinal;
end;
PPartition = ^TPartition;
/// map the Master Boot Loader on this Media
TMBR = packed record
Loader: array[0..445] of byte;
Partition: array[0..3] of TPartition;
Signature: word;
end;
PMBT = ^TMBR;
{ ************ Low-Level UDF Encoding Structures }
type
TTag = packed record
TagIdentifier: word;
DescriptionVersion: word;
TagChecksum: byte;
Reserved: byte;
TagSerialNumber: word;
DescriptorCRC: word;
DescriptorCRCLength: word;
TagLocation: cardinal;
end;
TCharSpec = packed record
CharacterSetType: byte;
/// should be "OSTA Compressed Unicode"
SharacterSetInfo: array[0..62] of byte;
end;
/// ECMA 167 1/7.3
TTimestamp = packed record
TypeAndTimezone: word;
Year: smallint;
Month: byte;
Day: byte;
Hour: byte;
Minute: byte;
Second: byte;
Centiseconds: byte;
HundredsofMicroseconds: byte;
Microseconds: byte;
end;
/// ECMA 167 1/7.4
TEntityID = packed record
Flags: byte;
Identifier: TIdentifier23;
IdentifierSuffix: TIdentifier8;
end;
TExtentAd = packed record
extLength: cardinal;
extLocation: cardinal;
end;
TShortAd = packed record
extLength: cardinal;
extPosition: cardinal;
end;
TLbAddr = packed record
logicalBlockNum: cardinal;
partitionReferenceNum: word;
end;
TLongAd = packed record
extLength: cardinal;
extLocation: TLbAddr;
impUse: array[0..5] of byte;
end;
TLVInformation = packed record
LVICharset: TCharSpec;
LogicalVolumeIdentifier: TIdentifier128;
LVInfo1: TIdentifier36;
LVInfo2: TIdentifier36;
LVInfo3: TIdentifier36;
ImplementationID: TEntityID;
ImplementationUse: array[0..127] of byte;
end;
TImplementationUse = packed record
ImplementationID: TEntityID;
NumberOfFiles: cardinal;
NumberOfDirectories: cardinal;
MinimumUDFReadRevision: word;
MinimumUDFWriteRevision: word;
MaximumUDFWriteRevision: word;
end;
/// ECMA 167 3/10.4
TImpUseVolumeDescriptor = packed record
DescriptorTag: TTag;
VolumeDescriptorSequenceNumber: cardinal;
ImplementationIdentifier: TEntityID;
case integer of
0: (
reserved: array[0..459] of byte);
1: (
Use: TImplementationUse);
end;
TPrimaryVolumeDescriptor_UDF = packed record
DescriptorTag: TTag;
VolumeDescriptorSequenceNumber: cardinal;
PrimaryVolumeDescriptorNumber: cardinal;
VolumeIdentifier: TIdentifier32;
VolumeSequenceNumber: word;
MaximumVolumeSequenceNumber: word;
InterchangeLevel: word;
MaximumInterchangeLevel: word;
CharacterSetList: cardinal;
MaximumCharacterSetList: cardinal;
VolumeSetIdentifier: TIdentifier128;
DescriptorCharacterSet: TCharSpec;
ExplanatoryCharacterSet: TCharSpec;
VolumeAbstract: TExtentAd;
VolumeCopyrightNotice: TExtentAd;
ApplicationIdentifier: TEntityID;
RecordingDateandTime: TTimestamp;
ImplementationIdentifier: TEntityID;
ImplementationUse: array[0..63] of byte;
PredecessorVolumeDescriptorSequenceLocation: cardinal;
Flags: word;
Reserved: array[0..21] of byte;
end;
PPrimaryVolumeDescriptor_UDF = ^TPrimaryVolumeDescriptor_UDF;
/// Generic Partition Map (ECMA 167r3 3/10.7.1)
TPartitionMap = packed record
MapType: byte;
MapLength: byte;
Mapping: array[0..1] of byte;
end;
/// Type 1 Partition Map (ECMA 167r3 3/10.7.2)
TPartitionMap1 = packed record
MapType: byte;
MapLength: byte;
VolumeSequenceNumber: word;
PartitionNumber: word;
end;
/// Type 2 Partition Map (ECMA 167r3 3/10.7.3)
TPartitionMap2 = packed record
MapType: byte;
MapLength: byte;
Ident: TIdentifier62;
end;
/// ECMA 167 3/10.6
TLogicalVolumeDescriptor = packed record
DescriptorTag: TTag;
VolumeDescriptorSequenceNumber: cardinal;
DescriptorCharacterSet: TCharSpec;
LogicalVolumeIdentifier: TIdentifier128;
LogicalBlockSize: cardinal;
DomainIdentifier: TEntityID;
LogicalVolumeContentsUse: TLongAd;
MapTableLength: cardinal;
NumberofPartitionMaps: cardinal;
ImplementationIdentifier: TEntityID;
ImplementationUse: array[0..127] of byte;
IntegritySequenceExtent: TExtentAd;
PartitionMaps: TPartitionMap;
end;
PLogicalVolumeDescriptor = ^TLogicalVolumeDescriptor;
/// ECMA 167 4/14.1
TFileSetDescriptor = packed record
DescriptorTag: TTag;
RecordingDateandTime: TTimestamp;
InterchangeLevel: word;
MaximumInterchangeLevel: word;
CharacterSetList: cardinal;
MaximumCharacterSetList: cardinal;
FileSetNumber: cardinal;
FileSetDescriptorNumber: cardinal;
LogicalVolumeIdentifierCharacterSet: TCharSpec;
LogicalVolumeIdentifier: TIdentifier128;
FileSetCharacterSet: TCharSpec;
FileSetIdentifier: TIdentifier32;
CopyrightFileIdentifier: TIdentifier32;
AbstractFileIdentifier: TIdentifier32;
RootDirectoryICB: TLongAd;
DomainIdentifier: TEntityID;
NextExtent: TLongAd;
SystemStreamDirectoryICB: TLongAd;
Reserved: array[0..31] of byte;
end;
/// ECMA 167 3/10.2
/// - this structure must be located at sector 256
TAnchorVolumeDescriptor = packed record
DescriptorTag: TTag;
MainVolumeDescriptorSequenceExtent: TExtentAd;
ReserveVolumeDescriptorSequenceExtent: TExtentAd;
Reserved: array[0..479] of byte;
end;
/// ECMA 167 4/14.3
TPartitionHeaderDescriptor = packed record
UnallocatedSpaceTable: TShortAd;
UnallocatedSpaceBitmap: TShortAd;
PartitionIntegrityTable: TShortAd;
FreedSpaceTable: TShortAd;
FreedSpaceBitmap: TShortAd;
Reserved: array[0..87] of byte;
end;
/// ECMA 167 3/10.5
TPartitionDescriptor = packed record
DescriptorTag: TTag;
VolumeDescriptorSequenceNumber: cardinal;
PartitionFlags: word;
PartitionNumber: word;
PartitionContents: TEntityID;
PartitionContentsUse: TPartitionHeaderDescriptor;
AccessType: cardinal;
PartitionStartingLocation: cardinal;
PartitionLength: cardinal;
ImplementationIdentifier: TEntityID;
ImplementationUse: array[0..127] of byte;
Reserved: array[0..155] of byte;
end;
PPartitionDescriptor = ^TPartitionDescriptor;
/// ECMA 167 3/10.10
TLogicalVolumeIntegrityDesc = packed record
DescriptorTag: TTag;
RecordingDateAndTime: TTimestamp;
IntegrityType: cardinal;
NextIntegrityExtent: TExtentAd;
LogicalVolumeContentsUse: array[0..31] of byte;
NumberOfPartitions: cardinal;
LengthOfImplementationUse: cardinal;
FreeSpaceTable: array[0..0] of cardinal;
SizeTable: array[0..0] of cardinal;
ImplementationUse: array[0..0] of byte;
end;
/// ECMA 167 3/10.8
TUnallocatedSpaceDesc = packed record
DescriptorTag: TTag;
VolumeDescriptorSequenceNumber: cardinal;
NumberofAllocationDescriptors: cardinal;
AllocationDescriptors: array[0..0] of TExtentAd;
end;
/// ECMA 167 4/14.6
TIcbTag = packed record
PriorRecordedNumberofDirectEntries: cardinal;
StrategyType: word;
StrategyParameter: array[0..1] of byte;
MaximumNumberofEntries: word;
Reserved: byte;
FileType: byte;
ParentICBLocation: TLbAddr;
Flags: word;
end;
/// ECMA 167 4/14.9
TFileEntry = packed record
DescriptorTag: TTag;
ICBTag: TIcbTag;
Uid: cardinal;
Gid: cardinal;
Permissions: cardinal;
FileLinkCount: word;
RecordFormat: byte;
RecordDisplayAttributes: byte;
RecordLength: cardinal;
InformationLength: QWord;
LogicalBlocksRecorded: QWord;
AccessTime: TTimeStamp;
ModificationTime: TTimeStamp;
AttributeTime: TTimeStamp;
Checkpoint: cardinal;
ExtendedAttributeICB: TLongAd;
ImplementationIdentifier: TEntityID;
UniqueID: QWord;
LengthOfExtendedAttributes: cardinal;
LengthOfAllocationDescriptors: cardinal;
case integer of
0: (
ExtendedAttributes: array[0..0] of byte);
1: (
AllocationDescriptor: array[0..0] of byte);
end;
/// ECMA 167 4/14.4
TFileIdentifierDescriptor = packed record
DescriptorTag: TTag;
FileVersionNumber: word;
FileCharacteristics: byte;
LengthOfFileIdentifier: byte;
ICB: TLongAd;
LengthOfImplementationUse: word;
case integer of
0: (
ImplementationUse: array[0..0] of byte);
1: (
FileIdentifier: array[0..0] of AnsiChar);
end;
TFileSetDescriptorEx = packed record
LogicalVolumeDescriptor: PLogicalVolumeDescriptor;
FileSetDescriptor: TFileSetDescriptor;
end;
PFileSetDescriptorEx = ^TFileSetDescriptorEx;
const
/// Tag Identifier (ECMA 167r3 3/7.2.1)
TAG_IDENT_PVD = $0001;
TAG_IDENT_AVDP = $0002;
TAG_IDENT_VDP = $0003;
TAG_IDENT_IUVD = $0004;
TAG_IDENT_PD = $0005;
TAG_IDENT_LVD = $0006;
TAG_IDENT_USD = $0007;
TAG_IDENT_TD = $0008;
TAG_IDENT_LVID = $0009;
/// Tag Identifier (ECMA 167r3 4/7.2.1)
TAG_IDENT_FSD = $0100;
TAG_IDENT_FID = $0101;
TAG_IDENT_AED = $0102;
TAG_IDENT_IE = $0103;
TAG_IDENT_TE = $0104;
TAG_IDENT_FE = $0105;
TAG_IDENT_EAHD = $0106;
TAG_IDENT_USE = $0107;
TAG_IDENT_SBD = $0108;
TAG_IDENT_PIE = $0109;
TAG_IDENT_EFE = $010A;
FATTR_HIDDEN = 1 shl ord(ffHidden);
FATTR_DIRECTORY = 1 shl ord(ffDirectory);
{ ************ High-Level .iso File Reader }
type
TUdfDetectedStage = (
no_udf,
udf_bea,
udf_nsr,
udf_tea);
TIsoImage = packed record
hFile: THandle;
//VolumeDescriptors: array of TPrimaryVolumeDescriptorEx;
DescriptorNum: cardinal;
DataOffset: cardinal;
HeaderSize: cardinal;
RealBlockSize: cardinal;
//DirectoryList: array of TDirectory;
DirectoryCount: cardinal;
Index: cardinal;
UdfStage: TUdfDetectedStage;
UdfOffset: cardinal;
UdfBlockSize: cardinal;
end;
TUdfImage = packed record
PrimaryVolumeDescriptor_UDF: PPrimaryVolumeDescriptor_UDF;
LogicalVolumeDescriptor: PLogicalVolumeDescriptor;
PartitionDescriptor: PPartitionDescriptor;
FileSetDescriptorEx: PFileSetDescriptorEx;
primary_num: integer;
logic_num: integer;
partition_desc_num: integer;
file_set_desc_num: integer;
end;
implementation
{ ************ Low-Level ISO 9660 Encoding Structures }
{ ************ High-Level .iso File Reader }
initialization
end.