-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdcu32.rfi
3030 lines (2837 loc) · 61.8 KB
/
dcu32.rfi
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
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
This file describes the results of reverse engineering the DCU file format for
Delphi 2.0-8.0, 2005(.net and WIN32), 2006(.net and WIN32)/Turbo Delphi,
2009,2010,XE1-XE7/AppMethod, Kylix 1.0-3.0.
Note, that the FlexT file describes only the DCU memory layout aspects of file
format. The Pascal code for parsing DCUs (DCU32INT project) is published at
http://hmelnov.icc.ru/DCU/
*/
data
0x0000 ulong Magic
%$IF Magic=0xF21F148C;
//Kylix1.0
const
Ver=100;
descr ('Borland Kylix 1.0 unit file.')
%$ELSIF Magic=0x0E1011DD;
//Kylix2.0
const
Ver=101;
descr ('Borland Kylix 2.0 unit file.')
%$ELSIF Magic=0x0E0001DD;
//Kylix2.0, another magic
const
Ver=101;
descr ('Borland Kylix 2.0 unit file (kind $00).')
%$ELSIF (Magic=0x0F1001DD)or(Magic=0x0F0001DD);
//Kylix3.0
const
Ver=102;
descr ('Borland Kylix 3.0 unit file.')
%$ELSIF Magic=0x1C00034D;
//Borland Delphi XE7 or AppMethod
const
Ver=20;
descr ('Borland Delphi XE7 or AppMethod AppMethod (win32) unit file.')
%$ELSIF Magic=0x1C00234D;
//Borland Delphi XE7 or AppMethod
const
Ver=20;
mode64=1;
descr ('Borland Delphi XE7 or AppMethod AppMethod (win64) unit file.')
%$ELSIF Magic=0x1C00044D;
//Borland Delphi XE7 or AppMethod
const
Ver=20;
descr ('Borland Delphi XE7 or AppMethod AppMethod (osx32) unit file.')
%$ELSIF Magic=0x1C00144D;
//Borland Delphi XE7 or AppMethod
const
Ver=20;
iOs=1;
descr ('Borland Delphi XE7 or AppMethod (iosEmulator) unit file.')
%$ELSIF Magic=0x1C00764D;
//Borland Delphi XE7 or AppMethod
const
Ver=20;
iOs=2;
descr ('Borland Delphi XE7 or AppMethod (iosDevice) unit file.')
%$ELSIF Magic=0x1C00774D;
//Borland Delphi XE6 or AppMethod
const
Ver=20;
iOs=3;
descr ('Borland Delphi XE7 or AppMethod (Android) unit file.')
%$ELSIF Magic=0x1B00034D;
//Delphi XE6
const
Ver=19;
descr ('Borland Delphi XE6 (win32) unit file.')
%$ELSIF Magic=0x1B00234D;
//Delphi XE6
const
Ver=19;
mode64=1;
descr ('Borland Delphi XE6 (win64) unit file.')
%$ELSIF Magic=0x1B00044D;
//Delphi XE6
const
Ver=19;
descr ('Borland Delphi XE6 (osx32) unit file.')
%$ELSIF Magic=0x1B00144D;
//Delphi XE6
const
Ver=19;
iOs=1;
descr ('Borland Delphi XE6 (iosEmulator) unit file.')
%$ELSIF Magic=0x1B00764D;
//Delphi XE6
const
Ver=19;
iOs=2;
descr ('Borland Delphi XE6 (iosDevice) unit file.')
%$ELSIF Magic=0x1B00774D;
//Delphi XE6
const
Ver=19;
iOs=3;
descr ('Borland Delphi XE6 (Android) unit file.')
%$ELSIF Magic=0x1A00034B;
//Delphi XE5
const
Ver=18;
descr ('Borland Delphi XE5 (win32) unit file.')
%$ELSIF Magic=0x1A00234B;
//Delphi XE5
const
Ver=18;
mode64=1;
descr ('Borland Delphi XE5 (win64) unit file.')
%$ELSIF Magic=0x1A00044B;
//Delphi XE5
const
Ver=18;
descr ('Borland Delphi XE5 (osx32) unit file.')
%$ELSIF Magic=0x1A00144B;
//Delphi XE5
const
Ver=18;
iOs=1;
descr ('Borland Delphi XE5 (iosEmulator) unit file.')
%$ELSIF Magic=0x1A00764B;
//Delphi XE5
const
Ver=18;
iOs=2;
descr ('Borland Delphi XE5 (iosDevice) unit file.')
%$ELSIF Magic=0x1A00774B;
//Delphi XE5
const
Ver=18;
iOs=3;
descr ('Borland Delphi XE5 (Android) unit file.')
%$ELSIF Magic=0x1900034B;
//Delphi XE4
const
Ver=17;
descr ('Borland Delphi XE4 (win32) unit file.')
%$ELSIF Magic=0x1900234B;
//Delphi XE4
const
Ver=17;
mode64=1;
descr ('Borland Delphi XE4 (win64) unit file.')
%$ELSIF Magic=0x1900044B;
//Delphi XE4
const
Ver=17;
descr ('Borland Delphi XE4 (osx32) unit file.')
%$ELSIF Magic=0x1900144B;
//Delphi XE4
const
Ver=17;
iOs=1;
descr ('Borland Delphi XE4 (iosEmulator) unit file.')
%$ELSIF Magic=0x1900764B;
//Delphi XE4
const
Ver=17;
iOs=2;
descr ('Borland Delphi XE4 (iosDevice) unit file.')
%$ELSIF Magic=0x1800034B;
//Delphi XE3
const
Ver=16;
descr ('Borland Delphi XE3 (win32) unit file.')
%$ELSIF Magic=0x1800234B;
//Delphi XE3
const
Ver=16;
mode64=1;
descr ('Borland Delphi XE3 (win64) unit file.')
%$ELSIF Magic=0x1800044B;
//Delphi XE3
const
Ver=16;
descr ('Borland Delphi XE3 (osx32) unit file.')
%$ELSIF Magic=0x1700034B;
//Delphi XE2
const
Ver=15;
descr ('Borland Delphi XE2 (win32) unit file.')
%$ELSIF Magic=0x1700234B;
//Delphi XE2
const
Ver=15;
mode64=1;
descr ('Borland Delphi XE2 (win64) unit file.')
%$ELSIF Magic=0x1700044B;
//Delphi XE2
const
Ver=15;
descr ('Borland Delphi XE2 (osx32) unit file.')
%$ELSIF Magic=0x1600034B;
//Delphi XE
const
Ver=14;
descr ('Borland Delphi XE unit file.')
%$ELSIF Magic=0x15000045;
//Delphi2010
const
Ver=13;
descr ('Borland Delphi 2010 unit file.')
%$ELSIF Magic=0x14000039;
//Delphi2009
const
Ver=12;
descr ('Borland Delphi 2009 unit file.')
%$ELSIF Magic=0x1200024D;
//Delphi 2006 .net
const
Ver=10;
MSIL=1;
descr ('Borland Delphi 2006 unit file.')
%$ELSIF Magic=0x12000023;
//Delphi 2006
const
Ver=10;
descr ('Borland Delphi 2006 unit file.')
%$ELSIF Magic=0x11000239;
//Delphi 2005 .net
const
Ver=9;
MSIL=1;
descr ('Borland Delphi 2005 MSIL unit file.')
%$ELSIF (Magic=0x1100000D)or(Magic=0x11800009); //0x11800009 in DUnitMainForm.dcu
//Delphi 2005
const
Ver=9;
descr ('Borland Delphi 2005 unit file.')
%$ELSIF Magic=0x10000229;
//Delphi8.0
const
Ver=8;
MSIL=1;
descr ('Borland Delphi 8.0 MSIL unit file.')
%$ELSIF Magic and 0xFF80FFFF=0xFF0000DF;
//Delphi7.0
const
Ver=7;
descr ('Borland Delphi 7.0 (Free) unit file.')
%$ELSIF Magic and 0xFF00FFFF=0x0F0000DF;
//Delphi7.0
const
Ver=7;
descr ('Borland Delphi 7.0 unit file.')
%$ELSIF Magic and 0xFF80FFFF=0x0E0000DD;
//Delphi6.0
const
Ver=6;
descr ('Borland Delphi 6.0 unit file.')
%$ELSIF Magic and 0xFF80FFFF=0x0E8000DD;
//Delphi6.0, another magic
const
Ver=6;
descr ('Borland Delphi 6.0 unit file (kind $80).')
%$ELSIF Magic=0xF21F148B;
//Delphi5.0
const
Ver=5;
descr ('Borland Delphi 5.0 unit file.')
%$ELSIF Magic=0x4768A6D8;
//Delphi4.0
const
Ver=4;
descr ('Borland Delphi 4.0 unit file.')
%$ELSIF Magic=0x44518641; //'A†QD'
//Delphi3.0
const
Ver=3;
descr ('Borland Delphi 3.0 unit file.')
%$ELSIF Magic=0x50505348; //HSPP
//Delphi2.0
const
Ver=2;
descr ('Borland Delphi 2.0 unit file.')
%$ELSE
assert 0; //fail
%$END
%$IF not defined MSIL;
const
MSIL=0;
%$END
%$IF not defined Packaged;
const
Packaged=0;
%$END
%$IF Packaged;
%$IF (Ver<6);
const
PkgNdxFlag=0x80;
%$ELSE
const
PkgNdxFlag=0x100;
%$END
%$END
%$IF not defined mode64;
const
mode64=0;
%$END
%$IF not defined iOs;
const
iOs=0;
%$END
descr (NL,
'Info Src: Partially reconstructed by me (Alexei Hmelnov (mailto:alex@icc.ru)).',NL,
'Info Src: DoDi''s DCU Documentation (mailto:VBDis@aol.com)',NL)
const
IsKylix = Ver>=100;
IsDelphi = Ver<100;
gen7 = (Ver>=7) and IsDelphi or (Ver>=102);
type
TDCU30RecTag enum char (
drStop=0,
drStop_a='a', //Last Tag in all files
drStop1='c',
%$IF Packaged and MSIL/*(Ver=8)*/and IsDelphi;
drAssemblyData='b', //Last Tag of Assembly description?
%$END
drUnit='d',
drUnit1='e', //in implementation
drImpType='f',
drImpVal='g',
drDLL='h',
drExport='i',
drEmbeddedProcStart='j',
drEmbeddedProcEnd='k',
drCBlock='l',
drFixUp='m',
drImpTypeDef='n', //import of type definition by "A = type B"
%$IF (Ver>=8)and IsDelphi;
drORec='o', //goes before drCBlock
%$IF (Ver>=10)and IsDelphi;
drStrConstRec='6',
%$ELSE
drStrConstRec='5',
%$END
%$END
drSrc='p',
drObj='q',
drRes='r',
drAsm='s', //Observed in D5
%$IF Packaged and MSIL/*(Ver=8)*/and IsDelphi;
drAssemblySrc='t',
%$END
drStop2='Ÿ', //!!!
drConst=0x25, //'%',
%$IF (Ver>=10)and IsDelphi;
drThreadVar='2',
drResStr='3',
%$ELSE
drThreadVar='1',
drResStr='2',
%$END
drType='*',
drTypeP='&',
drProc='(',
drSysProc=')',
drVar=0x20, //' ',
drVarC=0x27, //''',
drAbsVar='$',
drVoid='@',
drLabel='+',
drBoolRangeDef='A',
drChRangeDef='B',
drEnumDef='C',
drRangeDef='D',
drPtrDef='E',
drClassDef='F',
drObjVMTDef='G',
drProcTypeDef='H',
drFloatDef='I',
drSetDef='J',
drShortStrDef='K',
drArrayDef='L',
drRecDef='M',
drObjDef='N',
drFileDef='O',
drTextDef='P',
drWCharRangeDef='Q', //WideChar
drStringDef='R',
drVariantDef='S',
drInterfaceDef='T',
drWideStrDef='U',
drWideRangeDef='V',
%$IF (Ver>=8)and IsDelphi;
drMetaClassDef='W', //?? guess name
%$IF (Ver>=12)and IsDelphi;
drDynArrayDef='X', //Separate from drArrayDef tag now
drTemplateArgDef='Y',
drTemplateCall='Z',
drUnicodeStringDef='[',
%$IF (Ver>=13)and IsDelphi;
drUnitInlineSrc='v',
%$END
%$END
%$END
//Various tables
drCodeLines=0x90,
drLinNum=0x91,
drStrucScope=0x92,
drSymbolRef=0x93,
drLocVarTbl=0x94,
drUnitFlags=0x96,
%$IF IsKylix; //Kylix specific flags
// drUnit3=0xE0, //4-bytes record, present in almost all units
// drUnit3s=0x06, //3-bytes record, present in System and SysInit
drUnit4=0x0F, //5-bytes record, was observed in QOpenBanner.dcu only
%$ELSIF Ver>=7;
%$IF (Ver>=10)and IsDelphi;
drUnitAddInfo='5',
%$ELSE
drUnitAddInfo='4',
%$END
drProcAddInfo=0x9E,
%$END
%$IF gen7;
drConstAddInfo=0x9C, //caused by the "platform" keyword
%$END
%$IF (Ver>=9)(Ver<=10)and MSIL;
drAssemblyInfo=0x9D, //The unit is from package generated for assemmbly
%$END
%$IF (Ver>=3)and IsDelphi;
drInfo98=0x98,
%$END
%$IF (Ver>=10)and IsDelphi;
// drAddInfo6='6',
drSpecVar='7',
drCLine=0xA0,
drA1Info=0xA1,
drA2Info=0xA2,
%$IF (Ver>=12)and IsDelphi;
arCopyDecl=0xA3,
drA5Info=0xA5,
drA6Info=0xA6,
drA7Info=0xA7,
drA8Info=0xA8,
%$IF (Ver>=17)and IsDelphi;
drA9Info=0xA9,
%$END
drDelayedImpInfo=0xB0,
%$END
%$IF (Ver>=15)and IsDelphi /*and mode64*/;
drSegInfo=0xB1,
drB2Info=0xB2,
%$END
%$IF (Ver>=20)and IsDelphi;
drNextOverload=0xB6,
%$END
%$END
drSetDeft=0x9A //Set Default parameter value
)
type bit
TBit num+(1)
TBit2 num+(2)
TBit3 num+(3)
TBit4 num+(4)
TBit7 num+(7)
TBit8 num+(8)
TBit14 num+(14)
TBit21 num+(21)
TBit28 num+(28)
TBit32 num+(32)
TNDXB1b struc pas
F: TBit
V: TBit7
ends:assert[@.F=0]: displ=(HEX(@.V))
TNDXB2b struc pas
F: TBit2
V: TBit14
ends:assert[@.F=0x1]: displ=(HEX(@.V))
TNDXB3b struc pas
F: TBit3
V: TBit21
ends:assert[@.F=0x3]: displ=(HEX(@.V))
TNDXB4b struc pas
F: TBit4
V: TBit28
ends:assert[@.F=0x7]: displ=(HEX(@.V))
TNDXB5b struc pas
F: TBit8
V: TBit32
ends:assert[@.F=0xF]: displ=(HEX(@.V))
TNDXB9b struc pas
F: TBit8 //F=0xFF: Delphi 4.0 - 64 bit
Lo: TBit32
Hi: TBit32
ends: displ=(HEX(@.Hi),HEX(@.Lo,8))
TNDXB1 try
b1: TNDXB1b
b2: TNDXB2b
b3: TNDXB3b
b4: TNDXB4b
b5: TNDXB5b
b9: TNDXB9b
endt: displ=('#',@):let Val=@.b1.V exc @.b2.V exc @.b3.V exc
@.b4.V exc @.b5.V exc @.b9.Lo/*8-byte values are not supported in FlexT yet*/;
/*
TNDXB1 struc pas
IsW: TBit
V: case @.IsW of
0: TBit7
else struc pas
IsB3: TBit
V: case @.IsB3 of
0: TBit14
else struc pas
IsB4: TBit
V: case @.IsB4 of
0: TBit21
else struc pas
IsB5: TBit
V: case @.IsB5 of
0: TBit28
else struc pas
Z: TBit4
V: case @.Z of
0: TBit32
else struc pas //0xF: Delphi 4.0 - 64 bit
Lo: TBit32
Hi: TBit32
ends: displ=(HEX(@.Hi),HEX(@.Lo))
endc: displ=((@.0)exc(@.0xF))
ends
endc:displ=((@.0)exc(@.1))
ends
endc:displ=((@.0)exc(@.1.V))
ends
endc:displ=((@.0)exc(@.1.V))
ends
endc:displ=((@.0)exc(@.1.V))
ends:displ=('#',@.V):let Val=(@.V.0)exc((@.V.1.V.0)exc
((@.V.1.V.1.V.0)exc((@.V.1.V.1.V.1.V.0)exc
(@.V.1.V.1.V.1.V.1.V/*4.0*/.0))));
*/
/*
TFileTime struc pas
S: num+(5)
M: num+(6)
H: num+(5)
D: num+(5)
Mon: num+(4)
Y: num+(7)
ends:displ=(INT(@.D),'.',INT(@.Mon),'.',INT(@.Y+1980),' ',
INT(@.H),':',INT(@.M),':',INT(@.S*2))
*/
%$IF IsDelphi;
include DOSFTime.rfi
%$ELSE
include UNIXTime.rfi
type
TFileTime TTimeStamp
%$END
type
%$IF (Ver>=12)and IsDelphi;
TNameStr struc pas
L: byte
LL: case @.L of
0xFF: ulong
endc
S: array[(@.LL.0xFF)exc @.L]of char
ends: displ=(@.S)
%$ELSE
TNameStr str
%$END
TDCU30ListC forward
TSrcInf struc pas
FT: TFileTime
B: TNDXB1
%$IF MSIL;
path: str
%$END
ends
%$IF Packaged and MSIL/*(Ver=8)*/and IsDelphi;
TAssemblySrcInf struc pas
FT: TFileTime
B: TNDXB1
ends
%$END
%$IF (Ver>7)and IsDelphi;
TResInf struc pas
FT: TFileTime
B: TNDXB1
ends
%$ELSE
TResInf TSrcInf
%$END
TUnitInf struc pas
%$IF (Ver>=8)and IsDelphi;
hPack: TNDXB1
%$END
%$IF (Ver>=10)and IsDelphi;
Inf: TNDXB1
%$ELSE
Inf: ulong
%$END
%$IF (Ver=7)and IsDelphi;
X: ulong
//%$ELSIF (Ver>=8)and IsDelphi;
// X: byte
%$END
%$IF (Ver>=12)and IsDelphi;
X: TNDXB1
%$END
L: TDCU30ListC
ends
%$IF (Ver>=13)and IsDelphi;
TUnitInlineSrcInf struc pas
Inf: ulong
B: TNDXB1 //Source number
ends
%$END
%$IF (Ver>=8)and IsDelphi;
TDLLInf struc pas
%$IF (Ver>=10)and IsDelphi;
Inf: TNDXB1
%$ELSE
Inf: ulong
%$END
X: ulong
%$IF (Ver>=12)and IsDelphi;
X: TNDXB1 //analogously to TUnitInf b0: Byte
%$END
L: TDCU30ListC
ends
%$ELSE
TDLLInf TUnitInf
%$END
TImpTypeDefInf struc pas
RTTISz: TNDXB1//L: Byte
Inf: ulong
ends
TExportInf struc pas
hSym: TNDXB1
Index: TNDXB1
ends
TNameFDeclBase(NoInf) struc pas
B: TNDXB1
%$IF (Ver>=8)and IsDelphi;
B1: TNDXB1
%$END
%$IF (Ver>=12)and IsDelphi;
B3: TNDXB1
%$END
Inf: case (@:NoInf xor 1)*(@.B:Val and 0x40) of
0x40: ulong
endc
/*%$IF Packaged and(Ver>=3);
PkgNdx: case @.B:Val and PkgNdxFlag of
PkgNdxFlag: TNDXB1
endc
%$END*/
%$IF (Ver>=8)and IsDelphi;
B2: case @.B1:Val and 0x80 of
0x80: struc pas
X: TNDXB1 //Base type for defs like TX = type TY
//when TX and TY both in the same unit,
//earlier versions were just duplicating definitions
%$IF (Ver=8)and IsDelphi;
Z: case @@@.B:Val and 0x08 of
0x08: TNDXB1 //always 0
endc
%$END
ends
endc
%$END
ends
TNameFDecl TNameFDeclBase(0)
TTypeInf(NoInf) struc pas
NF: TNameFDeclBase(@:NoInf)
hDef: TNDXB1
%$IF Packaged and((Ver>=3)and(Ver<=8)or(Ver>=100));
PkgNdx: case @.NF.B:Val and PkgNdxFlag of
PkgNdxFlag: TNDXB1
endc
%$END
ends
TTypePInf struc pas
NF: TNameFDecl
hDef: TNDXB1
// B1: Byte
B1: TNDXB1
%$IF Packaged and((Ver>=3)and(Ver<=8)or(Ver>=100));
PkgNdx: case @.NF.B:Val and PkgNdxFlag of
PkgNdxFlag: TNDXB1
endc
%$END
ends
TVarInf struc pas
NF: TNameFDecl
hDT: TNDXB1
Ofs: TNDXB1 //hDT: TNDXB1 //B0: Byte
%$IF Packaged and((Ver>=3)and(Ver<=8)or(Ver>=100));
PkgNdx: case @.NF.B:Val and PkgNdxFlag of
PkgNdxFlag: TNDXB1
endc
%$END
ends
%$IF Packaged;
TResStrDef struc pas
NF: TNameFDecl
hDT: TNDXB1
Ofs: TNDXB1 //hDT: TNDXB1 //B0: Byte
%$IF Packaged and((Ver>=3)and(Ver<=8)or(Ver>=100));
PkgNdx: case @.NF.B:Val and PkgNdxFlag of
PkgNdxFlag: TNDXB1
endc
%$END
ends
%$ELSE
TResStrDef TVarInf
%$END
%$IF (Ver>=15)and IsDelphi /*and mode64*/;
TConstVal(Kind) struc pas
Sz: TNDXB1
Val: case (@.Sz.b1.V)exc 1 of
0: case @@:Kind of
4: void
else TNDXB1
endc
else raw[@@.Sz:Val]
endc
ends
%$ELSE
TConstVal struc pas
Sz: TNDXB1
Val: case (@.Sz.b1.V)exc 1 of
0: TNDXB1
else raw[@@.Sz:Val]
endc
ends
%$END
TConstDef struc pas
NF: TNameFDecl
//Inf: ulong
hDT: TNDXB1
%$IF Ver>4;
Kind: TNDXB1 //O - scalar, 1 - string (offset=8), 2 - resourcestring,
//3-float, 4 - set,
//[ver>=verD12] 5 - Unicode string (offset=12)
//for 64-bit mode 4 means pointer
%$END
%$IF (Ver>=15)and IsDelphi /*and mode64*/;
Val: TConstVal(@.Kind:Val)
%$ELSE
Val: TConstVal
%$END
ends
/*
TResStrDef struc pas
b80: Byte
Inf: case @.b80 and 0x80 of
0x80: ulong
endc
hDT: TNDXB1
Ofs: TNDXB1
/*
NDX1: TNDXB1
B1: Byte
B2: Byte
V: TNDXB1
Val: TConstVal
*/
ends
*/
TProcArgTag enum TDCU30RecTag (
arStop='c',
arVal='!',
arVar='"',
arResult='#',
arAbsLocVar='$',
arLabel='+',
arLocVar=0x20,//' ',
arConst=0x25, //'%',
arLocType='*',
arEmbeddedProcEnd='k', //For Ver 5.0
//Fields
arFld=',',
%$IF (Ver>=10)and IsDelphi;
arClassVar='-',
arMethod='.',
arConstr='/',
arDestr='0',
arProperty='1',
%$ELSE
arMethod='-',
arConstr='.',
arDestr='/',
arProperty='0',
%$END
arCDecl=0x81,
arPascal=0x82,
arStdCall=0x83,
arSafeCall=0x84,
%$IF (Ver>=10)and IsDelphi;
arCopyDecl=0xA3,
%$END
%$IF (Ver>=13)and IsDelphi;
arAnonymousBlock=0x01,
%$END
%$IF (Ver>=16)and IsDelphi;
arFinalFlag=0xC2,
%$END
arSetDeft=0x9A //Set Default parameter value
)
TPropInfo struc pas
Flags: TNDXB1
%$IF (Ver>=8)and IsDelphi;
FlagsEx: TNDXB1 //For Ver>=8 public=0x1,protected=0x2,published=0x5,class=0x10
%$END
%$IF (Ver>=12)and IsDelphi;
X4: TNDXB1
%$END
hDT: TNDXB1
Ndx: TNDXB1
hIndex: TNDXB1 //property index
/* D0Fl0: ulong
B80: Byte */
hRead: TNDXB1
hWrite: TNDXB1
hStored: TNDXB1
/* D0Fl1: ulong
B80a: Byte */
%$IF (Ver>=8)and IsDelphi;
//It looks like the next two fields contain references
//to the class members specified in Pascal source for read and
//write when compiler had to change calling convention or something else,
//and hRead or hWrite point to the thunk methods created by the compiler
hReadOrig: TNDXB1
hWriteOrig: TNDXB1
%$IF MSIL;
X2: TNDXB1
X3: TNDXB1
%$END
%$END
hDeft: TNDXB1
ends
TSetDeftInfo struc pas
hConst: TNDXB1
hArg: TNDXB1
/* sdB0: Byte
sdB1: Byte
sdB2: Byte
sdB3: Byte
*/
ends
//%$IF (Ver>=7)and IsDelphi;
%$IF gen7;
%$IF (Ver>=8)and IsDelphi;
TConstAddInfo01Rec struc pas
hDef: TNDXB1
V: TNDXB1
Len: TNDXB1
SD: case @.Len:Val>0 of
1: struc pas
Name: array[@@@.Len:Val]of Char
Cnt: TNDXB1
Defs: array[@.Cnt:Val] of TNDXB1
ends
endc
ends
TStrNDXB1 struc pas
Len: TNDXB1
V: array[@.Len:Val]of Char
ends
TConstAddInfo0A_7Rec struc pas
Name: TStrNDXB1
V: TNDXB1
V1: TNDXB1
hDT: TNDXB1
ends
const
%$IF (Ver>=12)and IsDelphi;
cafInline=0x40000;
cafBigVal=0x80000;
%$ELSE
cafInline=0x80000;
cafBigVal=0x100000;
%$END
type
TConstAddInfoRec struc pas
Tag: Byte
D: case @.Tag of
0x01: struc pas
hDef: TNDXB1
F: TNDXB1 //$1-deprecated,$2-Platform,$80000-Inline
%$IF (Ver>=10)and IsDelphi and(iOs=0);
IP1: case @.F:Val and 0x1000000 of
0x1000000: TNDXB1 //Some int(4)
endc
%$END
%$IF MSIL; //and(Ver<=9);
%$IF (Ver>=9)and IsDelphi;
IP2: case @.F:Val and 0x10000 of
0x10000: struc pas
L: TNDXB1
sCSharp: array[@.L:Val]of Char
ends
endc
%$END
Cnt: TNDXB1
Tbl: array[@.Cnt:Val] of TConstAddInfo01Rec
%$END
/**/
%$IF (Ver>=9)and IsDelphi;
%$IF (Ver>=12)and IsDelphi;
hUsedCl: case @.F:Val and 0x800000/*0x840000*/ of
0x800000: TNDXB1 ////Class reference, when 0x40000 already in Inline
//Since D2010 it is generated for attributes and contains the attribute class type reference
//The attribute constructor and its parameters are missing and can be found in RTTI memory only
//until D_XE6, when the 0x80000000 flag had been introduced
endc
%$END
%$IF (Ver>=12)and IsDelphi;
Deprecated: case @.F:Val and 0x1 of
0x1: TStrNDXB1
endc
%$END
%$IF (Ver>=19)and IsDelphi;
Attribute: case @.F:Val and 0x80000000=0 of
0: struc pas
N: TNDXB1 //Attribute count
Attrs: array[@.N:Val] of struc pas
hAttrCtor: TNDXB1 //Attribute constructor
MemberKind: TNDXB1 //[Result: Unsafe] Result=#D
hAttrDT: TNDXB1 //Attribute type
ArgCnt: TNDXB1
Args: array[@.ArgCnt:Val]of struc pas
ArgKind: TNDXB1 //Argument Kind
Arg: case @.ArgKind:Val of
0: struc pas //const
hArgT: TNDXB1 //Argument type