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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Threading;
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Local
// ReSharper disable UnusedParameter.Local
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable EmptyGeneralCatchClause
// ReSharper disable RedundantCast
// ReSharper disable PossibleNullReferenceException
// ReSharper disable AssignNullToNotNullAttribute
// ReSharper disable UnusedMember.Global
namespace UnitTestProject.RefVm
{
// Token: 0x02000032 RID: 50
public class VmExecutor // \u0006\u2007
{
#region subclasses
// Token: 0x02000033 RID: 51
[Serializable]
private sealed class CatchBlockComparer // \u0002
{
// Token: 0x060002B0 RID: 688 RVA: 0x00012EB4 File Offset: 0x000110B4
internal int Compare(CatchBlock v1, CatchBlock v2) // \u0002
{
if (v1.ExcTypeId == v2.ExcTypeId)
{
return v2.Start.CompareTo(v1.Start);
}
return v1.ExcTypeId.CompareTo(v2.ExcTypeId);
}
// Token: 0x04000155 RID: 341
public static readonly CatchBlockComparer Instance = new CatchBlockComparer(); // \u0002
// Token: 0x04000156 RID: 342
public static Comparison<CatchBlock> MyComparison; // \u0003
}
// Token: 0x02000038 RID: 56
private sealed class StringTypePair // \u0006
{
// Token: 0x060002C0 RID: 704 RVA: 0x00013020 File Offset: 0x00011220
// Token: 0x060002C1 RID: 705 RVA: 0x00013028 File Offset: 0x00011228
// Token: 0x0400015D RID: 349
public string Str { get; set; } // \u0002
// Token: 0x060002C3 RID: 707 RVA: 0x0001303C File Offset: 0x0001123C
// Token: 0x060002C2 RID: 706 RVA: 0x00013034 File Offset: 0x00011234
// Token: 0x0400015E RID: 350
public Type T { get; set; } // \u0002
}
// Token: 0x02000039 RID: 57
// (Invoke) Token: 0x060002C5 RID: 709
private delegate object DynamicExecutor(object obj, object[] args); // \u0008
// Token: 0x0200003A RID: 58
// (Invoke) Token: 0x060002C9 RID: 713
internal delegate void VmInstrImpl(VariantBase t); // \u000E
// Token: 0x0200003B RID: 59
private sealed class VmInstr // \u000F
{
// Token: 0x060002CC RID: 716 RVA: 0x00013048 File Offset: 0x00011248
public VmInstr(VmInstrInfo id, VmInstrImpl func)
{
Id = id;
Func = func;
}
// Token: 0x0400015F RID: 351
public readonly VmInstrInfo Id; // \u0002
// Token: 0x04000160 RID: 352
public readonly VmInstrImpl Func; // \u0003
}
// Token: 0x02000037 RID: 55
private sealed class ExcHandlerFrame // \u0005
{
// Token: 0x060002BB RID: 699 RVA: 0x00012FF0 File Offset: 0x000111F0
// Token: 0x060002BC RID: 700 RVA: 0x00012FF8 File Offset: 0x000111F8
// Token: 0x0400015B RID: 347
public uint Pos { get; set; }
// Token: 0x060002BD RID: 701 RVA: 0x00013004 File Offset: 0x00011204
// Token: 0x060002BE RID: 702 RVA: 0x0001300C File Offset: 0x0001120C
// Token: 0x0400015C RID: 348
public object Exception { get; set; }
}
// Token: 0x02000034 RID: 52
internal struct MethodBaseAndVirtual : IEquatable<MethodBaseAndVirtual> // \u0002\u2000
{
public MethodBaseAndVirtual(MethodBase mb, bool isVirtual)
{
Val = mb;
IsVirtual = isVirtual;
}
// Token: 0x060002B1 RID: 689 RVA: 0x00012EF8 File Offset: 0x000110F8
// Token: 0x060002B2 RID: 690 RVA: 0x00012F00 File Offset: 0x00011100
// Token: 0x04000157 RID: 343
public MethodBase Val /* \u0002 */ { get; }
// Token: 0x060002B3 RID: 691 RVA: 0x00012F0C File Offset: 0x0001110C
// Token: 0x060002B4 RID: 692 RVA: 0x00012F14 File Offset: 0x00011114
// Token: 0x04000158 RID: 344
public bool IsVirtual /* \u0003 */ { get; }
// Token: 0x060002B5 RID: 693 RVA: 0x00012F20 File Offset: 0x00011120
public override int GetHashCode()
{
return Val.GetHashCode() ^ IsVirtual.GetHashCode();
}
// Token: 0x060002B6 RID: 694 RVA: 0x00012F48 File Offset: 0x00011148
public override bool Equals(object o)
{
if (o is MethodBaseAndVirtual)
{
return Equals((MethodBaseAndVirtual)o);
}
return false;
}
// Token: 0x060002B7 RID: 695 RVA: 0x00012F70 File Offset: 0x00011170
public bool Equals(MethodBaseAndVirtual val)
{
return IsVirtual == val.IsVirtual && Val == val.Val;
}
}
// Token: 0x02000035 RID: 53
private struct BoolHolder // \u0003
{
// Token: 0x04000159 RID: 345
public bool Val; // \u0002
}
// Token: 0x02000036 RID: 54
private sealed class IntToTypeComparer<T> : IComparer<KeyValuePair<int, T>> // \u0003\u2000
{
// Token: 0x060002B8 RID: 696 RVA: 0x00012F94 File Offset: 0x00011194
public IntToTypeComparer(Comparison<T> c)
{
_c = c;
}
// Token: 0x060002B9 RID: 697 RVA: 0x00012FA4 File Offset: 0x000111A4
public int Compare(KeyValuePair<int, T> v1, KeyValuePair<int, T> v2)
{
var num = _c(v1.Value, v2.Value);
if (num == 0)
{
return v2.Key.CompareTo(v1.Key);
}
return num;
}
// Token: 0x0400015A RID: 346
private readonly Comparison<T> _c;
}
// Token: 0x0200000B RID: 11
private static class HiByte // \u0002\u2008
{
// Token: 0x06000056 RID: 86 RVA: 0x00003154 File Offset: 0x00001354
public static int Extract(int src) // \u0002
{
return src & -16777216; // 0xFF000000
}
}
#endregion
#region members
// Token: 0x04000132 RID: 306
private static readonly Type MethodBaseType = typeof(MethodBase); // \u0002\u2001
// Token: 0x04000133 RID: 307
private VmMethodHeader _methodHeader; // \u000E
// Token: 0x04000134 RID: 308
private readonly MyCollection<VariantBase> _evalStack = new MyCollection<VariantBase>(); // \u0003\u2003
// Token: 0x04000135 RID: 309
private readonly Dictionary<int, object> AllMetadataById = new Dictionary<int, object>(); // \u0006\u2003
// Token: 0x04000136 RID: 310
private readonly VmInstrCodesDb _instrCodesDb; // \u0006\u2001
// Token: 0x04000137 RID: 311
private object _exception; // \u0006\u2002
// Token: 0x04000138 RID: 312
private readonly Dictionary<MethodBase, object> _mbDynamicLock = new Dictionary<MethodBase, object>(); // \u0008\u2002
// Token: 0x04000139 RID: 313
private BinaryReader _srcVirtualizedStreamReader; // \u0002\u2000
// Token: 0x0400013A RID: 314
private Type _currentClass; // \u000F\u2001
// Token: 0x0400013B RID: 315
private static readonly Type AssemblyType = typeof(Assembly); // \u0002\u2003
// Token: 0x0400013C RID: 316
private readonly Dictionary<MethodBase, int> _mbCallCnt = new Dictionary<MethodBase, int>(256); // \u0006
// Token: 0x0400013D RID: 317
private Stream _srcVirtualizedStream; // \u000F\u2000
// Token: 0x0400013E RID: 318
private object[] _callees; // \u0005\u2000
// Token: 0x0400013F RID: 319
private readonly MyCollection<ExcHandlerFrame> _ehStack = new MyCollection<ExcHandlerFrame>(); // \u000F
// Token: 0x04000140 RID: 320
private VariantBase[] _localVariables; // \u0003\u2002
// Token: 0x04000141 RID: 321
private readonly Dictionary<MethodBaseAndVirtual, DynamicExecutor> _dynamicExecutors = new Dictionary<MethodBaseAndVirtual, DynamicExecutor>(256); // \u0002\u2002
// Token: 0x04000142 RID: 322
private bool _retFound; // \u0005\u2003
// Token: 0x04000143 RID: 323
private MyBufferReader _myBufferReader; // \u0002
// Token: 0x04000144 RID: 324
private Type[] _classGenericArgs; // \u0003
// Token: 0x04000145 RID: 325
private readonly Module _module; // \u0008\u2001
// Token: 0x04000146 RID: 326
private long _myBufferPos; // \u0005
// Token: 0x04000147 RID: 327
private byte[] _methodBody; // \u0008
// Token: 0x04000148 RID: 328
private static readonly Type ObjectArrayType = typeof(object[]); // \u000E\u2001
// Token: 0x04000149 RID: 329
private static readonly Dictionary<MethodBase, DynamicMethod> DynamicMethods = new Dictionary<MethodBase, DynamicMethod>(); // \u000E\u2003
// Token: 0x0400014A RID: 330
private bool _wasException; // \u0008\u2000
// Token: 0x0400014B RID: 331
private Type[] _methodGenericArgs; // \u0005\u2001
// Token: 0x0400014C RID: 332
private CatchBlock[] _catchBlocks; // \u000F\u2003
// Token: 0x0400014D RID: 333
private static readonly object InterlockedLock = new object(); // \u0008\u2003
// Token: 0x0400014E RID: 334
private uint? _storedPos; // \u000E\u2000
// Token: 0x0400014F RID: 335
private const bool _alwaysFalse = false; // \u000F\u2002
// Token: 0x04000150 RID: 336
private Dictionary<int, VmInstr> _vmInstrDb; // \u000E\u2002
// Token: 0x04000151 RID: 337
private VariantBase[] _variantOutputArgs; // \u0005\u2002
// Token: 0x04000152 RID: 338
private const bool _alwaysTrue = true; // \u0003\u2001
// Token: 0x04000153 RID: 339
private static readonly Type IntPtrType = typeof(IntPtr); // \u0003\u2000
// Token: 0x04000154 RID: 340
private static readonly Type VoidType = typeof(void); // \u0006\u2000
#endregion
// Token: 0x0600016C RID: 364 RVA: 0x00007958 File Offset: 0x00005B58
public VmExecutor(VmInstrCodesDb instrCodesDb, Module m)
{
_instrCodesDb = instrCodesDb;
_module = m;
Init();
}
// Token: 0x060001B6 RID: 438 RVA: 0x000092E0 File Offset: 0x000074E0
private void Init() // \u000F
{
if (!_instrCodesDb.IsInitialized())
{
lock (_instrCodesDb)
{
if (!_instrCodesDb.IsInitialized())
{
_vmInstrDb = CreateVmInstrDb();
DoNothing();
_instrCodesDb.SetInitialized(true);
}
}
}
if (_vmInstrDb == null)
{
_vmInstrDb = CreateVmInstrDb();
}
}
// Token: 0x060001BD RID: 445 RVA: 0x00009534 File Offset: 0x00007734
private void DoNothing() // \u0006
{}
// Token: 0x06000239 RID: 569 RVA: 0x0000F9C4 File Offset: 0x0000DBC4
private VariantBase PopVariant() // \u0002
{
return _evalStack.PopBack();
}
// Token: 0x060002A0 RID: 672 RVA: 0x000127D8 File Offset: 0x000109D8
private long PopLong() // \u0002
{
var top = PopVariant();
switch (top.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum: return VariantBase.SignedLongFromEnum((EnumVariant)top); // bug was fixed and unit tested (Convert.ToInt64(((EnumVariant)top).GetValue());)
case VariantBase.Vtc.Tc13UIntPtr: return (long)((UIntPtrVariant)top).GetValue().ToUInt64();
case VariantBase.Vtc.Tc17IntPtr: return ((IntPtrVariant)top).GetValue().ToInt64();
case VariantBase.Vtc.Tc19Int: return ((IntVariant)top).GetValue();
}
throw new Exception(StringDecryptor.GetString(-1550345551) /* Unexpected value on the stack. */);
}
// Token: 0x060001A1 RID: 417 RVA: 0x00008CC4 File Offset: 0x00006EC4
private void Ldelem(Type t) // \u0002
{
var index = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
PushVariant(VariantFactory.Convert(array.GetValue(index), t));
}
// Token: 0x0600020C RID: 524 RVA: 0x0000C528 File Offset: 0x0000A728
private void Ldelem_(VariantBase vTypeId) // \u0006\u200A\u2000
{
var typeId = ((IntVariant)vTypeId).GetValue();
var type = GetTypeById(typeId);
Ldelem(type);
}
// Token: 0x060002A5 RID: 677 RVA: 0x00012A80 File Offset: 0x00010C80
private void PushVariant(VariantBase obj) // \u0008\u2000\u2001
{
if (obj == null)
{
throw new ArgumentNullException(StringDecryptor.GetString(-1550345950) /* obj */);
}
VariantBase push;
if (obj.GetVariantType() != null)
{
push = obj;
}
else
{
switch (obj.GetTypeCode())
{
case VariantBase.Vtc.Tc1Bool:
{
var tmp = new IntVariant();
tmp.SetValue(((BoolVariant)obj).GetValue() ? 1 : 0);
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc6Char:
{
var tmp = new IntVariant();
tmp.SetValue(((CharVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc7Ulong:
{
var tmp = new LongVariant();
tmp.SetValue((long)((UlongVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc8Float:
{
var tmp = new FloatVariant();
tmp.SetValue(((FloatVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc9Uint:
{
var tmp = new IntVariant();
tmp.SetValue((int)((UintVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc10Ushort:
{
var tmp = new IntVariant();
tmp.SetValue(((UshortVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc12Sbyte:
{
var tmp = new IntVariant();
tmp.SetValue(((SbyteVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc14Byte:
{
var tmp = new IntVariant();
tmp.SetValue(((ByteVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc15Short:
{
var tmp = new IntVariant();
tmp.SetValue(((ShortVariant)obj).GetValue());
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
break;
}
case VariantBase.Vtc.Tc18Object:
{
var abs = obj.GetValueAbstract();
if (abs == null)
{
push = obj;
break;
}
var type = abs.GetType();
if (type.HasElementType && !type.IsArray)
{
type = type.GetElementType();
}
if (type != null && !type.IsValueType && !type.IsEnum)
{
push = obj;
break;
}
push = VariantFactory.Convert(abs, type);
break;
}
case VariantBase.Vtc.Tc17IntPtr:
case VariantBase.Vtc.Tc13UIntPtr:
if(IntPtr.Size == 4)
{
var tmp = new IntVariant();
tmp.CopyFrom(obj);
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
}
else
{
var tmp = new LongVariant();
tmp.CopyFrom(obj);
tmp.SetVariantType(obj.GetVariantType());
push = tmp;
}
break;
default:
push = obj;
break;
}
}
_evalStack.PushBack(push);
}
// Token: 0x0600027D RID: 637 RVA: 0x00011C24 File Offset: 0x0000FE24
private void Conv_ovf_i4_un_(VariantBase dummy) // \u0003\u200B
{
Conv_i4(true, false);
}
// Token: 0x06000283 RID: 643 RVA: 0x00011E9C File Offset: 0x0001009C
public static void Sort<T>(T[] arr, Comparison<T> c) // \u0002
{
var array = new KeyValuePair<int, T>[arr.Length];
for (var i = 0; i < arr.Length; i++)
{
array[i] = new KeyValuePair<int, T>(i, arr[i]);
}
Array.Sort(array, arr, new IntToTypeComparer<T>(c));
}
// Token: 0x060001BE RID: 446 RVA: 0x00009538 File Offset: 0x00007738
private void SortCatchBlocks() // \u0003\u2000
{
if (CatchBlockComparer.MyComparison == null)
{
CatchBlockComparer.MyComparison = CatchBlockComparer.Instance.Compare;
}
Sort(_catchBlocks, CatchBlockComparer.MyComparison);
}
// Token: 0x0600016D RID: 365 RVA: 0x000079C8 File Offset: 0x00005BC8
public VmExecutor(VmInstrCodesDb instrCodesDb, Stream virtualizedStream = null) : this(instrCodesDb, typeof(VmExecutor).Module) // \u0006\u2007
{
_srcVirtualizedStream = virtualizedStream;
}
// Token: 0x0600023C RID: 572 RVA: 0x0000FA0C File Offset: 0x0000DC0C
public object Invoke(Stream virtualizedStream, string pos, object[] args) // \u0002
{
// ReSharper disable once IntroduceOptionalParameters.Global
return Invoke(virtualizedStream, pos, args, null, null, null);
}
// Token: 0x0600017A RID: 378 RVA: 0x00007DCC File Offset: 0x00005FCC
public object Invoke(Stream virtualizedStream, string pos, object[] args, Type[] methodGenericArgs, Type[] classGenericArgs, object[] callees) // \u0002
{
_srcVirtualizedStream = virtualizedStream;
Seek(pos, virtualizedStream);
return Invoke(args, methodGenericArgs, classGenericArgs, callees);
}
// Token: 0x060001C5 RID: 453 RVA: 0x00009A34 File Offset: 0x00007C34
private Type GetTypeById(int id) // \u0002
{
Type result;
lock (AllMetadataById)
{
var flag = true;
object o;
if (AllMetadataById.TryGetValue(id, out o))
{
result = (Type)o;
}
else
{
var token = ReadToken(id);
if (token.IsVm == 0)
{
var type = _module.ResolveType(token.MetadataToken);
AllMetadataById.Add(id, type);
result = type;
}
else
{
var vmToken = (VmClassTokenInfo)token.VmToken;
if (vmToken.IsOuterClassGeneric)
{
if (vmToken.OuterClassGenericMethodIdx!= -1)
{
result = _methodGenericArgs[vmToken.OuterClassGenericMethodIdx];
}
else
{
if (vmToken.OuterClassGenericClassIdx== -1)
{
throw new Exception();
}
result = _classGenericArgs[vmToken.OuterClassGenericClassIdx];
}
result = ElementedTypeHelper.PopType(result, ElementedTypeHelper.NestedElementTypes(vmToken.ClassName));
}
else
{
var className = vmToken.ClassName.Replace("\u0005 ,", "forms_cil.Trial,"); //TODO: в общем случае это лишнее
result = Type.GetType(className);
if (result == null)
{
var num = className.IndexOf(',');
var shortClassName = className.Substring(0, num);
var asmName = className.Substring(num + 1, className.Length - num - 1).Trim();
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (var assembly in assemblies)
{
string value = null;
try
{
value = assembly.Location;
}
catch (NotSupportedException)
{
}
if (string.IsNullOrEmpty(value) && assembly.FullName.Equals(asmName, StringComparison.Ordinal))
{
result = assembly.GetType(shortClassName);
if (result != null)
{
break;
}
}
}
if (result == null && shortClassName.StartsWith(StringDecryptor.GetString(-1550345235) /* <PrivateImplementationDetails>< */, StringComparison.Ordinal) && shortClassName.Contains(StringDecryptor.GetString(-1550345325) /* . */))
{
try
{
var types = Assembly.Load(asmName).GetTypes();
foreach (var t in types.Where(type3 => type3.FullName == shortClassName))
{
result = t;
break;
}
}
// ReSharper disable once EmptyGeneralCatchClause
catch
{
}
}
}
if (vmToken.IsGeneric)
{
var array = new Type[vmToken.GenericArguments.Length];
for (var j = 0; j < vmToken.GenericArguments.Length; j++)
{
array[j] = GetTypeById(vmToken.GenericArguments[j].MetadataToken);
}
var genericTypeDefinition = ElementedTypeHelper.TryGoToElementType(result).GetGenericTypeDefinition();
var c = ElementedTypeHelper.NestedElementTypes(result);
result = ElementedTypeHelper.PopType(genericTypeDefinition.MakeGenericType(array), c);
flag = false;
}
if (flag)
{
AllMetadataById.Add(id, result);
}
}
}
}
}
return result;
}
// Token: 0x060001A6 RID: 422 RVA: 0x00008DAC File Offset: 0x00006FAC
public object Invoke(object[] args, Type[] methodGenericArgs, Type[] classGenericArgs, object[] callees) // \u0002
{
if (args == null)
{
args = EmptyArray<object>.Data;
}
if (methodGenericArgs == null)
{
methodGenericArgs = Type.EmptyTypes;
}
if (classGenericArgs == null)
{
classGenericArgs = Type.EmptyTypes;
}
_callees = callees;
_methodGenericArgs = methodGenericArgs;
_classGenericArgs = classGenericArgs;
_variantOutputArgs = ArgsToVariantOutputArgs(args);
_localVariables = CreateLocalVariables();
object result;
try
{
using (var b = new MyBuffer(_methodBody))
{
using (_myBufferReader = new MyBufferReader(b))
{
_retFound = false;
_storedPos = null;
_evalStack.Clear();
InternalInvoke();
}
}
var retType = GetTypeById(_methodHeader.ReturnTypeId);
if (retType != VoidType && _evalStack.Count > 0)
{
var pop = PopVariant();
try
{
result = VariantFactory.Convert(null, retType).CopyFrom(pop).GetValueAbstract();
}
catch (Exception)
{
result = pop.GetValueAbstract(); // example: ckfinite with no numeric
//throw;
}
}
else
{
result = null;
}
}
finally
{
for (var i = 0; i < _methodHeader.ArgsTypeToOutput.Length; i++)
{
var argTypeToOutput = _methodHeader.ArgsTypeToOutput[i];
if (argTypeToOutput.IsOutput)
{
var argOutValue = (VariantBaseHolder)_variantOutputArgs[i];
var argType = GetTypeById(argTypeToOutput.TypeId);
args[i] = VariantFactory.Convert(null, argType.GetElementType()).CopyFrom(argOutValue.GetValue()).GetValueAbstract();
}
}
_callees = null;
_variantOutputArgs = null;
_localVariables = null;
}
return result;
}
// Token: 0x06000269 RID: 617 RVA: 0x00010F7C File Offset: 0x0000F17C
private void Seek(string pos, Stream virtualizedStream) // \u0002
{
Seek(0L, virtualizedStream, pos);
}
// Token: 0x0600025C RID: 604 RVA: 0x00010B38 File Offset: 0x0000ED38
private void DoNothing(BinaryReader dummy) // \u0002
{
}
// Token: 0x06000250 RID: 592 RVA: 0x000106EC File Offset: 0x0000E8EC
private static CatchBlock ReadCatchBlock(BinaryReader r) // \u0002
{
return new CatchBlock
{
Kind = r.ReadByte(),
ExcTypeId = r.ReadInt32(),
Pos = r.ReadUInt32(),
PosKind4 = r.ReadUInt32(),
Start = r.ReadUInt32(),
Len = r.ReadUInt32()
};
}
// Token: 0x060001FC RID: 508 RVA: 0x0000BD50 File Offset: 0x00009F50
private static CatchBlock[] ReadCatchBlocks(BinaryReader r) // \u0002
{
var num = (int)r.ReadInt16();
var array = new CatchBlock[num];
for (var i = 0; i < num; i++)
{
array[i] = ReadCatchBlock(r);
}
return array;
}
// Token: 0x060001BF RID: 447 RVA: 0x00009564 File Offset: 0x00007764
private static byte[] ReadByteArray(BinaryReader r) // \u0002
{
var num = r.ReadInt32();
var array = new byte[num];
r.Read(array, 0, num);
return array;
}
// Token: 0x060001C1 RID: 449 RVA: 0x000096E4 File Offset: 0x000078E4
public void Seek(long parsedPos, Stream virtualizedStream, string pos) // \u0002
{
var input = new VmStreamWrapper(virtualizedStream, VmXorKey());
_srcVirtualizedStreamReader = new BinaryReader(input);
var baseStream = _srcVirtualizedStreamReader.BaseStream;
lock (baseStream)
{
if (pos != null)
{
parsedPos = ParsePos(pos);
}
_srcVirtualizedStreamReader.BaseStream.Seek(parsedPos, SeekOrigin.Begin);
DoNothing(_srcVirtualizedStreamReader);
_methodHeader = ReadMethodHeader(_srcVirtualizedStreamReader);
_catchBlocks = ReadCatchBlocks(_srcVirtualizedStreamReader);
SortCatchBlocks();
_methodBody = ReadByteArray(_srcVirtualizedStreamReader);
}
}
// Token: 0x06000203 RID: 515 RVA: 0x0000C164 File Offset: 0x0000A364
private long ParsePos(string pos) // \u0002
{
using (var memoryStream = new MemoryStream(VmPosParser.Parse(pos)))
{
return new BinaryReader(new VmStreamWrapper(memoryStream, PosXorKey())).ReadInt64();
}
}
// Token: 0x060001B5 RID: 437 RVA: 0x000092D8 File Offset: 0x000074D8
private int PosXorKey() // \u0002
{
return -2023764088;
}
// Token: 0x0600017B RID: 379 RVA: 0x00007DEC File Offset: 0x00005FEC
public static int VmXorKey() // \u0003
{
return 1783652397;
}
// Token: 0x060001E7 RID: 487 RVA: 0x0000B0F8 File Offset: 0x000092F8
private LocalVarType ReadLocalVarType(BinaryReader r) // \u0002
{
return new LocalVarType { TypeId = r.ReadInt32() };
}
// Token: 0x060001AB RID: 427 RVA: 0x00008FF8 File Offset: 0x000071F8
private LocalVarType[] ReadLocalVarTypes(BinaryReader r) // \u0002
{
var array = new LocalVarType[r.ReadInt16()];
for (var i = 0; i < array.Length; i++)
{
array[i] = ReadLocalVarType(r);
}
return array;
}
// Token: 0x0600023B RID: 571 RVA: 0x0000F9E0 File Offset: 0x0000DBE0
private ArgTypeToOutput ReadArgTypeToOutput(BinaryReader r) // \u0002
{
var ret = new ArgTypeToOutput
{
TypeId = r.ReadInt32(),
IsOutput = r.ReadBoolean()
};
return ret;
}
// Token: 0x06000287 RID: 647 RVA: 0x00012138 File Offset: 0x00010338
private ArgTypeToOutput[] ReadArgsTypeToOutput(BinaryReader r) // \u0002
{
var array = new ArgTypeToOutput[r.ReadInt16()];
for (var i = 0; i < array.Length; i++)
{
array[i] = ReadArgTypeToOutput(r);
}
return array;
}
// Token: 0x06000216 RID: 534 RVA: 0x0000C790 File Offset: 0x0000A990
private VmMethodHeader ReadMethodHeader(BinaryReader src) // \u0002
{
var ret = new VmMethodHeader
{
ClassId = src.ReadInt32(),
ReturnTypeId = src.ReadInt32(),
LocalVarTypes = ReadLocalVarTypes(src),
Flags = src.ReadByte(),
Name = src.ReadString(),
ArgsTypeToOutput = ReadArgsTypeToOutput(src)
};
return ret;
}
// Token: 0x06000266 RID: 614 RVA: 0x00010C54 File Offset: 0x0000EE54
private void Shr_un_(VariantBase dummy) // \u000F\u2001
{
PushVariant(Shift(false, false));
}
// Token: 0x06000176 RID: 374 RVA: 0x00007CAC File Offset: 0x00005EAC
private void Shr_(VariantBase dummy) // \u0005\u2007\u2000
{
PushVariant(Shift(false, true));
}
private VariantBase Xor(VariantBase org_v1, VariantBase org_v2)
{
VariantBase v1, v2;
var tc = CommonType(org_v1, org_v2, out v1, out v2, true);
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
uvret.SetValue(uv1 ^ uv2);
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
ivret.SetValue(iv1 ^ iv2);
break;
case VariantBase.Vtc.Tc21Double:
{
/*double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue(); // естественный алгоритм
long lv1 = (dv1 < 0) ? (long)dv1 : (long)(ulong)dv1;
long lv2 = (dv2 < 0) ? (long)dv2 : (long)(ulong)dv2;
var dvret = new DoubleVariant();
ret = dvret;
var l64 = (ulong) lv1 ^ (ulong) lv2;
if (l64 >> 32 == UInt32.MaxValue) l64 &= UInt32.MaxValue;
dvret.SetValue(l64);*/
var dvret = new DoubleVariant();
ret = dvret;
dvret.SetValue((4 == IntPtr.Size) ? Double.NaN : (double)0); // иногда у фреймворка бывает мусор, но чаще эти значения...
}
break;
case VariantBase.Vtc.Tc8Float:
{
/*float fv1 = ((FloatVariant) v1).GetValue(), fv2 = ((FloatVariant) v2).GetValue(); // естественный алгоритм
long lv1 = (fv1 < 0) ? (long)fv1 : (long)(ulong)fv1;
long lv2 = (fv2 < 0) ? (long)fv2 : (long)(ulong)fv2;
var fvret = new FloatVariant();
ret = fvret;
var l64 = (ulong)lv1 ^ (ulong)lv2;
if (l64 >> 32 == UInt32.MaxValue) l64 &= UInt32.MaxValue;
fvret.SetValue(l64);*/
var fvret = new FloatVariant();
ret = fvret;
fvret.SetValue((4 == IntPtr.Size) ? float.NaN : (float)0.0); // иногда у фреймворка бывает мусор, но чаще эти значения...
}
break;
case VariantBase.Vtc.Tc24Long:
{
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
lvret.SetValue(lv1 ^ lv2);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
ulvret.SetValue(ulv1 ^ ulv2);
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Xor);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x0600026C RID: 620 RVA: 0x00010FC8 File Offset: 0x0000F1C8
private void Xor_(VariantBase dummy) // \u0008\u2001\u2000
{
var v1 = PopVariant();
var v2 = PopVariant();
PushVariant(Xor(v2, v1));
}
// Token: 0x06000189 RID: 393 RVA: 0x00008244 File Offset: 0x00006444
private void Shl_(VariantBase dummy) // \u0006\u2002\u2001
{
PushVariant(Shift(true, true));
}
VariantBase.Vtc CommonTypeShift(VariantBase org_val, VariantBase org_shift, out VariantBase val, out VariantBase shift, bool signed)
{
val = org_val.Clone();
shift = org_shift.Clone();
var tcval = UnderlyingTypeCode(ref val);
var tcsh = UnderlyingTypeCode(ref shift);
if (tcval == VariantBase.Vtc.Tc18Object || tcsh == VariantBase.Vtc.Tc18Object)
return VariantBase.Vtc.Tc18Object;
shift = new LongVariant();
long lsh = 0;
switch (org_shift.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
lsh = VariantBase.SignedLongFromEnum((EnumVariant) org_shift);
break;
case VariantBase.Vtc.Tc13UIntPtr:
lsh = (long)((UIntPtrVariant)org_shift).GetValue().ToUInt64();
break;
case VariantBase.Vtc.Tc17IntPtr:
lsh = ((IntPtrVariant)org_shift).GetValue().ToInt64();
break;
case VariantBase.Vtc.Tc19Int:
lsh = ((IntVariant)org_shift).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
lsh = ((LongVariant)org_shift).GetValue();
break;
}
shift.SetValueAbstract(lsh);
VariantBase.Vtc ret = tcval;
if (!signed)
{
val = AsUnsigned(val);
}
if (!signed) switch (ret)
{
case VariantBase.Vtc.Tc19Int:
return VariantBase.Vtc.Tc9Uint;
case VariantBase.Vtc.Tc24Long:
return VariantBase.Vtc.Tc7Ulong;
}
return ret;
}
private VariantBase Shift(bool left, bool signed)
{
VariantBase val, shift;
var org_shift = PopVariant();
var org_val = PopVariant();
var tc = CommonTypeShift(org_val, org_shift, out val, out shift, signed);
var sh = (int)(long)shift.GetValueAbstract();
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)val).GetValue();
var uvret = new UintVariant();
ret = uvret;
if (left)
{
uvret.SetValue(uv1 << sh);
}
else
{
uvret.SetValue(uv1 >> sh);
}
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)val).GetValue();
var ivret = new IntVariant();
ret = ivret;
if (left)
{
ivret.SetValue(iv1 << sh);
}
else
{
ivret.SetValue(iv1 >> sh);
}
break;
case VariantBase.Vtc.Tc21Double:
/*double dv1 = ((DoubleVariant)val).GetValue(), dv2 = ((DoubleVariant)shift).GetValue();
var dvret = new DoubleVariant();
ret = dvret;
var dmul = left ? 2 : 0.5;
dvret.SetValue(dv1 * Math.Pow(dmul, dv2));
break;*/
case VariantBase.Vtc.Tc8Float:
/*float fv1 = ((FloatVariant)val).GetValue(), fv2 = ((FloatVariant)shift).GetValue();
var fvret = new FloatVariant();
ret = fvret;
var fmul = left ? 2f : 0.5f;
fvret.SetValue(fv1 * (float)Math.Pow(fmul, fv2));
break;*/
throw new InvalidProgramException();
case VariantBase.Vtc.Tc24Long:
long lv1 = ((LongVariant)val).GetValue();
var lvret = new LongVariant();
ret = lvret;
if (left)
{
lvret.SetValue(lv1 << sh);
}
else
{
lvret.SetValue(lv1 >> sh);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)val).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
if (left)
{
ulvret.SetValue(ulv1 << sh);
}
else
{
ulvret.SetValue(ulv1 >> sh);
}
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (left ? OpCodes.Shl : OpCodes.Shr) : OpCodes.Shr_Un);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_val.GetValueAbstract(), org_shift.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x06000173 RID: 371 RVA: 0x00007BE0 File Offset: 0x00005DE0
private void Initblk_(VariantBase dummy) // \u0002\u2002\u2000
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345287) /* Initblk not supported. */);
}
// Token: 0x0600020A RID: 522 RVA: 0x0000C508 File Offset: 0x0000A708
private void Localloc_(VariantBase dummy) // \u0008\u200A\u2000
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345866) /* Localloc not supported. */);
}
// Token: 0x06000212 RID: 530 RVA: 0x0000C73C File Offset: 0x0000A93C
private void Refanyval_(VariantBase dummy) // \u0005\u200A\u2000
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345900) /* Refanyval is not supported. */);
}
// Token: 0x06000237 RID: 567 RVA: 0x0000F984 File Offset: 0x0000DB84
private void Refanytype_(VariantBase dummy) // \u000F\u2005
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345460) /* Refanytype is not supported. */);
}
// Token: 0x0600029C RID: 668 RVA: 0x000126CC File Offset: 0x000108CC
private void Cpblk_(VariantBase dummy) // \u0002\u2006
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345423) /* Cpblk not supported. */);
}
// Token: 0x060001CA RID: 458 RVA: 0x00009E68 File Offset: 0x00008068
private void Cpobj_(VariantBase dummy) // \u0008\u2009
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345317) /* Cpobj is not supported. */);
}
// Token: 0x060001D2 RID: 466 RVA: 0x0000A338 File Offset: 0x00008538
private void Arglist_(VariantBase dummy) // \u000F\u2002\u2001
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345940) /* Arglist is not supported. */);
}
// Token: 0x06000187 RID: 391 RVA: 0x00008224 File Offset: 0x00006424
private void Mkrefany_(VariantBase dummy) // \u0002\u2007
{
throw new NotSupportedException(StringDecryptor.GetString(-1550345270) /* Mkrefany is not supported. */);
}
// Token: 0x0600017E RID: 382 RVA: 0x00007ECC File Offset: 0x000060CC
private static BindingFlags BF(bool isStatic) // \u0002
{
var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic;
if (isStatic)
{
bindingFlags |= BindingFlags.Static;
}
else
{
bindingFlags |= BindingFlags.Instance;
}
return bindingFlags;
}
// Token: 0x06000192 RID: 402 RVA: 0x000084F4 File Offset: 0x000066F4
private void Ldc_i4_0_(VariantBase dummy) // \u0005\u2001
{
var iv = new IntVariant();
iv.SetValue(0);
PushVariant(iv);
}
// Token: 0x0600028F RID: 655 RVA: 0x0001235C File Offset: 0x0001055C
private void Ldc_i4_1_(VariantBase dummy) // \u0002\u2005\u2000
{
var iv = new IntVariant();
iv.SetValue(1);
PushVariant(iv);
}
// Token: 0x0600022F RID: 559 RVA: 0x0000F8C8 File Offset: 0x0000DAC8
private void Ldc_i4_2_(VariantBase dummy) // \u0005
{
var iv = new IntVariant();
iv.SetValue(2);
PushVariant(iv);
}
// Token: 0x06000174 RID: 372 RVA: 0x00007BF4 File Offset: 0x00005DF4
private void Ldc_i4_3_(VariantBase dummy) // \u0008\u2006\u2000
{
var iv = new IntVariant();
iv.SetValue(3);
PushVariant(iv);
}
// Token: 0x06000262 RID: 610 RVA: 0x00010BEC File Offset: 0x0000EDEC
private void Ldc_i4_4_(VariantBase dummy) // \u000F\u2009\u2000
{
var iv = new IntVariant();
iv.SetValue(4);
PushVariant(iv);
}
// Token: 0x060001B3 RID: 435 RVA: 0x000092B4 File Offset: 0x000074B4
private void Ldc_i4_5_(VariantBase dummy) // \u0008\u2004\u2000
{
var iv = new IntVariant();
iv.SetValue(5);
PushVariant(iv);
}
// Token: 0x06000231 RID: 561 RVA: 0x0000F900 File Offset: 0x0000DB00
private void Ldc_i4_6_(VariantBase dummy) // \u0006\u2009\u2000
{
var iv = new IntVariant();
iv.SetValue(6);
PushVariant(iv);
}
// Token: 0x0600026A RID: 618 RVA: 0x00010F88 File Offset: 0x0000F188
private void Ldc_i4_7_(VariantBase dummy) // \u0003\u2003\u2000
{
var iv = new IntVariant();
iv.SetValue(7);
PushVariant(iv);
}
// Token: 0x060001A9 RID: 425 RVA: 0x00008FA8 File Offset: 0x000071A8
private void Ldc_i4_8_(VariantBase dummy) // \u000E\u2001
{
var iv = new IntVariant();
iv.SetValue(8);
PushVariant(iv);
}
// Token: 0x0600016F RID: 367 RVA: 0x00007A58 File Offset: 0x00005C58
private void Unbox_(VariantBase vTypeId) // \u0005\u2003\u2000
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
var val = VariantFactory.Convert(PopVariant().GetValueAbstract(), type);
PushVariant(val);
}
// Token: 0x06000207 RID: 519 RVA: 0x0000C228 File Offset: 0x0000A428
private VmTokenInfo ReadVmToken(BinaryReader reader) // \u0002
{
switch (reader.ReadByte())
{
case (byte)VmTokenInfo.Kind.Class0:
{
var ret = new VmClassTokenInfo
{
OuterClassGenericMethodIdx = reader.ReadInt32(),
OuterClassGenericClassIdx = reader.ReadInt32(),
IsOuterClassGeneric = reader.ReadBoolean(),
ClassName = reader.ReadString(),
IsGeneric = reader.ReadBoolean(),
GenericArguments = new UniversalTokenInfo[(int) reader.ReadInt16()]
};
for (var i = 0; i < ret.GenericArguments.Length; i++)
{
ret.GenericArguments[i] = new UniversalTokenInfo
{
IsVm = 1,
MetadataToken = reader.ReadInt32()
};
}
return ret;
}
case (byte)VmTokenInfo.Kind.Field1:
return new VmFieldTokenInfo
{
Class = new UniversalTokenInfo
{
IsVm = 1,
MetadataToken = reader.ReadInt32()
},
Name = reader.ReadString(),
IsStatic = reader.ReadBoolean()
};
case (byte)VmTokenInfo.Kind.Method2:
{
var ret = new VmMethodTokenInfo
{
Class = new UniversalTokenInfo
{
IsVm = 1,
MetadataToken = reader.ReadInt32()
},
Flags = reader.ReadByte(),
Name = reader.ReadString(),
ReturnType = new UniversalTokenInfo
{
IsVm = 1,
MetadataToken = reader.ReadInt32()
},
Parameters = new UniversalTokenInfo[(int)reader.ReadInt16()]
};
for (var j = 0; j < ret.Parameters.Length; j++)
{
ret.Parameters[j] = new UniversalTokenInfo
{
IsVm = 1,
MetadataToken = reader.ReadInt32()
};
}
var gaCnt = (int)reader.ReadInt16();
ret.GenericArguments = new UniversalTokenInfo[gaCnt];
for (var k = 0; k < gaCnt; k++)
{
ret.GenericArguments[k] = new UniversalTokenInfo
{
IsVm = 1,
MetadataToken = reader.ReadInt32()
};
}
return ret;
}
case (byte)VmTokenInfo.Kind.String3:
return new VmStringTokenInfo { Value = reader.ReadString() };
case (byte)VmTokenInfo.Kind.MethodRef4:
return new VmMethodRefTokenInfo
{
Flags = reader.ReadInt32(),
Pos = reader.ReadInt32()
};
default:
throw new ArgumentOutOfRangeException();
}
}
// Token: 0x06000175 RID: 373 RVA: 0x00007C08 File Offset: 0x00005E08
private UniversalTokenInfo ReadToken(int pos) // u0002
{
if (_srcVirtualizedStreamReader == null)
{
throw new InvalidOperationException();
}
var baseStream = _srcVirtualizedStreamReader.BaseStream;
UniversalTokenInfo result;
lock (baseStream)
{
_srcVirtualizedStreamReader.BaseStream.Seek(pos, SeekOrigin.Begin);
result = new UniversalTokenInfo {IsVm = _srcVirtualizedStreamReader.ReadByte()};
if (result.IsVm == 0)
{
result.MetadataToken = _srcVirtualizedStreamReader.ReadInt32();
}
else
{
result.VmToken = ReadVmToken(_srcVirtualizedStreamReader);
}
}
return result;
}
// Token: 0x06000248 RID: 584 RVA: 0x000102AC File Offset: 0x0000E4AC
private string Ldstr(int strToken) // \u0002
{
string result;
lock (AllMetadataById)
{
object stored;
if (AllMetadataById.TryGetValue(strToken, out stored))
{
result = (string)stored;
}
else
{
var tokenInfo = ReadToken(strToken);
if (tokenInfo.IsVm == 0)
{
result = _module.ResolveString(tokenInfo.MetadataToken);
}
else
{
var text = ((VmStringTokenInfo)tokenInfo.VmToken).Value;
AllMetadataById.Add(strToken, text);
result = text;
}
}
}
return result;
}
// Token: 0x0600019C RID: 412 RVA: 0x00008B34 File Offset: 0x00006D34
private void Ldstr_(VariantBase strToken) // \u000E\u2000\u2001
{
var tok = ((IntVariant)strToken).GetValue();
var text = Ldstr(tok);
var val = new StringVariant();
val.SetValue(text);
PushVariant(val);
}
// Token: 0x06000170 RID: 368 RVA: 0x00007A94 File Offset: 0x00005C94
private VariantBase ReadOperand(MyBufferReader r, VmOperandType operandType) // \u0002
{
switch (operandType)
{
case VmOperandType.Ot0UInt:
{
var ret = new UintVariant();
ret.SetValue(r.ReadUint());
return ret;
}
case VmOperandType.Ot1UShort:
case VmOperandType.Ot3UShort:
{
var ret = new UshortVariant();
ret.SetValue(r.ReadUshort());
return ret;
}
case VmOperandType.Ot2Byte:
case VmOperandType.Ot8Byte:
{
var ret = new ByteVariant();
ret.SetValue(r.ReadByte());
return ret;
}
case VmOperandType.Ot4Double:
{
var ret = new DoubleVariant();
ret.SetValue(r.ReadDouble());
return ret;
}
case VmOperandType.Ot5Int:
case VmOperandType.Ot12Int:
{
var ret = new IntVariant();
ret.SetValue(r.ReadInt32());
return ret;
}
case VmOperandType.Ot6SByte:
{
var ret = new SbyteVariant();
ret.SetValue(r.ReadSbyte());
return ret;
}
case VmOperandType.Ot7Long:
{
var ret = new LongVariant();
ret.SetValue(r.ReadLong());
return ret;
}
case VmOperandType.Ot9IntArr:
{
var num = r.ReadInt32();
var array = new IntVariant[num];
for (var i = 0; i < num; i++)
{
var item = new IntVariant();
item.SetValue(r.ReadInt32());
array[i] = item;
}
var ret = new ArrayVariant();
ret.SetValue(array);
return ret;
}
case VmOperandType.Ot10Float:
{
var ret = new FloatVariant();
ret.SetValue(r.ReadFloat());
return ret;
}
case VmOperandType.Ot11Nope:
return null;
default:
throw new Exception(StringDecryptor.GetString(-1550347123) /* Unknown operand type. */);
}
}
// Token: 0x06000279 RID: 633 RVA: 0x0001184C File Offset: 0x0000FA4C
enum ComparisonKind { EQ, NEQ, GT, LE, LT, GE }
private static bool UniCompare(VariantBase v1, VariantBase v2, ComparisonKind ck, bool unsignedNanBranch) // \u0008 - bug fixed (метод переписан)
{
// from stack: enum double single long int
var t1 = v1.GetTypeCode();
if (t1 == VariantBase.Vtc.Tc5Enum)
{
var vv1 = VariantBase.SignedVariantFromEnum((EnumVariant)v1);
return UniCompare(vv1, v2, ck, unsignedNanBranch);
}
var t2 = v2.GetTypeCode();
if (t2 == VariantBase.Vtc.Tc5Enum)
{
var vv2 = VariantBase.SignedVariantFromEnum((EnumVariant)v2);
return UniCompare(v1, vv2, ck, unsignedNanBranch);
}
if (t1 == VariantBase.Vtc.Tc18Object || t2 == VariantBase.Vtc.Tc18Object)
{
if (ck == ComparisonKind.EQ) return v1.GetValueAbstract().Equals(v2.GetValueAbstract());
if (ck == ComparisonKind.NEQ) return !v1.GetValueAbstract().Equals(v2.GetValueAbstract());
return false;
}
if (t1 == VariantBase.Vtc.Tc21Double || t2 == VariantBase.Vtc.Tc21Double)
{
var d1 = (t1 == VariantBase.Vtc.Tc21Double) ? ((DoubleVariant)v1).GetValue() : Convert.ToDouble(v1.GetValueAbstract());
var d2 = (t2 == VariantBase.Vtc.Tc21Double) ? ((DoubleVariant)v2).GetValue() : Convert.ToDouble(v2.GetValueAbstract());
if (unsignedNanBranch) unsignedNanBranch = (double.IsNaN(d1) || double.IsNaN(d2));
switch (ck)
{
case ComparisonKind.EQ:
// ReSharper disable once CompareOfFloatsByEqualityOperator
return (d1 == d2) || unsignedNanBranch;
case ComparisonKind.GT:
return (d1 > d2) || unsignedNanBranch;
case ComparisonKind.NEQ:
// ReSharper disable once CompareOfFloatsByEqualityOperator
return (d1 != d2) || unsignedNanBranch;
case ComparisonKind.LE:
return (d1 <= d2) || unsignedNanBranch;
case ComparisonKind.LT:
return (d1 < d2) || unsignedNanBranch;
case ComparisonKind.GE:
return (d1 >= d2) || unsignedNanBranch;
}
}
if (t1 == VariantBase.Vtc.Tc8Float || t2 == VariantBase.Vtc.Tc8Float)
{
var d1 = (t1 == VariantBase.Vtc.Tc8Float) ? ((FloatVariant)v1).GetValue() : Convert.ToSingle(v1.GetValueAbstract());
var d2 = (t2 == VariantBase.Vtc.Tc8Float) ? ((FloatVariant)v2).GetValue() : Convert.ToSingle(v2.GetValueAbstract());
if (unsignedNanBranch) unsignedNanBranch = (float.IsNaN(d1) || float.IsNaN(d2));
switch (ck)
{
case ComparisonKind.EQ:
// ReSharper disable once CompareOfFloatsByEqualityOperator
return (d1 == d2) || unsignedNanBranch;
case ComparisonKind.GT:
return (d1 > d2) || unsignedNanBranch;
case ComparisonKind.NEQ:
// ReSharper disable once CompareOfFloatsByEqualityOperator
return (d1 != d2) || unsignedNanBranch;
case ComparisonKind.LE:
return (d1 <= d2) || unsignedNanBranch;
case ComparisonKind.LT:
return (d1 < d2) || unsignedNanBranch;
case ComparisonKind.GE:
return (d1 >= d2) || unsignedNanBranch;
}
}
if (t1 == VariantBase.Vtc.Tc24Long || t2 == VariantBase.Vtc.Tc24Long)
{
var d1 = (t1 == VariantBase.Vtc.Tc24Long) ? ((LongVariant)v1).GetValue() : (unsignedNanBranch ? Convert.ToInt64((uint)(int)v1.GetValueAbstract()) : Convert.ToInt64(v1.GetValueAbstract()));
var d2 = (t2 == VariantBase.Vtc.Tc24Long) ? ((LongVariant)v2).GetValue() : (unsignedNanBranch ? Convert.ToInt64((uint)(int)v2.GetValueAbstract()) : Convert.ToInt64(v2.GetValueAbstract()));
switch (ck)
{
case ComparisonKind.EQ:
return d1 == d2;
case ComparisonKind.GT:
if(unsignedNanBranch) return (ulong)d1 > (ulong)d2;
return d1 > d2;
case ComparisonKind.NEQ:
if (unsignedNanBranch) return (ulong)d1 != (ulong)d2;
return d1 != d2;
case ComparisonKind.LE:
if (unsignedNanBranch) return (ulong)d1 <= (ulong)d2;
return d1 <= d2;
case ComparisonKind.LT:
if (unsignedNanBranch) return (ulong)d1 < (ulong)d2;
return d1 < d2;
case ComparisonKind.GE:
if (unsignedNanBranch) return (ulong)d1 >= (ulong)d2;
return d1 >= d2;
}
}
if (t1 == VariantBase.Vtc.Tc19Int || t2 == VariantBase.Vtc.Tc19Int)
{
switch (ck)
{
case ComparisonKind.EQ:
// ReSharper disable once CompareOfFloatsByEqualityOperator
return ((IntVariant)v1).GetValue() == ((IntVariant)v2).GetValue();
case ComparisonKind.GT:
if (unsignedNanBranch) return (uint)((IntVariant)v1).GetValue() > (uint)((IntVariant)v2).GetValue();
return ((IntVariant)v1).GetValue() > ((IntVariant)v2).GetValue();
case ComparisonKind.NEQ:
if (unsignedNanBranch) return (uint)((IntVariant)v1).GetValue() != (uint)((IntVariant)v2).GetValue();
return ((IntVariant)v1).GetValue() != ((IntVariant)v2).GetValue();
case ComparisonKind.LE:
if (unsignedNanBranch) return (uint)((IntVariant)v1).GetValue() <= (uint)((IntVariant)v2).GetValue();
return ((IntVariant)v1).GetValue() <= ((IntVariant)v2).GetValue();
case ComparisonKind.LT:
if (unsignedNanBranch) return (uint)((IntVariant)v1).GetValue() < (uint)((IntVariant)v2).GetValue();
return ((IntVariant)v1).GetValue() < ((IntVariant)v2).GetValue();
//case ComparisonKind.GE:
default:
if (unsignedNanBranch) return (uint)((IntVariant)v1).GetValue() >= (uint)((IntVariant)v2).GetValue();
return ((IntVariant)v1).GetValue() >= ((IntVariant)v2).GetValue();
}
}
return false;
}
// Token: 0x0600017F RID: 383 RVA: 0x00007EEC File Offset: 0x000060EC
private void Ldelema_(VariantBase vTypeId) // \u000F\u2002
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
var idx = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
var val = new SdArrayValueVariant();
val.SetArray(array);
val.SetHeldType(type);
val.SetIndex(idx);
PushVariant(val);
}
// Token: 0x06000252 RID: 594 RVA: 0x00010780 File Offset: 0x0000E980
private void Ldelem_ref_(VariantBase dummy) // \u000F\u2003\u2000
{
Ldelem(SimpleTypeHelper.ObjectType);
}
// Token: 0x06000178 RID: 376 RVA: 0x00007D38 File Offset: 0x00005F38
private static void SerializeCrossDomain(Exception ex) // \u0002
{
if (ex == null)
{
return;
}
try
{
var type = ex.GetType();
if (type.IsSerializable)
{
var context = new StreamingContext(StreamingContextStates.CrossAppDomain);
var om = new ObjectManager(null, context);
var info = new SerializationInfo(type, new FormatterConverter());
ex.GetObjectData(info, context);
om.RegisterObject(ex, 1L, info);
om.DoFixups();
}
}
catch
{
}
}
// Token: 0x060001DF RID: 479 RVA: 0x0000ABCC File Offset: 0x00008DCC
private static void Throw(object ex) // \u0003
{
throw (Exception)ex;
}
// Token: 0x0600024D RID: 589 RVA: 0x000105A0 File Offset: 0x0000E7A0
private static void ThrowStoreCrossDomain(object ex) // \u0002
{
SerializeCrossDomain(ex as Exception);
Throw(ex);
}
// Token: 0x06000293 RID: 659 RVA: 0x00012398 File Offset: 0x00010598
private static VariantBase SubLong(VariantBase v1, VariantBase v2, bool bChecked, bool bUnsigned) // \u0005
{
var lvret = new LongVariant();
if (!bUnsigned)
{
var l1 = ((LongVariant)v1).GetValue();
var l2 = ((LongVariant)v2).GetValue();
long lret;
if (bChecked)
{
lret = checked(l1 - l2);
}
else
{
lret = l1 - l2;
}
lvret.SetValue(lret);
return lvret;
}
var u1 = (ulong)((LongVariant)v1).GetValue();
var u2 = (ulong)((LongVariant)v2).GetValue();
ulong uret;
if (bChecked)
{
uret = checked(u1 - u2);
}
else
{
uret = u1 - u2;
}
lvret.SetValue((long)uret);
return lvret;
}
private VariantBase Sub(bool ovf, bool signed)
{
VariantBase v1, v2;
var org_v2 = PopVariant();
var org_v1 = PopVariant();
var tc = CommonType(org_v1, org_v2, out v1, out v2, signed);
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
if (ovf)
{
uint uiv;
checked
{
uiv = uv1 - uv2;
}
uvret.SetValue(uiv);
}
else
{
uvret.SetValue(uv1 - uv2);
}
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
if (ovf)
{
checked
{
ivret.SetValue(iv1 - iv2);
}
}
else
{
ivret.SetValue(iv1 - iv2);
}
break;
case VariantBase.Vtc.Tc21Double:
double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue();
var dvret = new DoubleVariant();
ret = dvret;
dvret.SetValue(dv1 - dv2);
break;
case VariantBase.Vtc.Tc8Float:
float fv1 = ((FloatVariant)v1).GetValue(), fv2 = ((FloatVariant)v2).GetValue();
var fvret = new FloatVariant();
ret = fvret;
fvret.SetValue(fv1 - fv2);
break;
case VariantBase.Vtc.Tc24Long:
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
if (ovf)
{
checked
{
lvret.SetValue(lv1 - lv2);
}
}
else
{
lvret.SetValue(lv1 - lv2);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
if (ovf)
{
ulong ulv;
checked
{
ulv = ulv1 - ulv2;
}
ulvret.SetValue(ulv);
}
else
{
ulvret.SetValue(ulv1 - ulv2);
}
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Sub_Ovf : OpCodes.Sub) : OpCodes.Sub_Ovf_Un);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x0600026B RID: 619 RVA: 0x00010F9C File Offset: 0x0000F19C
private void Sub_ovf_un_(VariantBase dummy) // \u0005\u2006\u2000
{
PushVariant(Sub(true, false));
}
// Token: 0x060001A8 RID: 424 RVA: 0x00008F7C File Offset: 0x0000717C
private void Sub_ovf_(VariantBase dummy) // \u0005\u2008
{
PushVariant(Sub(true, true));
}
// Token: 0x0600021C RID: 540 RVA: 0x0000C84C File Offset: 0x0000AA4C
private void Sub_(VariantBase dummy) // \u0006\u200A
{
PushVariant(Sub(false, true));
}
// Token: 0x06000271 RID: 625 RVA: 0x00011144 File Offset: 0x0000F344
private static VariantBase MulLong(VariantBase v1, VariantBase v2, bool bChecked, bool bUnsigned) // \u0003
{
var lvret = new LongVariant();
if (!bUnsigned)
{
var l1 = ((LongVariant)v1).GetValue();
var l2 = ((LongVariant)v2).GetValue();
long lret;
if (bChecked)
{
lret = checked(l1 * l2);
}
else
{
lret = l1 * l2;
}
lvret.SetValue(lret);
return lvret;
}
var u1 = (ulong)((LongVariant)v1).GetValue();
var u2 = (ulong)((LongVariant)v2).GetValue();
ulong uret;
if (bChecked)
{
uret = checked(u1 * u2);
}
else
{
uret = u1 * u2;
}
lvret.SetValue((long)uret);
return lvret;
}
private VariantBase Mul(bool ovf, bool signed)
{
VariantBase v1, v2;
var org_v2 = PopVariant();
var org_v1 = PopVariant();
var tc = CommonType(org_v1, org_v2, out v1, out v2, signed);
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
if (ovf)
{
uint uiv;
checked
{
uiv = uv1 * uv2;
}
uvret.SetValue(uiv);
}
else
{
uvret.SetValue(uv1 * uv2);
}
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
if (ovf)
{
checked
{
ivret.SetValue(iv1 * iv2);
}
}
else
{
ivret.SetValue(iv1 * iv2);
}
break;
case VariantBase.Vtc.Tc21Double:
double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue();
var dvret = new DoubleVariant();
ret = dvret;
dvret.SetValue(dv1 * dv2);
break;
case VariantBase.Vtc.Tc8Float:
float fv1 = ((FloatVariant)v1).GetValue(), fv2 = ((FloatVariant)v2).GetValue();
var fvret = new FloatVariant();
ret = fvret;
fvret.SetValue(fv1 * fv2);
break;
case VariantBase.Vtc.Tc24Long:
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
if (ovf)
{
checked
{
lvret.SetValue(lv1 * lv2);
}
}
else
{
lvret.SetValue(lv1 * lv2);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
if (ovf)
{
ulong ulv;
checked
{
ulv = ulv1 * ulv2;
}
ulvret.SetValue(ulv);
}
else
{
ulvret.SetValue(ulv1 * ulv2);
}
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Mul_Ovf : OpCodes.Mul) : OpCodes.Mul_Ovf_Un);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x06000181 RID: 385 RVA: 0x00007F88 File Offset: 0x00006188
private void Mul_ovf_un_(VariantBase dummy) // \u0005\u2007
{
PushVariant(Mul(true, false));
}
// Token: 0x060001E1 RID: 481 RVA: 0x0000ABDC File Offset: 0x00008DDC
private void Mul_(VariantBase dummy) // \u0006\u2001\u2001
{
PushVariant(Mul(false, true));
}
// Token: 0x060001A0 RID: 416 RVA: 0x00008C98 File Offset: 0x00006E98
private void Mul_ovf_(VariantBase dummy) // \u0008\u2000\u2000
{
PushVariant(Mul(true, true));
}
VariantBase.Vtc CommonType(VariantBase org_v1, VariantBase org_v2, out VariantBase v1, out VariantBase v2, bool signed)
{
v1 = org_v1.Clone();
v2 = org_v2.Clone();
var tc1 = UnderlyingTypeCode(ref v1);
var tc2 = UnderlyingTypeCode(ref v2);
if (tc1 == VariantBase.Vtc.Tc18Object || tc2 == VariantBase.Vtc.Tc18Object)
return VariantBase.Vtc.Tc18Object;
VariantBase.Vtc ret = tc1;
if (!signed)
{
v1 = AsUnsigned(v1);
v2 = AsUnsigned(v2);
}
if(tc1 != tc2) switch (tc1)
{
case VariantBase.Vtc.Tc19Int:
switch (tc2)
{
case VariantBase.Vtc.Tc24Long:
{
ret = tc2;
var new_v1 = signed ? (VariantBase)new LongVariant() : new UlongVariant();
new_v1.CopyFrom(v1);
v1 = new_v1;
}
break;
case VariantBase.Vtc.Tc21Double:
{
ret = tc2;
var new_v1 = new DoubleVariant();
new_v1.CopyFrom(v1);
v1 = new_v1;
}
break;
case VariantBase.Vtc.Tc8Float:
{
ret = tc2;
var new_v1 = new FloatVariant();
new_v1.CopyFrom(v1);
v1 = new_v1;
}
break;
}
break;
case VariantBase.Vtc.Tc24Long:
switch (tc2)
{
case VariantBase.Vtc.Tc19Int:
{
var new_v2 = signed ? (VariantBase)new LongVariant() : new UlongVariant();
new_v2.CopyFrom(v2);
v2 = new_v2;
}
break;
case VariantBase.Vtc.Tc21Double:
{
ret = tc2;
var new_v1 = new DoubleVariant();
new_v1.CopyFrom(v1);
v1 = new_v1;
}
break;
case VariantBase.Vtc.Tc8Float:
{
ret = tc2;
var new_v1 = new FloatVariant();
new_v1.CopyFrom(v1);
v1 = new_v1;
}
break;
}
break;
case VariantBase.Vtc.Tc21Double:
switch (tc2)
{
case VariantBase.Vtc.Tc19Int:
case VariantBase.Vtc.Tc24Long:
case VariantBase.Vtc.Tc8Float:
{
var new_v2 = new DoubleVariant();
new_v2.CopyFrom(v2);
v2 = new_v2;
}
break;
}
break;
case VariantBase.Vtc.Tc8Float:
switch (tc2)
{
case VariantBase.Vtc.Tc19Int:
case VariantBase.Vtc.Tc24Long:
{
var new_v2 = new FloatVariant();
new_v2.CopyFrom(v2);
v2 = new_v2;
}
break;
case VariantBase.Vtc.Tc21Double:
{
ret = tc2;
var new_v1 = new DoubleVariant();
new_v1.CopyFrom(v1);
v1 = new_v1;
}
break;
}
break;
}
if(!signed) switch (ret)
{
case VariantBase.Vtc.Tc19Int:
return VariantBase.Vtc.Tc9Uint;
case VariantBase.Vtc.Tc24Long:
return VariantBase.Vtc.Tc7Ulong;
}
return ret;
}
private VariantBase.Vtc UnderlyingTypeCode(ref VariantBase v)
{
var ret = v.GetTypeCode();
if (ret == VariantBase.Vtc.Tc5Enum)
{
v = VariantBase.SignedVariantFromEnum((EnumVariant) v);
ret = Marshal.SizeOf(v.GetValueAbstract()) == 4 ? VariantBase.Vtc.Tc19Int : VariantBase.Vtc.Tc24Long;
}
return ret;
}
private VariantBase AsUnsigned(VariantBase v)
{
var tc = v.GetTypeCode();
var ret = v;
switch (tc)
{
case VariantBase.Vtc.Tc19Int:
ret = new UintVariant();
break;
case VariantBase.Vtc.Tc24Long:
ret = new UlongVariant();
break;
}
ret.CopyFrom(v);
return ret;
}
private VariantBase Add(bool ovf, bool signed)
{
VariantBase v1, v2;
var org_v2 = PopVariant();
var org_v1 = PopVariant();
var tc = CommonType(org_v1, org_v2, out v1, out v2, signed);
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
if (ovf)
{
uint uiv;
checked
{
uiv = uv1 + uv2;
}
uvret.SetValue(uiv);
}
else
{
uvret.SetValue(uv1 + uv2);
}
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
if (ovf)
{
checked
{
ivret.SetValue(iv1 + iv2);
}
}
else
{
ivret.SetValue(iv1 + iv2);
}
break;
case VariantBase.Vtc.Tc21Double:
double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue();
var dvret = new DoubleVariant();
ret = dvret;
dvret.SetValue(dv1 + dv2);
break;
case VariantBase.Vtc.Tc8Float:
float fv1 = ((FloatVariant)v1).GetValue(), fv2 = ((FloatVariant)v2).GetValue();
var fvret = new FloatVariant();
ret = fvret;
fvret.SetValue(fv1 + fv2);
break;
case VariantBase.Vtc.Tc24Long:
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
if (ovf)
{
checked
{
lvret.SetValue(lv1 + lv2);
}
}
else
{
lvret.SetValue(lv1 + lv2);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
if (ovf)
{
ulong ulv;
checked
{
ulv = ulv1 + ulv2;
}
ulvret.SetValue(ulv);
}
else
{
ulvret.SetValue(ulv1 + ulv2);
}
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Add_Ovf : OpCodes.Add) : OpCodes.Add_Ovf_Un);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x0600022D RID: 557 RVA: 0x0000F880 File Offset: 0x0000DA80
private void Add_ovf_(VariantBase dummy) // \u0008\u2001
{
PushVariant(Add(true, true));
}
// Token: 0x06000238 RID: 568 RVA: 0x0000F998 File Offset: 0x0000DB98
private void Add_(VariantBase dummy) // \u0002\u2004
{
PushVariant(Add(false, true));
}
// Token: 0x0600029B RID: 667 RVA: 0x000126A0 File Offset: 0x000108A0
private void Add_ovf_un_(VariantBase dummy) // \u0002\u2004\u2000
{
PushVariant(Add(true, false));
}
private VariantBase Or(VariantBase org_v1, VariantBase org_v2)
{
VariantBase v1, v2;
var tc = CommonType(org_v1, org_v2, out v1, out v2, true);
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
uvret.SetValue(uv1 | uv2);
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
ivret.SetValue(iv1 | iv2);
break;
case VariantBase.Vtc.Tc21Double:
{
/*double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue(); // естественный алгоритм
long lv1 = (dv1 < 0) ? (long)dv1 : (long)(ulong)dv1;
long lv2 = (dv2 < 0) ? (long)dv2 : (long)(ulong)dv2;
var dvret = new DoubleVariant();
ret = dvret;
var l64 = (ulong) lv1 | (ulong) lv2;
if (l64 >> 32 == UInt32.MaxValue) l64 &= UInt32.MaxValue;
dvret.SetValue(l64);*/
var dvret = new DoubleVariant();
ret = dvret;
dvret.SetValue((4 == IntPtr.Size) ? Double.NaN : (double)0); // иногда у фреймворка бывает мусор, но чаще эти значения...
}
break;
case VariantBase.Vtc.Tc8Float:
{
/*float fv1 = ((FloatVariant) v1).GetValue(), fv2 = ((FloatVariant) v2).GetValue(); // естественный алгоритм
long lv1 = (fv1 < 0) ? (long)fv1 : (long)(ulong)fv1;
long lv2 = (fv2 < 0) ? (long)fv2 : (long)(ulong)fv2;
var fvret = new FloatVariant();
ret = fvret;
var l64 = (ulong)lv1 | (ulong)lv2;
if (l64 >> 32 == UInt32.MaxValue) l64 &= UInt32.MaxValue;
fvret.SetValue(l64);*/
var fvret = new FloatVariant();
ret = fvret;
fvret.SetValue((4 == IntPtr.Size) ? float.NaN : (float)0.0); // иногда у фреймворка бывает мусор, но чаще эти значения...
}
break;
case VariantBase.Vtc.Tc24Long:
{
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
lvret.SetValue(lv1 | lv2);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
ulvret.SetValue(ulv1 | ulv2);
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Or);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x0600020F RID: 527 RVA: 0x0000C598 File Offset: 0x0000A798
private void Or_(VariantBase dummy) // \u0006\u2002\u2000
{
var v2 = PopVariant();
var v1 = PopVariant();
PushVariant(Or(v1, v2));
}
// Token: 0x060001D8 RID: 472 RVA: 0x0000A718 File Offset: 0x00008918
private void Throw_(VariantBase dummy) // \u0006\u2005\u2000
{
ThrowStoreCrossDomain(PopVariant().GetValueAbstract());
}
private VariantBase Rem(bool signed)
{
VariantBase v1, v2;
var org_v2 = PopVariant();
var org_v1 = PopVariant();
VariantBase ret;
var tc = CommonType(org_v1, org_v2, out v1, out v2, signed);
if (IsFloating(org_v1) && org_v1.GetType() == org_v2.GetType() && !signed)
{
if (IntPtr.Size == 8) throw new InvalidProgramException();
if (tc == VariantBase.Vtc.Tc21Double)
{
ret = new DoubleVariant();
ret.SetValueAbstract(double.NaN);
}
else /*if (tc == VariantBase.Vtc.Tc8Float)*/
{
ret = new FloatVariant();
ret.SetValueAbstract(float.NaN);
}
}
else switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
uvret.SetValue(uv1 % uv2);
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
ivret.SetValue(iv1 % iv2);
break;
case VariantBase.Vtc.Tc21Double:
double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue();
var dvret = new DoubleVariant();
ret = dvret;
if (Math.Abs(dv2) < double.Epsilon && org_v1.GetType() != org_v2.GetType()) throw new DivideByZeroException();
dvret.SetValue(dv1 % dv2);
break;
case VariantBase.Vtc.Tc8Float:
float fv1 = ((FloatVariant)v1).GetValue(), fv2 = ((FloatVariant)v2).GetValue();
var fvret = new FloatVariant();
ret = fvret;
if (Math.Abs(fv2) < float.Epsilon && org_v1.GetType() != org_v2.GetType()) throw new DivideByZeroException();
fvret.SetValue(fv1 % fv2);
break;
case VariantBase.Vtc.Tc24Long:
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
lvret.SetValue(lv1 % lv2);
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
ulvret.SetValue(ulv1 % ulv2);
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? OpCodes.Rem : OpCodes.Rem_Un);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x060001CC RID: 460 RVA: 0x00009EAC File Offset: 0x000080AC
private void Rem_(VariantBase dummy) // \u0006\u2000\u2001
{
PushVariant(Rem(true));
}
// Token: 0x060001FA RID: 506 RVA: 0x0000BC3C File Offset: 0x00009E3C
private void Rem_un_(VariantBase dummy) // \u0006\u200B\u2000
{
PushVariant(Rem(false));
}
// Token: 0x06000254 RID: 596 RVA: 0x00010824 File Offset: 0x0000EA24
private static VariantBase Neg(VariantBase v) // \u0002
{
if (v.GetTypeCode() == VariantBase.Vtc.Tc19Int)
{
var i = ((IntVariant)v).GetValue();
var ivret = new IntVariant();
ivret.SetValue(-i);
return ivret;
}
if (v.GetTypeCode() == VariantBase.Vtc.Tc24Long)
{
var l = ((LongVariant)v).GetValue();
var lvret = new LongVariant();
lvret.SetValue(-l);
return lvret;
}
if (v.GetTypeCode() == VariantBase.Vtc.Tc21Double)
{
var dvret = new DoubleVariant();
dvret.SetValue(-((DoubleVariant)v).GetValue());
return dvret;
}
if (v.GetTypeCode() != VariantBase.Vtc.Tc5Enum)
{
throw new InvalidOperationException();
}
var underlyingType = Enum.GetUnderlyingType(v.GetValueAbstract().GetType());
if (underlyingType == typeof(long) || underlyingType == typeof(ulong))
{
var lvret = new LongVariant();
lvret.SetValue(Convert.ToInt64(v.GetValueAbstract()));
return Neg(lvret);
}
var ivret2 = new IntVariant();
ivret2.SetValue(Convert.ToInt32(v.GetValueAbstract()));
return Neg(ivret2);
}
// Token: 0x060001F8 RID: 504 RVA: 0x0000BA00 File Offset: 0x00009C00
private void Neg_(VariantBase dummy) // \u0006\u2007
{
var v = PopVariant();
PushVariant(Neg(v));
}
// Token: 0x06000242 RID: 578 RVA: 0x0000FE38 File Offset: 0x0000E038
private static VariantBase DivLong(VariantBase v1, VariantBase v2, bool bUnsigned) // \u0003
{
var lvret = new LongVariant();
if (!bUnsigned)
{
var l1 = ((LongVariant)v1).GetValue();
var l2 = ((LongVariant)v2).GetValue();
lvret.SetValue(l1 / l2);
return lvret;
}
var u1 = (ulong)((LongVariant)v1).GetValue();
var u2 = (ulong)((LongVariant)v2).GetValue();
lvret.SetValue((long)(u1 / u2));
return lvret;
}
private VariantBase Div(bool signed)
{
VariantBase v1, v2;
var org_v2 = PopVariant();
var org_v1 = PopVariant();
VariantBase ret;
var tc = CommonType(org_v1, org_v2, out v1, out v2, signed);
if (IsFloating(org_v1) && org_v1.GetType() == org_v2.GetType() && !signed)
{
if (IntPtr.Size == 8) throw new InvalidProgramException();
if(tc == VariantBase.Vtc.Tc21Double)
{
ret = new DoubleVariant();
ret.SetValueAbstract(double.NaN);
} else /*if (tc == VariantBase.Vtc.Tc8Float)*/
{
ret = new FloatVariant();
ret.SetValueAbstract(float.NaN);
}
} else switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
uvret.SetValue(uv1 / uv2);
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
ivret.SetValue(iv1 / iv2);
break;
case VariantBase.Vtc.Tc21Double:
double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue();
var dvret = new DoubleVariant();
ret = dvret;
if(Math.Abs(dv2) < double.Epsilon && org_v1.GetType() != org_v2.GetType()) throw new DivideByZeroException();
dvret.SetValue(dv1 / dv2);
break;
case VariantBase.Vtc.Tc8Float:
float fv1 = ((FloatVariant)v1).GetValue(), fv2 = ((FloatVariant)v2).GetValue();
var fvret = new FloatVariant();
ret = fvret;
if (Math.Abs(fv2) < float.Epsilon && org_v1.GetType() != org_v2.GetType()) throw new DivideByZeroException();
fvret.SetValue(fv1 / fv2);
break;
case VariantBase.Vtc.Tc24Long:
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
lvret.SetValue(lv1 / lv2);
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
ulvret.SetValue(ulv1 / ulv2);
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? OpCodes.Div : OpCodes.Div_Un);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x060001F0 RID: 496 RVA: 0x0000B664 File Offset: 0x00009864
private void Div_(VariantBase dummy) // \u0002\u2009
{
PushVariant(Div(true));
}
// Token: 0x0600017C RID: 380 RVA: 0x00007DF4 File Offset: 0x00005FF4
private void Div_un_(VariantBase dummy) // \u000E\u200B
{
PushVariant(Div(false));
}
// Token: 0x0600026D RID: 621 RVA: 0x00010FF4 File Offset: 0x0000F1F4
private static void EmitLdc(ILGenerator gen, int val) // \u0002
{
switch (val)
{
case -1:
gen.Emit(OpCodes.Ldc_I4_M1);
return;
case 0:
gen.Emit(OpCodes.Ldc_I4_0);
return;
case 1:
gen.Emit(OpCodes.Ldc_I4_1);
return;
case 2:
gen.Emit(OpCodes.Ldc_I4_2);
return;
case 3:
gen.Emit(OpCodes.Ldc_I4_3);
return;
case 4:
gen.Emit(OpCodes.Ldc_I4_4);
return;
case 5:
gen.Emit(OpCodes.Ldc_I4_5);
return;
case 6:
gen.Emit(OpCodes.Ldc_I4_6);
return;
case 7:
gen.Emit(OpCodes.Ldc_I4_7);
return;
case 8:
gen.Emit(OpCodes.Ldc_I4_8);
return;
default:
if (val > -129 && val < 128)
{
gen.Emit(OpCodes.Ldc_I4_S, (sbyte)val);
return;
}
gen.Emit(OpCodes.Ldc_I4, val);
return;
}
}
// Token: 0x06000264 RID: 612 RVA: 0x00010C28 File Offset: 0x0000EE28
private static void EnsureClass(ILGenerator gen, Type t) // \u0003
{
if (t == SimpleTypeHelper.ObjectType)
{
return;
}
gen.Emit(OpCodes.Castclass, t);
}
// Token: 0x06000277 RID: 631 RVA: 0x0001180C File Offset: 0x0000FA0C
private static void EnsureType(ILGenerator gen, Type t) // \u0005
{
if (t.IsValueType || ElementedTypeHelper.TryGoToElementType(t).IsGenericParameter)
{
gen.Emit(OpCodes.Unbox_Any, t);
return;
}
EnsureClass(gen, t);
}
// Token: 0x06000217 RID: 535 RVA: 0x0000C7EC File Offset: 0x0000A9EC
private static void EnsureBoxed(ILGenerator gen, Type t) // \u0002
{
if (t.IsValueType || ElementedTypeHelper.TryGoToElementType(t).IsGenericParameter)
{
gen.Emit(OpCodes.Box, t);
}
}
// Token: 0x0600023E RID: 574 RVA: 0x0000FA54 File Offset: 0x0000DC54
private DynamicExecutor DynamicFor(MethodBase mb, bool mayVirtual) // \u0002
{
DynamicMethod dynamicMethod; /*= null;
if (_alwaysFalse && (!mb.IsConstructor || !typeof(Delegate).IsAssignableFrom(mb.DeclaringType)))
{
dynamicMethod = new DynamicMethod(string.Empty, SimpleTypeHelper.ObjectType, new Type[]
{
SimpleTypeHelper.ObjectType,
ObjectArrayType
}, true);
}
if (dynamicMethod == null)*/
{
dynamicMethod = new DynamicMethod(string.Empty, SimpleTypeHelper.ObjectType, new[]
{
SimpleTypeHelper.ObjectType,
ObjectArrayType
}, typeof(VmExecutor).Module, true);
}
var iLGenerator = dynamicMethod.GetILGenerator();
var parameters = mb.GetParameters();
var array = new Type[parameters.Length];
var flag = false;
for (var i = 0; i < parameters.Length; i++)
{
var type = parameters[i].ParameterType;
if (type.IsByRef)
{
flag = true;
type = type.GetElementType();
}
array[i] = type;
}
var array2 = new LocalBuilder[array.Length];
if (array2.Length != 0)
{
dynamicMethod.InitLocals = true;
}
for (var j = 0; j < array.Length; j++)
{
array2[j] = iLGenerator.DeclareLocal(array[j]);
}
for (var k = 0; k < array.Length; k++)
{
iLGenerator.Emit(OpCodes.Ldarg_1);
EmitLdc(iLGenerator, k);
iLGenerator.Emit(OpCodes.Ldelem_Ref);
EnsureType(iLGenerator, array[k]);
iLGenerator.Emit(OpCodes.Stloc, array2[k]);
}
if (flag)
{
iLGenerator.BeginExceptionBlock();
}
if (!mb.IsStatic && !mb.IsConstructor)
{
iLGenerator.Emit(OpCodes.Ldarg_0);
var declaringType = mb.DeclaringType;
if (declaringType.IsValueType)
{
iLGenerator.Emit(OpCodes.Unbox, declaringType);
mayVirtual = false;
}
else
{
EnsureClass(iLGenerator, declaringType);
}
}
for (var l = 0; l < array.Length; l++)
{
iLGenerator.Emit(parameters[l].ParameterType.IsByRef ? OpCodes.Ldloca_S : OpCodes.Ldloc, array2[l]);
}
if (mb.IsConstructor)
{
iLGenerator.Emit(OpCodes.Newobj, (ConstructorInfo)mb);
EnsureBoxed(iLGenerator, mb.DeclaringType);
}
else
{
var methodInfo = (MethodInfo)mb;
if (!mayVirtual || mb.IsStatic)
{
iLGenerator.EmitCall(OpCodes.Call, methodInfo, null);
}
else
{
iLGenerator.EmitCall(OpCodes.Callvirt, methodInfo, null);
}
if (methodInfo.ReturnType == VoidType)
{
iLGenerator.Emit(OpCodes.Ldnull);
}
else
{
EnsureBoxed(iLGenerator, methodInfo.ReturnType);
}
}
if (flag)
{
var local = iLGenerator.DeclareLocal(SimpleTypeHelper.ObjectType);
iLGenerator.Emit(OpCodes.Stloc, local);
iLGenerator.BeginFinallyBlock();
for (var m = 0; m < array.Length; m++)
{
if (parameters[m].ParameterType.IsByRef)
{
iLGenerator.Emit(OpCodes.Ldarg_1);
EmitLdc(iLGenerator, m);
iLGenerator.Emit(OpCodes.Ldloc, array2[m]);
if (array2[m].LocalType.IsValueType || ElementedTypeHelper.TryGoToElementType(array2[m].LocalType).IsGenericParameter)
{
iLGenerator.Emit(OpCodes.Box, array2[m].LocalType);
}
iLGenerator.Emit(OpCodes.Stelem_Ref);
}
}
iLGenerator.EndExceptionBlock();
iLGenerator.Emit(OpCodes.Ldloc, local);
}
iLGenerator.Emit(OpCodes.Ret);
return (DynamicExecutor)dynamicMethod.CreateDelegate(typeof(DynamicExecutor));
}
// Token: 0x06000209 RID: 521 RVA: 0x0000C4D0 File Offset: 0x0000A6D0
private static bool HasByRefParameter(MethodBase mb) // \u0002
{
return mb.GetParameters().Any(t => t.ParameterType.IsByRef);
}
// Token: 0x060001D9 RID: 473 RVA: 0x0000A72C File Offset: 0x0000892C
private object Invoke(MethodBase mb, object obj, object[] args) // \u0002
{
if (mb.IsConstructor)
{
// ReSharper disable once AssignNullToNotNullAttribute
return Activator.CreateInstance(mb.DeclaringType, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, args, null);
}
return mb.Invoke(obj, args);
}
// Token: 0x06000286 RID: 646 RVA: 0x00011EFC File Offset: 0x000100FC
private object InvokeDynamic(MethodBase mb, object obj, object[] args, bool mayVirtual) // \u0002
{
/*if (!_alwaysTrue)
{
return Invoke(mb, obj, args);
}*/
var key = new MethodBaseAndVirtual(mb, mayVirtual);
DynamicExecutor executor;
lock (_dynamicExecutors)
{
_dynamicExecutors.TryGetValue(key, out executor);
}
if (executor == null)
{
bool needFaster;
lock (_mbCallCnt)
{
int num;
_mbCallCnt.TryGetValue(mb, out num);
needFaster = num >= 50;
if (!needFaster)
{
_mbCallCnt[mb] = num + 1;
}
}
if (!needFaster && !mayVirtual && obj == null && !mb.IsStatic && !mb.IsConstructor)
{
needFaster = true;
}
if (!needFaster && HasByRefParameter(mb))
{
needFaster = true;
}
if (!needFaster)
{
return Invoke(mb, obj, args);
}
lock (_mbDynamicLock)
{
while (_mbDynamicLock.ContainsKey(mb))
{
Monitor.Wait(_mbDynamicLock);
}
_mbDynamicLock[mb] = null;
}
try
{
lock (_dynamicExecutors)
{
_dynamicExecutors.TryGetValue(key, out executor);
}
if (executor == null)
{
executor = DynamicFor(mb, mayVirtual);
lock (_dynamicExecutors)
{
_dynamicExecutors[key] = executor;
}
}
lock (_mbCallCnt)
{
_mbCallCnt.Remove(mb);
}
}
finally
{
lock (_mbDynamicLock)
{
_mbDynamicLock.Remove(mb);
Monitor.PulseAll(_mbDynamicLock);
}
}
}
return executor(obj, args);
}
// Token: 0x0600028D RID: 653 RVA: 0x000122A4 File Offset: 0x000104A4
private VariantBase FetchByAddr(VariantBase addr) // \u0003
{
if (!addr.IsAddr())
{
throw new ArgumentException();
}
var num = addr.GetTypeCode();
if (num == VariantBase.Vtc.Tc0VariantBaseHolder)
{
return ((VariantBaseHolder)addr).GetValue();
}
if (num != VariantBase.Vtc.Tc4FieldInfo)
{
switch (num)
{
case VariantBase.Vtc.Tc20MdArrayValue:
case VariantBase.Vtc.Tc22SdArrayValue:
{
var avv = (ArrayValueVariantBase)addr;
return VariantFactory.Convert(avv.GetValue(), avv.GetHeldType());
}
case VariantBase.Vtc.Tc23LocalsIdxHolder:
return _localVariables[((LocalsIdxHolderVariant)addr).GetValue()];
}
throw new ArgumentOutOfRangeException();
}
var fiv = (FieldInfoVariant)addr;
return VariantFactory.Convert(fiv.GetValue().GetValue(fiv.GetObject()), null);
}
// Token: 0x06000186 RID: 390 RVA: 0x00008150 File Offset: 0x00006350
private FieldInfo ResolveField(int id) // \u0002
{
FieldInfo result;
lock (AllMetadataById)
{
object md;
if (AllMetadataById.TryGetValue(id, out md))
{
result = (FieldInfo)md;
}
else
{
var U0003U2008 = ReadToken(id);
if (U0003U2008.IsVm == 0)
{
result = _module.ResolveField(U0003U2008.MetadataToken);
}
else
{
var u000Fu2006 = (VmFieldTokenInfo)U0003U2008.VmToken;
var expr_70 = GetTypeById(u000Fu2006.Class.MetadataToken);
var bindingAttr = BF(u000Fu2006.IsStatic);
var field = expr_70.GetField(u000Fu2006.Name, bindingAttr);
if (!expr_70.IsGenericType)
{
AllMetadataById.Add(id, field);
}
result = field;
}
}
}
return result;
}
// Token: 0x06000177 RID: 375 RVA: 0x00007CD8 File Offset: 0x00005ED8
private void Ldflda_(VariantBase vFieldId) // \u0003\u2009
{
var fieldInfo = ResolveField(((IntVariant)vFieldId).GetValue());
var reference = PopVariant();
var obj = reference.IsAddr() ? FetchByAddr(reference).GetValueAbstract() : reference.GetValueAbstract();
var val = new FieldInfoVariant();
val.SetValue(fieldInfo);
val.SetObject(obj);
PushVariant(val);
}
// Token: 0x0600018F RID: 399 RVA: 0x0000840C File Offset: 0x0000660C
private void Ldsflda_(VariantBase vFieldId) // \u000E\u2002
{
var fieldInfo = ResolveField(((IntVariant)vFieldId).GetValue());
var val = new FieldInfoVariant();
val.SetValue(fieldInfo);
PushVariant(val);
}
// Token: 0x0600017D RID: 381 RVA: 0x00007E20 File Offset: 0x00006020
private void Ldtoken_(VariantBase vToken) // \u0005\u2002\u2000
{
var t = ReadToken(((IntVariant)vToken).GetValue());
object obj;
if (t.IsVm == 0)
{
obj = ResolveNativeToken(t.MetadataToken);
}
else
{
switch (t.VmToken.TokenKind())
{
case VmTokenInfo.Kind.Class0:
obj = GetTypeById(((IntVariant)vToken).GetValue()).TypeHandle;
break;
case VmTokenInfo.Kind.Field1:
obj = ResolveField(((IntVariant)vToken).GetValue()).FieldHandle;
break;
case VmTokenInfo.Kind.Method2:
obj = FindMethodById(((IntVariant)vToken).GetValue()).MethodHandle;
break;
default:
throw new InvalidOperationException();
}
}
var push = new ObjectVariant();
push.SetValue(obj);
PushVariant(push);
}
// Token: 0x06000206 RID: 518 RVA: 0x0000C1C8 File Offset: 0x0000A3C8
private void Ldfld_(VariantBase vFieldId) // \u0005\u2003\u2001
{
var fieldInfo = ResolveField(((IntVariant)vFieldId).GetValue());
var reference = PopVariant();
if (reference.IsAddr())
{
reference = FetchByAddr(reference);
}
var obj = reference.GetValueAbstract();
if (obj == null)
{
throw new NullReferenceException();
}
PushVariant(VariantFactory.Convert(fieldInfo.GetValue(obj), fieldInfo.FieldType));
}
// Token: 0x06000225 RID: 549 RVA: 0x0000F2CC File Offset: 0x0000D4CC
private void Ldsfld_(VariantBase vFieldId) // \u000F\u2004\u2000
{
var fieldInfo = ResolveField(((IntVariant)vFieldId).GetValue());
PushVariant(VariantFactory.Convert(fieldInfo.GetValue(null), fieldInfo.FieldType));
}
// Token: 0x0600024A RID: 586 RVA: 0x0001034C File Offset: 0x0000E54C
private void Newobj_(VariantBase vCtrId) // \u0002\u200A
{
var num = ((IntVariant)vCtrId).GetValue();
var methodBase = FindMethodById(num);
var declaringType = methodBase.DeclaringType;
var parameters = methodBase.GetParameters();
var expr_2A = parameters.Length;
var array = new object[expr_2A];
var dictionary = new Dictionary<int, VariantBase>();
for (var i = expr_2A - 1; i >= 0; i--)
{
var u000F = PopVariant();
if (u000F.IsAddr())
{
dictionary.Add(i, u000F);
u000F = FetchByAddr(u000F);
}
if (u000F.GetVariantType() != null)
{
u000F = VariantFactory.Convert(null, u000F.GetVariantType()).CopyFrom(u000F);
}
var u000F2 = VariantFactory.Convert(null, parameters[i].ParameterType).CopyFrom(u000F);
array[i] = u000F2.GetValueAbstract();
}
object obj;
try
{
obj = InvokeDynamic(methodBase, null, array, false);
}
catch (TargetInvocationException ex)
{
var expr_C2 = ex.InnerException ?? ex;
SerializeCrossDomain(expr_C2);
throw expr_C2;
}
foreach (var current in dictionary)
{
AssignByReference(current.Value, VariantFactory.Convert(array[current.Key], null));
}
PushVariant(VariantFactory.Convert(obj, declaringType));
}
// Token: 0x06000227 RID: 551 RVA: 0x0000F3B4 File Offset: 0x0000D5B4
private void AssignByReference(VariantBase refDest, VariantBase val) // \u0002
{
switch (refDest.GetTypeCode())
{
case VariantBase.Vtc.Tc0VariantBaseHolder:
((VariantBaseHolder)refDest).GetValue().CopyFrom(val);
return;
case VariantBase.Vtc.Tc4FieldInfo:
var refFieldInfoDest = (FieldInfoVariant)refDest;
var fieldInfo = refFieldInfoDest.GetValue();
fieldInfo.SetValue(refFieldInfoDest.GetObject(), VariantFactory.Convert(val.GetValueAbstract(), fieldInfo.FieldType).GetValueAbstract());
return;
case VariantBase.Vtc.Tc20MdArrayValue:
case VariantBase.Vtc.Tc22SdArrayValue:
var refArrayValueDest = (ArrayValueVariantBase)refDest;
refArrayValueDest.SetValue(VariantFactory.Convert(val.GetValueAbstract(), refArrayValueDest.GetHeldType()).GetValueAbstract());
return;
case VariantBase.Vtc.Tc23LocalsIdxHolder:
_localVariables[((LocalsIdxHolderVariant)refDest).GetValue()].CopyFrom(val);
return;
default:
throw new ArgumentOutOfRangeException();
}
}
// Token: 0x060001E5 RID: 485 RVA: 0x0000AD10 File Offset: 0x00008F10
private void Invoke(MethodBase mb, bool mayVirtual) // \u0002
{
if (!mayVirtual && IsCompatible(mb))
{
mb = GenerateDynamicCall(mb, false);
}
var parameters = mb.GetParameters();
var num = parameters.Length;
var poppedArgs = new VariantBase[num];
var args = new object[num];
var wasLocked = default(BoolHolder);
try
{
LockIfInterlocked(ref wasLocked, mb, mayVirtual);
for (var i = num - 1; i >= 0; i--)
{
var u000F = PopVariant();
poppedArgs[i] = u000F;
if (u000F.IsAddr())
{
u000F = FetchByAddr(u000F);
}
if (u000F.GetVariantType() != null)
{
u000F = VariantFactory.Convert(null, u000F.GetVariantType()).CopyFrom(u000F);
}
var u000F2 = VariantFactory.Convert(null, parameters[i].ParameterType).CopyFrom(u000F);
args[i] = u000F2.GetValueAbstract();
}
VariantBase u000F3 = null;
if (!mb.IsStatic)
{
u000F3 = PopVariant();
if (u000F3?.GetVariantType() != null)
{
u000F3 = VariantFactory.Convert(null, u000F3.GetVariantType()).CopyFrom(u000F3);
}
}
object obj = null;
try
{
if (mb.IsConstructor)
{
obj = Activator.CreateInstance(mb.DeclaringType, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, args, null);
if (u000F3 != null && !u000F3.IsAddr())
{
throw new InvalidOperationException();
}
AssignByReference(u000F3, VariantFactory.Convert(obj, mb.DeclaringType));
}
else
{
object poppedThis = null;
if (u000F3 != null)
{
var u000F4 = u000F3;
if (u000F3.IsAddr())
{
u000F4 = FetchByAddr(u000F3);
}
poppedThis = u000F4.GetValueAbstract();
}
try
{
if (!InvokeFilter(mb, poppedThis, ref obj, args))
{
if (mayVirtual && !mb.IsStatic && poppedThis == null)
{
throw new NullReferenceException();
}
if (!AlwaysFalse(mb, poppedThis, poppedArgs, args, mayVirtual, ref obj))
{
obj = InvokeDynamic(mb, poppedThis, args, mayVirtual);
}
}
if (u000F3 != null && u000F3.IsAddr())
{
AssignByReference(u000F3, VariantFactory.Convert(poppedThis, mb.DeclaringType));
}
}
catch (TargetInvocationException ex)
{
var cause = ex.InnerException ?? ex;
SerializeCrossDomain(cause);
throw cause;
}
}
}
finally
{
for (var j = 0; j < poppedArgs.Length; j++)
{
var u000F5 = poppedArgs[j];
if (u000F5.IsAddr())
{
var obj3 = args[j];
AssignByReference(u000F5, VariantFactory.Convert(obj3, null));
}
}
}
var methodInfo = mb as MethodInfo;
if (methodInfo != null)
{
var returnType = methodInfo.ReturnType;
if (returnType != VoidType)
{
PushVariant(VariantFactory.Convert(obj, returnType));
}
}
}
finally
{
UnlockInterlockedIfAny(ref wasLocked);
}
}
// Token: 0x060001FD RID: 509 RVA: 0x0000BD88 File Offset: 0x00009F88
private void DoJmp(int pos, Type[] methodGenericArgs, Type[] classGenericArgs, bool mayVirtual) // \u0002
{
_srcVirtualizedStreamReader.BaseStream.Seek(pos, SeekOrigin.Begin);
DoNothing(_srcVirtualizedStreamReader);
var u0006 = ReadMethodHeader(_srcVirtualizedStreamReader);
var num = u0006.ArgsTypeToOutput.Length;
var array = new object[num];
var array2 = new VariantBase[num];
if (_currentClass != null & mayVirtual)
{
var num2 = u0006.IsStatic() ? 0 : 1;
var array3 = new Type[num - num2];
for (var i = num - 1; i >= num2; i--)
{
array3[i] = GetTypeById(u0006.ArgsTypeToOutput[i].TypeId);
}
var method = _currentClass.GetMethod(u0006.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.GetProperty | BindingFlags.SetProperty, null, array3, null);
_currentClass = null;
if (method != null)
{
Invoke(method, true);
return;
}
}
for (var j = num - 1; j >= 0; j--)
{
var u000F = PopVariant();
array2[j] = u000F;
if (u000F.IsAddr())
{
u000F = FetchByAddr(u000F);
}
if (u000F.GetVariantType() != null)
{
u000F = VariantFactory.Convert(null, u000F.GetVariantType()).CopyFrom(u000F);
}
var u000F2 = VariantFactory.Convert(null, GetTypeById(u0006.ArgsTypeToOutput[j].TypeId)).CopyFrom(u000F);
array[j] = u000F2.GetValueAbstract();
if (j == 0 & mayVirtual && !u0006.IsStatic() && array[j] == null)
{
throw new NullReferenceException();
}
}
var u0006u2007 = new VmExecutor(_instrCodesDb);
var callees = new object[]
{
_module.Assembly
};
object obj;
try
{
obj = u0006u2007.Invoke(_srcVirtualizedStream, pos, array, methodGenericArgs, classGenericArgs, callees);
}
finally
{
for (var k = 0; k < array2.Length; k++)
{
var u000F3 = array2[k];
if (u000F3.IsAddr())
{
var obj2 = array[k];
AssignByReference(u000F3, VariantFactory.Convert(obj2, null));
}
}
}
var type = u0006u2007.GetTypeById(u0006u2007._methodHeader.ReturnTypeId);
if (type != VoidType)
{
PushVariant(VariantFactory.Convert(obj, type));
}
}
// Token: 0x0600027A RID: 634 RVA: 0x00011994 File Offset: 0x0000FB94
private void JmpToRef(VmMethodRefTokenInfo mref) // \u0002
{
//var arg_18_0 = (U0008U2007)U0003U2008.Get_u0005();
var methodBase = FindMethodById(mref.Pos, ReadToken(mref.Pos));
//methodBase.GetParameters();
var num = mref.Flags;
var mayVirtual = (num & 1073741824) != 0;
num &= -1073741825;
var methodGenericArgs = _methodGenericArgs;
var classGenericArgs = _classGenericArgs;
try
{
_methodGenericArgs = methodBase is ConstructorInfo ? Type.EmptyTypes : methodBase.GetGenericArguments();
_classGenericArgs = methodBase.DeclaringType.GetGenericArguments();
DoJmp(num, _methodGenericArgs, _classGenericArgs, mayVirtual);
}
finally
{
_methodGenericArgs = methodGenericArgs;
_classGenericArgs = classGenericArgs;
}
}
// Token: 0x060001EE RID: 494 RVA: 0x0000B5FC File Offset: 0x000097FC
private void Jmp_(VariantBase vPos) // \u0008\u200B\u2000
{
var pos = ((IntVariant)vPos).GetValue();
var arg_29_0 = (pos & -2147483648) != 0;
var mayVirtual = (pos & 1073741824) != 0;
pos &= 1073741823;
if (arg_29_0)
{
DoJmp(pos, null, null, mayVirtual);
return;
}
JmpToRef((VmMethodRefTokenInfo)ReadToken(pos).VmToken);
}
// Token: 0x06000199 RID: 409 RVA: 0x00008660 File Offset: 0x00006860
private void Calli_(VariantBase dummy) // \u0003\u2002
{
var methodBase = ((MethodVariant)PopVariant()).GetValue();
Invoke(methodBase, false);
}
// Token: 0x06000184 RID: 388 RVA: 0x000080F4 File Offset: 0x000062F4
private void Call_(VariantBase vMethodId) // \u000E\u2003
{
var methodBase = FindMethodById(((IntVariant)vMethodId).GetValue());
foreach (var arg in _variantOutputArgs)
{
PushVariant(arg);
}
Invoke(methodBase, false);
}
// Token: 0x06000191 RID: 401 RVA: 0x0000845C File Offset: 0x0000665C
private void Callvirt_(VariantBase vMethodId) // \u000E\u2005
{
var methodBase = FindMethodById(((IntVariant)vMethodId).GetValue());
if (_currentClass != null)
{
var pars = methodBase.GetParameters();
var types = new Type[pars.Length];
var num = 0;
foreach (var parameterInfo in pars)
{
types[num++] = parameterInfo.ParameterType;
}
var method = _currentClass.GetMethod(methodBase.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.GetProperty | BindingFlags.SetProperty, null, types, null);
if (method != null)
{
methodBase = method;
}
_currentClass = null;
}
Invoke(methodBase, true);
}
// Token: 0x060001CE RID: 462 RVA: 0x0000A1A0 File Offset: 0x000083A0
private void Invoke(VariantBase vMethodId) // \u000E\u200A
{
var methodBase = FindMethodById(((IntVariant)vMethodId).GetValue());
Invoke(methodBase, false);
}
// Token: 0x06000205 RID: 517 RVA: 0x0000C1A8 File Offset: 0x0000A3A8
[DebuggerNonUserCode]
private MethodBase FindMethodById(int methodId) // \u0002
{
return FindMethodById(methodId, ReadToken(methodId));
}
// Token: 0x06000171 RID: 369 RVA: 0x00007BBC File Offset: 0x00005DBC
private object Invoke(Stream srcVirtualizedStream, int pos, object[] args, Type[] methodGenericArgs, Type[] classGenericArgs, object[] callees) // \u0002
{
_srcVirtualizedStream = srcVirtualizedStream;
Seek(pos, srcVirtualizedStream, null);
return Invoke(args, methodGenericArgs, classGenericArgs, callees);
}
// Token: 0x06000172 RID: 370 RVA: 0x00007BDC File Offset: 0x00005DDC
private bool AlwaysFalse(MethodBase mb, object poppedThis, VariantBase[] poppedArgs, object[] args, bool mayVirtual, ref object obj) // \u0002
{
return false;
}
// Token: 0x06000179 RID: 377 RVA: 0x00007DA8 File Offset: 0x00005FA8
private void Leave_(VariantBase vTarget) // \u0006\u200B
{
OnException(null, ((UintVariant)vTarget).GetValue());
}
// Token: 0x06000180 RID: 384 RVA: 0x00007F48 File Offset: 0x00006148
private void Castclass_(VariantBase vTypeId) // \u0005\u2003
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
var obj = PopVariant();
if (Isinst(obj, type))
{
PushVariant(obj);
return;
}
throw new InvalidCastException();
}
// Token: 0x06000185 RID: 389 RVA: 0x00008144 File Offset: 0x00006344
private void Ldc_i4_s_(VariantBase val) // \u000E\u2003\u2000
{
PushVariant(val);
}
// Token: 0x0600018B RID: 395 RVA: 0x0000827C File Offset: 0x0000647C
private void Stelem_i2_(VariantBase dummy) // \u000E\u200A\u2000
{
var obj = PopVariant().GetValueAbstract();
var idx = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
var elementType = array.GetType().GetElementType();
checked
{
if (elementType == typeof(short))
{
((short[])array)[(int)(IntPtr)idx] = (short)VariantFactory.Convert(obj, typeof(short)).GetValueAbstract();
return;
}
if (elementType == typeof(ushort))
{
((ushort[])array)[(int)(IntPtr)idx] = (ushort)VariantFactory.Convert(obj, typeof(ushort)).GetValueAbstract();
return;
}
if (elementType == typeof(char))
{
((char[])array)[(int)(IntPtr)idx] = (char)VariantFactory.Convert(obj, typeof(char)).GetValueAbstract();
return;
}
if (elementType.IsEnum)
{
Stelem(elementType, obj, idx, array);
return;
}
Stelem(typeof(short), obj, idx, array);
}
}
// Token: 0x0600018E RID: 398 RVA: 0x00008404 File Offset: 0x00006604
private void Stind_i_(VariantBase dummy) // \u000F\u2006
{
Stind();
}
// Token: 0x06000190 RID: 400 RVA: 0x00008440 File Offset: 0x00006640
private void Ldloc_0_(VariantBase dummy) // \u0006
{
PushVariant(_localVariables[0].Clone());
}
// Token: 0x06000193 RID: 403 RVA: 0x00008508 File Offset: 0x00006708
private void And_(VariantBase dummy) // \u000F\u200B\u2000
{
PushVariant(And(PopVariant(), PopVariant()));
}
// Token: 0x06000194 RID: 404 RVA: 0x00008534 File Offset: 0x00006734
private void Bge_un_(VariantBase vpos) // \u0006\u2009
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.GE, true))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x06000198 RID: 408 RVA: 0x00008628 File Offset: 0x00006828
private void Blt_un_(VariantBase vpos) // \u0006\u2006\u2000
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.LT, true))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x06000234 RID: 564 RVA: 0x0000F934 File Offset: 0x0000DB34
private void Bge_(VariantBase vpos) // \u0002\u200B
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.GE, false))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x060002AB RID: 683 RVA: 0x00012D80 File Offset: 0x00010F80
private void Blt_(VariantBase vpos) // \u0003\u2001
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.LT, false))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x0600023D RID: 573 RVA: 0x0000FA1C File Offset: 0x0000DC1C
private void Bgt_(VariantBase vpos) // \u000F\u2000\u2001
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.GT, false))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x060001A3 RID: 419 RVA: 0x00008D10 File Offset: 0x00006F10
private void Bgt_un_(VariantBase vpos) // \u0005\u2004
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.GT, true))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x06000261 RID: 609 RVA: 0x00010BB4 File Offset: 0x0000EDB4
private void Bne_un_(VariantBase vpos) // \u000F\u2007
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.NEQ, true))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x0600029D RID: 669 RVA: 0x000126E0 File Offset: 0x000108E0
private void Beq_(VariantBase vpos) // \u0002\u2007\u2000
{
var v2 = PopVariant();
if (UniCompare(PopVariant(), v2, ComparisonKind.EQ, false))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x060001B9 RID: 441 RVA: 0x000093F8 File Offset: 0x000075F8
private void Ble_un_(VariantBase vpos) // \u0003\u2007\u2000
{
var v2 = PopVariant();
var v1 = PopVariant();
if (UniCompare(v1, v2, ComparisonKind.LE, true))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
private static bool IsFloating(VariantBase v)
{
return v.GetTypeCode() == VariantBase.Vtc.Tc21Double || v.GetTypeCode() == VariantBase.Vtc.Tc8Float;
}
// Token: 0x06000297 RID: 663 RVA: 0x0001253C File Offset: 0x0001073C
private void Ble_(VariantBase vpos) // \u0002\u2003\u2000
{
var v2 = PopVariant();
var v1 = PopVariant();
if (UniCompare(v1, v2, ComparisonKind.LE, false))
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x06000228 RID: 552 RVA: 0x0000F480 File Offset: 0x0000D680
private void Brfalse_(VariantBase vpos) // \u0002\u2002
{
var val = PopVariant();
var num = val.GetTypeCode();
bool flag;
switch (num)
{
case VariantBase.Vtc.Tc5Enum:
flag = !Convert.ToBoolean(((EnumVariant)val).GetValue());
break;
case VariantBase.Vtc.Tc13UIntPtr:
flag = ((UIntPtrVariant)val).GetValue() == UIntPtr.Zero;
break;
case VariantBase.Vtc.Tc17IntPtr:
flag = ((IntPtrVariant)val).GetValue() == IntPtr.Zero;
break;
case VariantBase.Vtc.Tc18Object:
flag = ((ObjectVariant)val).GetValue() == null;
break;
case VariantBase.Vtc.Tc19Int:
flag = ((IntVariant)val).GetValue() == 0;
break;
case VariantBase.Vtc.Tc24Long:
flag = ((LongVariant)val).GetValue() == 0L;
break;
default:
flag = val.GetValueAbstract() == null;
break;
}
if (flag)
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x06000274 RID: 628 RVA: 0x00011488 File Offset: 0x0000F688
private void ExecuteExceptionHandler() // \u0005
{
if (_ehStack.Count == 0)
{
if (_wasException)
{
_myBufferPos = _myBufferReader.GetBuffer().GetPos();
ThrowStoreCrossDomain(_exception);
}
return;
}
var ehFrame = _ehStack.PopBack();
if (ehFrame.Exception != null)
{
var toStack = new ObjectVariant();
toStack.SetValueAbstract(ehFrame.Exception);
PushVariant(toStack);
}
else
{
_evalStack.Clear();
}
JumpToPos(ehFrame.Pos);
}
// Token: 0x060001F2 RID: 498 RVA: 0x0000B6C8 File Offset: 0x000098C8
private void Switch_(VariantBase vSwitchPosArray) // \u0002\u200A\u2000
{
var vidx = PopVariant();
uint idx;
switch (vidx.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
idx = (uint)Convert.ToInt64(vidx.GetValueAbstract());
break;
case VariantBase.Vtc.Tc19Int:
idx = (uint)((IntVariant)vidx).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
idx = (uint)((LongVariant)vidx).GetValue();
break;
default:
throw new InvalidOperationException();
}
var switchPosArray = (IntVariant[])((ArrayVariant)vSwitchPosArray).GetValue();
if (idx >= (ulong)switchPosArray.Length)
{
return;
}
JumpToPos((uint)switchPosArray[(int)idx].GetValue());
}
// Token: 0x060001FB RID: 507 RVA: 0x0000BC68 File Offset: 0x00009E68
private void Brtrue_(VariantBase vpos) // \u0008\u2007
{
var val = PopVariant();
var num = val.GetTypeCode();
bool flag;
switch (num)
{
case VariantBase.Vtc.Tc5Enum:
flag = Convert.ToBoolean(((EnumVariant)val).GetValue());
break;
case VariantBase.Vtc.Tc13UIntPtr:
flag = ((UIntPtrVariant)val).GetValue() != UIntPtr.Zero;
break;
case VariantBase.Vtc.Tc17IntPtr:
flag = ((IntPtrVariant)val).GetValue() != IntPtr.Zero;
break;
case VariantBase.Vtc.Tc18Object:
flag = ((ObjectVariant)val).GetValue() != null;
break;
case VariantBase.Vtc.Tc19Int:
flag = ((IntVariant)val).GetValue() != 0;
break;
case VariantBase.Vtc.Tc24Long:
flag = ((LongVariant)val).GetValue() != 0L;
break;
default:
flag = val.GetValueAbstract() != null;
break;
}
if (flag)
{
JumpToPos(((UintVariant)vpos).GetValue());
}
}
// Token: 0x06000214 RID: 532 RVA: 0x0000C764 File Offset: 0x0000A964
private void Br_(VariantBase vpos) // \u0005\u2008\u2000
{
JumpToPos(((UintVariant)vpos).GetValue());
}
private void Conv_r_un_(VariantBase dummy)
{
var pop = PopVariant();
double val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (Marshal.SizeOf(v) < 8)
val = (double)(uint)Convert.ToInt32(v);
else
val = (double)(ulong)Convert.ToInt64(v);
break;
case VariantBase.Vtc.Tc19Int:
val = (double)(uint)((IntVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc21Double:
val = ((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
val = (double)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
val = (double)(ulong)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(double), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Conv_R_Un);
gen.Emit(OpCodes.Ret);
val = (double)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new DoubleVariant();
push.SetValue(val);
PushVariant(push);
}
private void Conv_r(OpCode oc, Func<object, double> F)
{
var pop = PopVariant();
double val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
val = F(Marshal.SizeOf(v) < 8 ? Convert.ToInt32(v) : Convert.ToInt64(v));
break;
case VariantBase.Vtc.Tc19Int:
val = F(((IntVariant)pop).GetValue());
break;
case VariantBase.Vtc.Tc21Double:
val = F(((DoubleVariant)pop).GetValue());
break;
case VariantBase.Vtc.Tc8Float:
val = F(((FloatVariant)pop).GetValue());
break;
case VariantBase.Vtc.Tc24Long:
val = F(((LongVariant)pop).GetValue());
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(double), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(oc);
gen.Emit(OpCodes.Ret);
val = (double)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new DoubleVariant();
push.SetValue(val);
PushVariant(push);
}
private void Conv_r4_(VariantBase dummy)
{
Conv_r(OpCodes.Conv_R4, o => (double)(float)Convert.ChangeType(o, typeof(float)));
}
private void Conv_r8_(VariantBase dummy)
{
Conv_r(OpCodes.Conv_R8, o => (double)Convert.ChangeType(o, typeof(double)));
}
// Token: 0x06000196 RID: 406 RVA: 0x00008600 File Offset: 0x00006800
private void Ldind_i4_(VariantBase dummy) // \u0002\u2001\u2000
{
Ldind(typeof(int));
}
// Token: 0x06000197 RID: 407 RVA: 0x00008614 File Offset: 0x00006814
private void Ldind_u1_(VariantBase dummy) // \u000E
{
Ldind(typeof(byte));
}
// Token: 0x0600019A RID: 410 RVA: 0x00008688 File Offset: 0x00006888
private void Isinst_(VariantBase vTypeId) // \u000F\u2007\u2000
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
var obj = PopVariant();
if (Isinst(obj, type))
{
PushVariant(obj);
return;
}
PushVariant(new ObjectVariant());
}
// Token: 0x0600019D RID: 413 RVA: 0x00008B68 File Offset: 0x00006D68
private void Initobj_(VariantBase vTypeId) // \u0005\u2005\u2000
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
var dest = PopVariant();
if (!type.IsValueType)
{
AssignByReference(dest, new ObjectVariant());
return;
}
var obj = FetchByAddr(dest).GetValueAbstract();
if (SimpleTypeHelper.IsNullableGeneric(type))
{
var val = new ObjectVariant();
val.SetVariantType(type);
AssignByReference(dest, val);
return;
}
var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
foreach (var fieldInfo in fields)
{
fieldInfo.SetValue(obj, CreateValueTypeInstance(fieldInfo.FieldType));
}
}
// Token: 0x0600019E RID: 414 RVA: 0x00008C08 File Offset: 0x00006E08
private void Ldarg_s_(VariantBase vidx) // \u000E\u2000
{
var idx = (ByteVariant)vidx;
PushVariant(_variantOutputArgs[idx.GetValue()].Clone());
}
// Token: 0x06000244 RID: 580 RVA: 0x00010160 File Offset: 0x0000E360
private void Ldarga_s_(VariantBase vidx) // \u0008\u2001\u2001
{
var idx = (ByteVariant)vidx;
var push = new VariantBaseHolder();
push.SetValue(_variantOutputArgs[idx.GetValue()]);
PushVariant(push);
}
// Token: 0x06000255 RID: 597 RVA: 0x00010910 File Offset: 0x0000EB10
private void Ldarga_(VariantBase vidx) // \u0006\u2001
{
var idx = (UshortVariant)vidx;
var push = new VariantBaseHolder();
push.SetValue(_variantOutputArgs[idx.GetValue()]);
PushVariant(push);
}
// Token: 0x0600019F RID: 415 RVA: 0x00008C38 File Offset: 0x00006E38
private void Endfilter_(VariantBase dummy) // \u000F\u2001\u2000
{
if (((IntVariant)PopVariant()).GetValue() != 0)
{
_ehStack.PushBack(new ExcHandlerFrame
{
Pos = (uint)_myBufferReader.GetBuffer().GetPos(),
Exception = _exception
});
_wasException = false;
}
ExecuteExceptionHandler();
}
// Token: 0x060001A2 RID: 418 RVA: 0x00008CFC File Offset: 0x00006EFC
private void Ldind_r4_(VariantBase dummy) // \u0008\u2009\u2000
{
Ldind(typeof(float));
}
// Token: 0x060001A4 RID: 420 RVA: 0x00008D48 File Offset: 0x00006F48
private void Stsfld_(VariantBase vFieldId) // \u000F\u2008
{
var fieldInfo = ResolveField(((IntVariant)vFieldId).GetValue());
var val = VariantFactory.Convert(PopVariant().GetValueAbstract(), fieldInfo.FieldType);
fieldInfo.SetValue(null, val.GetValueAbstract());
}
// Token: 0x060001A5 RID: 421 RVA: 0x00008D90 File Offset: 0x00006F90
private void Ldloc_3_(VariantBase dummy) // \u0003\u2001\u2001
{
PushVariant(_localVariables[3].Clone());
}
// Token: 0x060001A7 RID: 423 RVA: 0x00008F68 File Offset: 0x00007168
private void Stelem_r8_(VariantBase dummy) // \u000E\u2006\u2000
{
Stelem(typeof(double));
}
// Token: 0x060001AA RID: 426 RVA: 0x00008FBC File Offset: 0x000071BC
private void Ceq_(VariantBase dummy) // \u0006\u2008
{
var iv = new IntVariant();
iv.SetValue(UniCompare(PopVariant(), PopVariant(), ComparisonKind.EQ, false) ? 1 : 0);
PushVariant(iv);
}
// Token: 0x060001AC RID: 428 RVA: 0x00009030 File Offset: 0x00007230
private void Stelem_i4_(VariantBase dummy) // \u000E\u2001\u2000
{
var obj = PopVariant().GetValueAbstract();
var idx = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
var elementType = array.GetType().GetElementType();
checked
{
if (elementType == typeof(int))
{
((int[])array)[(int)(IntPtr)idx] = (int)VariantFactory.Convert(obj, typeof(int)).GetValueAbstract();
return;
}
if (elementType == typeof(uint))
{
((uint[])array)[(int)(IntPtr)idx] = (uint)VariantFactory.Convert(obj, typeof(uint)).GetValueAbstract();
return;
}
if (elementType.IsEnum)
{
Stelem(elementType, obj, idx, array);
return;
}
Stelem(typeof(int), obj, idx, array);
}
}
// Token: 0x060001AD RID: 429 RVA: 0x00009100 File Offset: 0x00007300
private void Stind_i1_(VariantBase dummy) // \u0005\u2000\u2000
{
Stind();
}
// Token: 0x060001AF RID: 431 RVA: 0x00009114 File Offset: 0x00007314
private object ResolveNativeToken(int token) // \u0002
{
var num = HiByte.Extract(token);
object result;
if (num > 67108864)
{
if (num <= 167772160)
{
if (num != 100663296)
{
if (num != 167772160)
{
throw new InvalidOperationException();
}
try
{
result = _module.ModuleHandle.ResolveFieldHandle(token);
return result;
}
catch
{
try
{
result = _module.ModuleHandle.ResolveMethodHandle(token);
}
catch
{
throw new InvalidOperationException();
}
return result;
}
}
}
else
{
if (num == 452984832)
{
result = _module.ModuleHandle.ResolveTypeHandle(token);
return result;
}
if (num != 721420288)
{
throw new InvalidOperationException();
}
}
result = _module.ModuleHandle.ResolveMethodHandle(token);
return result;
}
if (num != 16777216 && num != 33554432)
{
if (num != 67108864)
{
throw new InvalidOperationException();
}
result = _module.ModuleHandle.ResolveFieldHandle(token);
return result;
}
result = _module.ModuleHandle.ResolveTypeHandle(token);
return result;
}
// Token: 0x060001B0 RID: 432 RVA: 0x0000923C File Offset: 0x0000743C
private void Ldloc_2_(VariantBase dummy) // \u0008\u2008
{
PushVariant(_localVariables[2].Clone());
}
// Token: 0x060001B1 RID: 433 RVA: 0x00009258 File Offset: 0x00007458
private void Constrained_(VariantBase vTypeId) // \u0002\u2000\u2000
{
_currentClass = GetTypeById(((IntVariant)vTypeId).GetValue());
}
// Token: 0x060001B2 RID: 434 RVA: 0x00009280 File Offset: 0x00007480
private void Ldftn_(VariantBase vMethodId) // \U0003\U2008
{
var methodBase = FindMethodById(((IntVariant)vMethodId).GetValue());
var push = new MethodVariant();
push.SetValue(methodBase);
PushVariant(push);
}
// Token: 0x060001B4 RID: 436 RVA: 0x000092C8 File Offset: 0x000074C8
private void Ldnull_(VariantBase dummy) // \u0005\u2002\u2001
{
PushVariant(new ObjectVariant());
}
private void Conv_ovf_u8_un_(VariantBase dummy)
{
Conv_u8(true, false);
}
// Token: 0x060001B8 RID: 440 RVA: 0x000093F0 File Offset: 0x000075F0
private void Stind_i2_(VariantBase dummy) // \u0003\u2000\u2000
{
Stind();
}
private void Conv_ovf_u2_un_(VariantBase dummy)
{
Conv_u2(true, false);
}
private void Conv_u2(bool ovf, bool signed)
{
var pop = PopVariant();
ushort val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
if (ovf)
{
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (signed)
val = Convert.ToUInt16(v);
else
val = Convert.ToUInt16((ulong)Convert.ToInt64(v));
break;
}
val = (ushort)VariantBase.SignedLongFromEnum((EnumVariant)pop);
break;
case VariantBase.Vtc.Tc19Int:
if (ovf && !signed)
{
val = Convert.ToUInt16((uint)((IntVariant)pop).GetValue());
break;
}
val = ovf ? Convert.ToUInt16(((IntVariant)pop).GetValue()) : (ushort)((IntVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = checked((ushort) ((DoubleVariant) pop).GetValue());
break;
}
val = (ushort)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = checked((ushort)((FloatVariant)pop).GetValue());
break;
}
val = (ushort)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
if (signed)
val = checked((ushort)((LongVariant)pop).GetValue());
else
val = Convert.ToUInt16((ulong)((LongVariant)pop).GetValue());
break;
}
val = (ushort)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(ushort), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_U2 : OpCodes.Conv_U2) : OpCodes.Conv_Ovf_U2_Un);
gen.Emit(OpCodes.Ret);
val = (ushort)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new UshortVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x060001AE RID: 430 RVA: 0x00009108 File Offset: 0x00007308
private void Conv_ovf_u2_(VariantBase dummy) // \u0008\u2005\u2000
{
Conv_u2(true, true);
}
// Token: 0x06000292 RID: 658 RVA: 0x0001238C File Offset: 0x0001058C
private void Conv_u2_(VariantBase dummy) // \u000F\u2002\u2000
{
Conv_u2(false, true);
}
private void Conv_u1(bool ovf, bool signed)
{
var pop = PopVariant();
byte val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
if (ovf)
{
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
val = signed ? Convert.ToByte(v) : Convert.ToByte((ulong)Convert.ToInt64(v));
break;
}
val = (byte)VariantBase.SignedLongFromEnum((EnumVariant)pop);
break;
case VariantBase.Vtc.Tc19Int:
if (ovf && !signed)
{
val = Convert.ToByte((uint)((IntVariant)pop).GetValue());
break;
}
val = ovf ? Convert.ToByte(((IntVariant)pop).GetValue()) : (byte)((IntVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = signed ? checked((byte)((DoubleVariant)pop).GetValue()) : Convert.ToByte(((DoubleVariant)pop).GetValue());
break;
}
val = (byte)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = checked((byte)((FloatVariant)pop).GetValue());
break;
}
val = (byte)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
val = checked((byte)((LongVariant)pop).GetValue());
break;
}
val = (byte)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(byte), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_U1 : OpCodes.Conv_U1) : OpCodes.Conv_Ovf_U1_Un);
gen.Emit(OpCodes.Ret);
val = (byte)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new ByteVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x06000182 RID: 386 RVA: 0x00007FB4 File Offset: 0x000061B4
private void Conv_ovf_i1_(VariantBase dummy) // \u0008\u2004
{
Conv_i1(true, true);
}
// Token: 0x06000188 RID: 392 RVA: 0x00008238 File Offset: 0x00006438
private void Conv_u4_(VariantBase dummy) // \u0008\u2003\u2001
{
Conv_u4(false, true);
}
// Token: 0x0600018A RID: 394 RVA: 0x00008270 File Offset: 0x00006470
private void Conv_ovf_i_(VariantBase dummy) // \u0008\u2003\u2000
{
Conv_i(true, true);
}
// Token: 0x060001CF RID: 463 RVA: 0x0000A1CC File Offset: 0x000083CC
private void Conv_i_(VariantBase dummy) // \u0008\u2005
{
Conv_i(false, true);
}
// Token: 0x060001FF RID: 511 RVA: 0x0000BFC8 File Offset: 0x0000A1C8
private void Conv_u4(bool ovf, bool signed) // \u0005
{
var pop = PopVariant();
uint val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
if (ovf)
{
var v = VariantBase.SignedVariantFromEnum((EnumVariant) pop).GetValueAbstract();
if (signed || Marshal.SizeOf(v) < 8)
val = signed ? Convert.ToUInt32(v) : (uint)Convert.ToInt32(v);
else
val = Convert.ToUInt32(Convert.ToUInt64(v));
break;
}
val = (uint)VariantBase.SignedLongFromEnum((EnumVariant)pop);
break;
case VariantBase.Vtc.Tc19Int:
if (ovf && signed)
{
val = checked((uint)((IntVariant)pop).GetValue());
break;
}
val = (uint)((IntVariant)pop).GetValue(); // err fixed and unit tested by ursoft (was ushort)
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = checked((uint)((DoubleVariant)pop).GetValue());
break;
}
val = (uint)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = checked((uint)((FloatVariant)pop).GetValue());
break;
}
val = (uint)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
val = checked((uint)((LongVariant)pop).GetValue());
break;
}
val = (uint)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(UInt32), new []{ typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_U4 : OpCodes.Conv_U4) : OpCodes.Conv_Ovf_U4_Un);
gen.Emit(OpCodes.Ret);
val = (uint) dyn.Invoke(null, new[] {pop.GetValueAbstract()});
break;
}
var push = new IntVariant();
push.SetValue((int)val);
PushVariant(push);
}
private void Conv_i4(bool ovf, bool signed)
{
var pop = PopVariant();
int val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
if (ovf)
{
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (signed)
val = Convert.ToInt32(v);
else
val = Convert.ToInt32((ulong)Convert.ToInt64(v));
break;
}
val = (int)VariantBase.SignedLongFromEnum((EnumVariant)pop);
break;
case VariantBase.Vtc.Tc19Int:
if (ovf && !signed)
{
val = Convert.ToInt32((uint)((IntVariant)pop).GetValue());
break;
}
val = ((IntVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = checked((int)((DoubleVariant)pop).GetValue());
break;
}
val = (int)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = checked((int)((FloatVariant)pop).GetValue());
break;
}
val = (int)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
if(signed)
val = checked((int)((LongVariant)pop).GetValue());
else
val = Convert.ToInt32((ulong)((LongVariant)pop).GetValue());
break;
}
val = (int)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(Int32), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_I4 : OpCodes.Conv_I4) : OpCodes.Conv_Ovf_I4_Un);
gen.Emit(OpCodes.Ret);
val = (int)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new IntVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x06000294 RID: 660 RVA: 0x00012414 File Offset: 0x00010614
private void Conv_ovf_u4_(VariantBase dummy) // \u000F\u200A
{
Conv_u4(true, true);
}
// Token: 0x06000200 RID: 512 RVA: 0x0000C0B0 File Offset: 0x0000A2B0
private void Conv_ovf_u1_(VariantBase dummy) // \u0008\u2007\u2000
{
Conv_u1(true, true);
}
private void Conv_ovf_i2_un_(VariantBase dummy)
{
Conv_i2(true, false);
}
private void Conv_i2(bool ovf, bool signed)
{
var pop = PopVariant();
short val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
if (ovf)
{
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (signed)
val = Convert.ToInt16(v);
else
val = Convert.ToInt16((ulong)Convert.ToInt64(v));
break;
}
val = (short)VariantBase.SignedLongFromEnum((EnumVariant)pop);
break;
case VariantBase.Vtc.Tc19Int:
if (ovf && !signed)
{
val = Convert.ToInt16((uint)((IntVariant)pop).GetValue());
break;
}
val = ovf ? Convert.ToInt16(((IntVariant)pop).GetValue()) : (short)((IntVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = signed ? checked((short)((DoubleVariant)pop).GetValue()) :
(IntPtr.Size == 4 ? Convert.ToInt16(Convert.ToUInt16((long)((DoubleVariant)pop).GetValue())) :
Convert.ToInt16((long)((DoubleVariant)pop).GetValue()));
break;
}
val = (short)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = signed ? checked((short)((FloatVariant)pop).GetValue()) :
(IntPtr.Size == 4 ? Convert.ToInt16(Convert.ToUInt16((long)((FloatVariant)pop).GetValue())) :
Convert.ToInt16((long)((FloatVariant)pop).GetValue()));
break;
}
val = (short)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
if (signed)
val = checked((short)((LongVariant)pop).GetValue());
else
val = Convert.ToInt16((ulong)((LongVariant)pop).GetValue());
break;
}
val = (short)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(short), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_I2 : OpCodes.Conv_I2) : OpCodes.Conv_Ovf_I2_Un);
gen.Emit(OpCodes.Ret);
val = (short)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new ShortVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x060001FE RID: 510 RVA: 0x0000BFBC File Offset: 0x0000A1BC
private void Conv_i2_(VariantBase dummy) // \u0006\u2001\u2000
{
Conv_i2(false, true);
}
// Token: 0x060002A8 RID: 680 RVA: 0x00012D2C File Offset: 0x00010F2C
private void Conv_ovf_i4_(VariantBase dummy) // \u000F\u2000\u2000
{
Conv_i4(true, true);
}
private void Conv_i8(bool ovf, bool signed)
{
var pop = PopVariant();
long val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (!signed && ovf && Marshal.SizeOf(v) > 4)
val = checked((long)(ulong)Convert.ToInt64(v));
else
val = (signed || Marshal.SizeOf(v) > 4) ? Convert.ToInt64(v) :
(uint)(ulong)Convert.ToInt64(v);
break;
case VariantBase.Vtc.Tc19Int:
int iv = ((IntVariant)pop).GetValue();
if (signed)
val = iv;
else
val = (long)(uint)iv;
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = checked((long)((DoubleVariant)pop).GetValue());
break;
}
val = (long)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = checked((long)((FloatVariant)pop).GetValue());
break;
}
val = (long)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
if (signed)
val = ((LongVariant)pop).GetValue();
else
val = Convert.ToInt64((ulong)((LongVariant)pop).GetValue());
break;
}
val = ((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(long), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_I8 : OpCodes.Conv_I8) : OpCodes.Conv_Ovf_I8_Un);
gen.Emit(OpCodes.Ret);
val = (long)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new LongVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x06000219 RID: 537 RVA: 0x0000C824 File Offset: 0x0000AA24
private void Conv_ovf_i8_(VariantBase dummy) // \u0008\u2002\u2000
{
Conv_i8(true, true);
}
private void Conv_i1(bool ovf, bool signed)
{
var pop = PopVariant();
sbyte val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
if (ovf)
{
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
val = signed ? Convert.ToSByte(v) : Convert.ToSByte((ulong)Convert.ToInt64(v));
break;
}
val = (sbyte)VariantBase.SignedLongFromEnum((EnumVariant)pop);
break;
case VariantBase.Vtc.Tc19Int:
if (ovf && !signed)
{
val = Convert.ToSByte((uint)((IntVariant)pop).GetValue());
break;
}
val = ovf ? Convert.ToSByte(((IntVariant)pop).GetValue()) : (sbyte)((IntVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = signed ? checked((sbyte)((DoubleVariant)pop).GetValue()) :
(IntPtr.Size == 4 ? Convert.ToSByte(Convert.ToByte(((DoubleVariant)pop).GetValue())) :
Convert.ToSByte((long)((DoubleVariant)pop).GetValue()));
break;
}
val = (sbyte)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = signed ? checked((sbyte)((FloatVariant)pop).GetValue()) :
(IntPtr.Size == 4 ? Convert.ToSByte(Convert.ToByte(((FloatVariant)pop).GetValue())) :
Convert.ToSByte((long)((FloatVariant)pop).GetValue()));
break;
}
val = (sbyte)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf)
{
if (signed)
val = checked((sbyte)((LongVariant)pop).GetValue());
else
val = Convert.ToSByte((ulong)((LongVariant)pop).GetValue());
break;
}
val = (sbyte)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(SByte), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_I1 : OpCodes.Conv_I1) : OpCodes.Conv_Ovf_I1_Un);
gen.Emit(OpCodes.Ret);
val = (sbyte)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new SbyteVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x060002A6 RID: 678 RVA: 0x00012CD0 File Offset: 0x00010ED0
private void Conv_i1_(VariantBase dummy) // \u000E\u2006
{
Conv_i1(false, true);
}
// Token: 0x06000285 RID: 645 RVA: 0x00011EF0 File Offset: 0x000100F0
private void Conv_ovf_i2_(VariantBase dummy) // \u0002\u2000\u2001
{
Conv_i2(true, true);
}
// Token: 0x0600018D RID: 397 RVA: 0x000083F8 File Offset: 0x000065F8
private void Conv_u_(VariantBase dummy) // \u000F\u2003\u2001
{
Conv_u(false, true);
}
// Token: 0x060001EF RID: 495 RVA: 0x0000B658 File Offset: 0x00009858
private void Conv_ovf_u_(VariantBase dummy) // \u0002\u2000
{
Conv_u(true, true);
}
// Token: 0x06000215 RID: 533 RVA: 0x0000C784 File Offset: 0x0000A984
private void Conv_u1_(VariantBase dummy) // \u0008\u2002
{
Conv_u1(false, true);
}
// Token: 0x06000211 RID: 529 RVA: 0x0000C690 File Offset: 0x0000A890
private void Conv_ovf_i_un_(VariantBase dummy) // \u000F
{
Conv_i(true, false);
}
// Token: 0x06000229 RID: 553 RVA: 0x0000F56C File Offset: 0x0000D76C
private void Conv_i4_(VariantBase dummy) // \u0003\u2005\u2000
{
Conv_i4(false, true);
}
private void Conv_ovf_i8_un_(VariantBase dummy)
{
Conv_i8(true, false);
}
// Token: 0x06000253 RID: 595 RVA: 0x00010790 File Offset: 0x0000E990
private void Conv_ovf_u4_un_(VariantBase dummy) // \u0002\u2009\u2000
{
Conv_u4(true, false);
}
// Token: 0x06000284 RID: 644 RVA: 0x00011EE4 File Offset: 0x000100E4
private void Conv_i8_(VariantBase dummy) // \u0003\u2006\u2000
{
Conv_i8(false, true);
}
// Token: 0x0600028A RID: 650 RVA: 0x000121B8 File Offset: 0x000103B8
private void Conv_ovf_u_un_(VariantBase dummy) // \u000F\u200B
{
Conv_u(true, false);
}
private unsafe void Conv_i(bool ovf, bool signed)
{
var pop = PopVariant();
var push = new IntPtrVariant();
long val;
var tc = pop.GetTypeCode();
if (tc == VariantBase.Vtc.Tc21Double || tc == VariantBase.Vtc.Tc8Float)
signed = true;
long maxVal = long.MaxValue, minVal = signed ? long.MinValue : 0;
if (IntPtr.Size == 4)
{
maxVal = signed ? Int32.MaxValue : UInt32.MaxValue;
minVal = signed ? Int32.MinValue : 0;
}
switch (tc)
{
case VariantBase.Vtc.Tc5Enum:
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (IntPtr.Size == 4)
{
if (ovf) val = Convert.ToInt32(v);
else val = (int)Convert.ToInt64(v);
}
else
{
val = (signed || Marshal.SizeOf(v) > 4 || !ovf) ? Convert.ToInt64(v) :
(uint)(ulong)Convert.ToInt64(v);
}
break;
case VariantBase.Vtc.Tc19Int:
int iv = ((IntVariant) pop).GetValue();
if (IntPtr.Size == 4 || signed)
val = iv;
else
val = (long)(uint)iv;
break;
case VariantBase.Vtc.Tc21Double:
{
double dv = ((DoubleVariant)pop).GetValue();
if (dv <= maxVal && dv >= minVal)
val = (long)dv;
else
{
if (ovf) throw new OverflowException();
val = (IntPtr.Size == 4) ? Int32.MinValue : Int64.MinValue; // не мусор ли?
}
}
break;
case VariantBase.Vtc.Tc8Float:
{
double dv = (double) ((FloatVariant) pop).GetValue();
if (dv <= maxVal && dv >= minVal)
val = (long) dv;
else
{
if (ovf) throw new OverflowException();
val = (IntPtr.Size == 4) ? Int32.MinValue : Int64.MinValue; // не мусор ли?
}
}
break;
case VariantBase.Vtc.Tc24Long:
val = ((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_I : OpCodes.Conv_I) : OpCodes.Conv_Ovf_I_Un);
gen.Emit(OpCodes.Ret);
push.SetValue(((IntPtr)dyn.Invoke(null, new[] { pop.GetValueAbstract() })));
PushVariant(push);
return;
}
if ((ovf == false) || (val <= maxVal && val >= minVal))
{
push.SetValue(new IntPtr((void*)val));
PushVariant(push);
} else throw new OverflowException();
}
private unsafe void Conv_u(bool ovf, bool signed)
{
var pop = PopVariant();
var push = new UIntPtrVariant();
ulong val, maxVal = (IntPtr.Size == 4) ? UInt32.MaxValue : UInt64.MaxValue;
var tc = pop.GetTypeCode();
switch (tc)
{
case VariantBase.Vtc.Tc5Enum:
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if (IntPtr.Size == 4)
{
if (ovf) val = signed ?
Convert.ToUInt64(v) :
(Marshal.SizeOf(v) > 4) ? (ulong)Convert.ToInt64(v) : (uint)Convert.ToInt32(v);
else val = (uint)Convert.ToInt64(v);
}
else
{
val = (Marshal.SizeOf(v) > 4) ?
((ovf && signed) ? Convert.ToUInt64(Convert.ToInt64(v)) : (ulong)Convert.ToInt64(v)) :
((ovf && signed) ? Convert.ToUInt32(Convert.ToInt32(v)) : (uint)Convert.ToInt32(v));
}
break;
case VariantBase.Vtc.Tc19Int:
int iv = ((IntVariant)pop).GetValue();
if (ovf && signed && iv < 0) throw new OverflowException();
val = (uint)iv;
break;
case VariantBase.Vtc.Tc21Double:
{
double dv = ((DoubleVariant)pop).GetValue();
if (ovf && signed && dv < 0) throw new OverflowException();
if (dv <= maxVal && (signed || dv >= 0))
val = (ulong)dv;
else
{
if (ovf) throw new OverflowException();
val = 0; // мусор, индульгируем
}
}
break;
case VariantBase.Vtc.Tc8Float:
{
double dv = (double)((FloatVariant)pop).GetValue();
if (ovf && signed && dv < 0) throw new OverflowException();
if (dv <= maxVal && (signed || dv >= 0))
val = (ulong)dv;
else
{
if (ovf) throw new OverflowException();
val = 0; // мусор, индульгируем
}
}
break;
case VariantBase.Vtc.Tc24Long:
long lv = ((LongVariant)pop).GetValue();
if (ovf && signed && lv < 0) throw new OverflowException();
val = (ulong) lv;
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(UIntPtr), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_U : OpCodes.Conv_U) : OpCodes.Conv_Ovf_U_Un);
gen.Emit(OpCodes.Ret);
push.SetValue(((UIntPtr)dyn.Invoke(null, new[] { pop.GetValueAbstract() })));
PushVariant(push);
return;
}
if ((ovf == false) || (val <= maxVal))
{
push.SetValue(new UIntPtr((void*)val));
PushVariant(push);
}
else throw new OverflowException();
}
private void Conv_u8(bool ovf, bool signed)
{
var pop = PopVariant();
ulong val;
switch (pop.GetTypeCode())
{
case VariantBase.Vtc.Tc5Enum:
var v = VariantBase.SignedVariantFromEnum((EnumVariant)pop).GetValueAbstract();
if(ovf && signed)
val = Convert.ToUInt64(v);
else
if (Marshal.SizeOf(v) > 4)
val = (ulong)Convert.ToInt64(v);
else
val = (uint)(ulong)Convert.ToInt64(v);
break;
case VariantBase.Vtc.Tc19Int:
int iv = ((IntVariant)pop).GetValue();
val = ovf ? (signed ? checked((uint)iv) : (uint)iv) : (uint)iv;
break;
case VariantBase.Vtc.Tc21Double:
if (ovf)
{
val = checked((ulong)((DoubleVariant)pop).GetValue());
break;
}
val = (ulong)((DoubleVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc8Float:
if (ovf)
{
val = checked((ulong)((FloatVariant)pop).GetValue());
break;
}
val = (ulong)((FloatVariant)pop).GetValue();
break;
case VariantBase.Vtc.Tc24Long:
if (ovf && signed)
val = Convert.ToUInt64(((LongVariant)pop).GetValue());
else
val = (ulong)((LongVariant)pop).GetValue();
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(ulong), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(signed ? (ovf ? OpCodes.Conv_Ovf_U8 : OpCodes.Conv_U8) : OpCodes.Conv_Ovf_U8_Un);
gen.Emit(OpCodes.Ret);
val = (ulong)dyn.Invoke(null, new[] { pop.GetValueAbstract() });
break;
}
var push = new UlongVariant();
push.SetValue(val);
PushVariant(push);
}
// Token: 0x06000204 RID: 516 RVA: 0x0000C19C File Offset: 0x0000A39C
private void Conv_u8_(VariantBase dummy) // \u0003\u2005
{
Conv_u8(false, true);
}
// Token: 0x0600020E RID: 526 RVA: 0x0000C58C File Offset: 0x0000A78C
private void Conv_ovf_u8_(VariantBase dummy) // \u0008\u2008\u2000
{
Conv_u8(true, true);
}
// Token: 0x06000208 RID: 520 RVA: 0x0000C43C File Offset: 0x0000A63C
private void Conv_ovf_i1_un_(VariantBase dummy) // \u0008
{
Conv_i1(true, false);
}
private void Conv_ovf_u1_un_(VariantBase dummy)
{
Conv_u1(true, false);
}
// Token: 0x060001BB RID: 443 RVA: 0x000094E0 File Offset: 0x000076E0
private void _u0006u2003u2001(VariantBase dummy) // \u0006\u2003\u2001
{
}
// Token: 0x060001BC RID: 444 RVA: 0x000094E4 File Offset: 0x000076E4
private VariantBase[] CreateLocalVariables() // u0002
{
var array = _methodHeader.LocalVarTypes;
var num = array.Length;
var ret = new VariantBase[num];
for (var i = 0; i < num; i++)
{
ret[i] = VariantFactory.Convert(null, GetTypeById(array[i].TypeId));
}
return ret;
}
// Token: 0x060001C0 RID: 448 RVA: 0x0000958C File Offset: 0x0000778C
private MethodBase FindGenericMethod(VmMethodTokenInfo what) // \u0002
{
var type = GetTypeById(what.Class.MetadataToken);
var bindingAttr = BF(what.IsStatic());
var arg_32_0 = type.GetMember(what.Name, bindingAttr);
var array = arg_32_0;
var methodInfo = (from MethodInfo methodInfo2 in array
where methodInfo2.IsGenericMethodDefinition
let parameters = methodInfo2.GetParameters()
where
parameters.Length == what.Parameters.Length &&
methodInfo2.GetGenericArguments().Length == what.GenericArguments.Length &&
AreCompatible(methodInfo2.ReturnType, what.ReturnType)
where !parameters.Where((t1, j) => !AreCompatible(t1.ParameterType, what.Parameters[j])).Any()
select methodInfo2).FirstOrDefault();
if (methodInfo == null)
{
throw new Exception(string.Format(StringDecryptor.GetString(-1550347247) /* Cannot bind method: {0}.{1} */, type.Name, what.Name));
}
var array2 = new Type[what.GenericArguments.Length];
for (var k = 0; k < array2.Length; k++)
{
array2[k] = GetTypeById(what.GenericArguments[k].MetadataToken);
}
return methodInfo.MakeGenericMethod(array2);
}
// Token: 0x060001C2 RID: 450 RVA: 0x000097A0 File Offset: 0x000079A0
private bool InvokeFilter(MethodBase mb, object obj, ref object result, object[] args) // \u0002
{
var declaringType = mb.DeclaringType;
if (declaringType == null)
{
return false;
}
if (SimpleTypeHelper.IsNullableGeneric(declaringType))
{
if (string.Equals(mb.Name, StringDecryptor.GetString(-1550345611) /* get_HasValue */, StringComparison.Ordinal))
{
result = obj != null;
}
else if (string.Equals(mb.Name, StringDecryptor.GetString(-1550345722) /* get_Value */, StringComparison.Ordinal))
{
if (obj == null)
{
//return ((bool?)null).Value;
throw new InvalidOperationException();
}
result = obj;
}
else if (mb.Name.Equals(StringDecryptor.GetString(-1550345706) /* GetValueOrDefault */, StringComparison.Ordinal))
{
if (obj == null)
{
/*u0005 =*/ Activator.CreateInstance(Nullable.GetUnderlyingType(mb.DeclaringType));
}
result = obj;
}
else
{
if (obj != null || mb.IsStatic)
{
return false;
}
result = null;
}
return true;
}
if (declaringType == SimpleTypeHelper.TypedReferenceType)
{
var name = mb.Name;
var i = args.Length;
if (i != 1)
{
if (i == 2)
{
if (name == StringDecryptor.GetString(-1550345495) /* SetTypedReference */)
{
TypedReference.SetTypedReference((TypedReference)args[0], args[1]);
return true;
}
}
}
else
{
if (name == StringDecryptor.GetString(-1550345682) /* GetTargetType */)
{
result = TypedReference.GetTargetType((TypedReference)args[0]);
return true;
}
if (name == StringDecryptor.GetString(-1550345534) /* TargetTypeToken */)
{
result = TypedReference.TargetTypeToken((TypedReference)args[0]);
return true;
}
if (name == StringDecryptor.GetString(-1550345512) /* ToObject */)
{
result = TypedReference.ToObject((TypedReference)args[0]);
return true;
}
}
}
else if (declaringType == AssemblyType)
{
if (_callees != null && mb.Name == StringDecryptor.GetString(-1550345599) /* GetCallingAssembly */)
{
var array = _callees;
foreach (var t in array)
{
var assembly = t as Assembly;
if (assembly != null)
{
result = assembly;
return true;
}
}
}
}
else if (declaringType == MethodBaseType)
{
if (mb.Name == StringDecryptor.GetString(-1550345576) /* GetCurrentMethod */)
{
if (_callees != null)
{
var array = _callees;
foreach (var t in array)
{
var methodBase = t as MethodBase;
if (methodBase != null)
{
result = methodBase;
return true;
}
}
}
result = MethodBase.GetCurrentMethod();
return true;
}
}
else if (declaringType.IsArray && declaringType.GetArrayRank() >= 2)
{
return RefToMdArrayItem(mb, obj, ref result, args);
}
return false;
}
// Token: 0x060001C3 RID: 451 RVA: 0x000099F8 File Offset: 0x00007BF8
private void Ldloca_s_(VariantBase vLocIdx) // \u0005\u2001\u2001
{
var push = new LocalsIdxHolderVariant();
push.SetValue(((ByteVariant)vLocIdx).GetValue());
PushVariant(push);
}
// Token: 0x060001C4 RID: 452 RVA: 0x00009A24 File Offset: 0x00007C24
private void Ldind_i_(VariantBase dummy) // \u000E\u2004\u2000
{
Ldind(IntPtrType);
}
// Token: 0x060001C6 RID: 454 RVA: 0x00009D14 File Offset: 0x00007F14
private void Stloc_(VariantBase vidx) // \u0008\u2006
{
var idx = (UshortVariant)vidx;
PopToLocal(idx.GetValue());
}
// Token: 0x060001C7 RID: 455 RVA: 0x00009D34 File Offset: 0x00007F34
private void Stfld_(VariantBase vFieldId) // \u0005\u200B
{
var fieldInfo = ResolveField(((IntVariant)vFieldId).GetValue());
var val = PopVariant();
var objRef = PopVariant();
var obj = objRef.IsAddr() ? FetchByAddr(objRef).GetValueAbstract() : objRef.GetValueAbstract();
if (obj == null)
{
throw new NullReferenceException();
}
fieldInfo.SetValue(obj, VariantFactory.Convert(val.GetValueAbstract(), fieldInfo.FieldType).GetValueAbstract());
if (objRef.IsAddr() && /*obj != null && */ obj.GetType().IsValueType)
{
AssignByReference(objRef, VariantFactory.Convert(obj, null));
}
}
// Token: 0x060001C8 RID: 456 RVA: 0x00009DD0 File Offset: 0x00007FD0
/*private void u000Fu2004(VariantBase dummy) // \u000F\u2004
{
}*/
// Token: 0x060001CB RID: 459 RVA: 0x00009E7C File Offset: 0x0000807C
private void Ldloc_s_(VariantBase vidx) // \u0002
{
var idx = (ByteVariant)vidx;
PushVariant(_localVariables[idx.GetValue()].Clone());
}
// Token: 0x060001D1 RID: 465 RVA: 0x0000A328 File Offset: 0x00008528
private void Stelem_ref_(VariantBase dummy) // \u0008\u200A
{
Stelem(SimpleTypeHelper.ObjectType);
}
// Token: 0x060001D3 RID: 467 RVA: 0x0000A34C File Offset: 0x0000854C
private void Ldelem_u2_(VariantBase dummy) // \u000E\u2003\u2001
{
Ldelem(typeof(ushort));
}
// Token: 0x060001D5 RID: 469 RVA: 0x0000A620 File Offset: 0x00008820
private void Stind_i4_(VariantBase dummy) // \u0006\u2003\u2000
{
Stind();
}
// Token: 0x060001D6 RID: 470 RVA: 0x0000A628 File Offset: 0x00008828
private void Stind_i8_(VariantBase dummy) // \u0003\u2002\u2000
{
Stind();
}
// Token: 0x060001DC RID: 476 RVA: 0x0000AAD8 File Offset: 0x00008CD8
private void Stelem_i8_(VariantBase dummy) // \u0002\u200B\u2000
{
var obj = PopVariant().GetValueAbstract();
var idx = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
var elementType = array.GetType().GetElementType();
checked
{
if (elementType == typeof(long))
{
((long[])array)[(int)(IntPtr)idx] = (long)VariantFactory.Convert(obj, typeof(long)).GetValueAbstract();
return;
}
if (elementType == typeof(ulong))
{
((ulong[])array)[(int)(IntPtr)idx] = (ulong)VariantFactory.Convert(obj, typeof(ulong)).GetValueAbstract();
return;
}
if (elementType.IsEnum)
{
Stelem(elementType, obj, idx, array);
return;
}
Stelem(typeof(long), obj, idx, array);
}
}
// Token: 0x060001DD RID: 477 RVA: 0x0000ABA8 File Offset: 0x00008DA8
private void Stelem_i_(VariantBase dummy) // \u000F\u2006\u2000
{
Stelem(IntPtrType);
}
// Token: 0x060001DE RID: 478 RVA: 0x0000ABB8 File Offset: 0x00008DB8
private void Ldelem_i8_(VariantBase dummy) // \u0006\u2000
{
Ldelem(typeof(long));
}
// Token: 0x060001E0 RID: 480 RVA: 0x0000ABD0 File Offset: 0x00008DD0
private void Ldc_i4_(VariantBase val) // \u0006\u2000\u2000
{
PushVariant(val);
}
// Token: 0x060001E2 RID: 482 RVA: 0x0000AC08 File Offset: 0x00008E08
private void Ldarg_1_(VariantBase dummy) // \u0002\u2003\u2001
{
PushVariant(_variantOutputArgs[1].Clone());
}
// Token: 0x060001E3 RID: 483 RVA: 0x0000AC24 File Offset: 0x00008E24
private void Ret_(VariantBase dummy) // \u000E\u2005\u2000
{
Ret();
}
// Token: 0x060001E8 RID: 488 RVA: 0x0000B10C File Offset: 0x0000930C
private void Stelem(Type arrType, object val, long idx, Array array) // \u0002
{
array.SetValue(VariantFactory.Convert(val, arrType).GetValueAbstract(), idx);
}
// Token: 0x060001E9 RID: 489 RVA: 0x0000B130 File Offset: 0x00009330
[DebuggerNonUserCode]
private MethodBase FindMethodById(int methodId, UniversalTokenInfo methodToken) // \u0002
{
MethodBase result = null;
lock (AllMetadataById)
{
//var flag = true;
object obj;
if (/*flag &&*/ AllMetadataById.TryGetValue(methodId, out obj))
{
result = (MethodBase)obj;
}
else if (methodToken.IsVm == 0)
{
var methodBase = _module.ResolveMethod(methodToken.MetadataToken);
//if (flag)
{
AllMetadataById.Add(methodId, methodBase);
}
result = methodBase;
}
else
{
var mti = (VmMethodTokenInfo)methodToken.VmToken;
if (mti.IsGeneric())
{
result = FindGenericMethod(mti);
}
else
{
var clsType = GetTypeById(mti.Class.MetadataToken);
var retType = GetTypeById(mti.ReturnType.MetadataToken);
var paramArray = new Type[mti.Parameters.Length];
for (var i = 0; i < paramArray.Length; i++)
{
paramArray[i] = GetTypeById(mti.Parameters[i].MetadataToken);
}
/*if (type.IsGenericType)
{
flag = false;
}*/
if (mti.Name == StringDecryptor.GetString(-1550347259) /* .ctor */)
{
var constructor = clsType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, CallingConventions.Any, paramArray, null);
if (constructor == null)
{
throw new Exception();
}
if (!clsType.IsGenericType)
{
AllMetadataById.Add(methodId, constructor);
}
result = constructor;
}
else
{
var bindingAttr = BF(mti.IsStatic());
try
{
result = clsType.GetMethod(mti.Name, bindingAttr, null, CallingConventions.Any, paramArray, null);
}
catch (AmbiguousMatchException)
{
var methods = clsType.GetMethods(bindingAttr);
foreach (var methodInfo in methods)
{
if (methodInfo.Name == mti.Name && methodInfo.ReturnType == retType)
{
var parameters = methodInfo.GetParameters();
if (parameters.Length == paramArray.Length)
{
if (!(bool)paramArray.Where((t, k) => parameters[k].ParameterType != t).Any())
{
result = methodInfo;
break;
}
}
}
}
}
if (result == null)
{
throw new Exception(string.Format(StringDecryptor.GetString(-1550347247) /* Cannot bind method: {0}.{1} */, clsType.Name, mti.Name));
}
if (!clsType.IsGenericType)
{
AllMetadataById.Add(methodId, result);
}
}
}
}
}
return result;
}
// Token: 0x060001EA RID: 490 RVA: 0x0000B3B8 File Offset: 0x000095B8
private void Stloc_s_(VariantBase vidx) // \u000E\u2004
{
var idx = (ByteVariant)vidx;
PopToLocal(idx.GetValue());
}
// Token: 0x060001EB RID: 491 RVA: 0x0000B3D8 File Offset: 0x000095D8
private void LockIfInterlocked(ref BoolHolder wasLocked, MethodBase mb, bool dummy) // \u0002
{
if (mb.DeclaringType == typeof(Interlocked) && mb.IsStatic)
{
var name = mb.Name;
if (name == StringDecryptor.GetString(-1550347213) /* Add */ || name == StringDecryptor.GetString(-1550347203) /* CompareExchange */ || name == StringDecryptor.GetString(-1550347053) /* Decrement */ || name == StringDecryptor.GetString(-1550347037) /* Exchange */ || name == StringDecryptor.GetString(-1550347024) /* Increment */ || name == StringDecryptor.GetString(-1550347136) /* Read*/)
{
Monitor.Enter(InterlockedLock);
wasLocked.Val = true;
}
}
}
// Token: 0x060001EC RID: 492 RVA: 0x0000B4A0 File Offset: 0x000096A0
private void Box_(VariantBase vTypeId) // \u0003\u2009\u2000
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
var push = VariantFactory.Convert(PopVariant().GetValueAbstract(), type);
push.SetVariantType(type);
PushVariant(push);
}
// Token: 0x060001F1 RID: 497 RVA: 0x0000B690 File Offset: 0x00009890
private void Sizeof_(VariantBase vTypeId) // \u000E\u2001\u2001
{
var t = GetTypeById(((IntVariant)vTypeId).GetValue());
var iv = new IntVariant();
iv.SetValue(Marshal.SizeOf(t));
PushVariant(iv);
}
// Token: 0x060001F3 RID: 499 RVA: 0x0000B758 File Offset: 0x00009958
private void Ldelem_i_(VariantBase dummy) // \u000F\u2000
{
Ldelem(IntPtrType);
}
// Token: 0x060001F4 RID: 500 RVA: 0x0000B768 File Offset: 0x00009968
private void InternalInvoke() // \u0002
{
try
{
LoopUntilRet();
}
catch (Exception ex)
{
OnException(ex, 0u);
LoopUntilRet();
}
}
// Token: 0x060001F5 RID: 501 RVA: 0x0000B7A0 File Offset: 0x000099A0
private MethodBase GenerateDynamicCall(MethodBase mb, bool mayVirtual) // \u0002
{
MethodBase result;
lock (DynamicMethods)
{
DynamicMethod dynamicMethod;
if (DynamicMethods.TryGetValue(mb, out dynamicMethod))
{
result = dynamicMethod;
}
else
{
var methodInfo = mb as MethodInfo;
var returnType = methodInfo?.ReturnType ?? VoidType;
var parameters = mb.GetParameters();
Type[] array;
if (mb.IsStatic)
{
array = new Type[parameters.Length];
for (var i = 0; i < parameters.Length; i++)
{
array[i] = parameters[i].ParameterType;
}
}
else
{
array = new Type[parameters.Length + 1];
var type = mb.DeclaringType;
if (type.IsValueType)
{
type = type.MakeByRefType();
mayVirtual = false;
}
array[0] = type;
for (var j = 0; j < parameters.Length; j++)
{
array[j + 1] = parameters[j].ParameterType;
}
}
/*if (_alwaysFalse)
{
dynamicMethod = new DynamicMethod(string.Empty, returnType, array, true);
}
if (dynamicMethod == null)*/
{
dynamicMethod = new DynamicMethod(string.Empty, returnType, array, GetTypeById(_methodHeader.ClassId), true);
}
var iLGenerator = dynamicMethod.GetILGenerator();
for (var k = 0; k < array.Length; k++)
{
iLGenerator.Emit(OpCodes.Ldarg, k);
}
var constructorInfo = mb as ConstructorInfo;
if (constructorInfo != null)
{
iLGenerator.Emit(mayVirtual ? OpCodes.Callvirt : OpCodes.Call, constructorInfo);
}
else
{
iLGenerator.Emit(mayVirtual ? OpCodes.Callvirt : OpCodes.Call, (MethodInfo)mb);
}
iLGenerator.Emit(OpCodes.Ret);
DynamicMethods.Add(mb, dynamicMethod);
result = dynamicMethod;
}
}
return result;
}
// Token: 0x060001F7 RID: 503 RVA: 0x0000B9EC File Offset: 0x00009BEC
private void Ldelem_i4_(VariantBase dummy) // \u000E\u2007
{
Ldelem(typeof(int));
}
// Token: 0x060001FD RID: 509 RVA: 0x0000BD88 File Offset: 0x00009F88
private void Invoke(int pos, Type[] methodGenericArgs, Type[] classGenericArgs, bool mayVirtual) // \u0002
{
_srcVirtualizedStreamReader.BaseStream.Seek(pos, SeekOrigin.Begin);
DoNothing(_srcVirtualizedStreamReader);
var u0006 = ReadMethodHeader(_srcVirtualizedStreamReader);
var num = u0006.ArgsTypeToOutput.Length;
var array = new object[num];
var array2 = new VariantBase[num];
if (_currentClass != null & mayVirtual)
{
var num2 = u0006.IsStatic() ? 0 : 1;
var array3 = new Type[num - num2];
for (var i = num - 1; i >= num2; i--)
{
array3[i] = GetTypeById(u0006.ArgsTypeToOutput[i].TypeId);
}
var method = _currentClass.GetMethod(u0006.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.GetProperty | BindingFlags.SetProperty, null, array3, null);
_currentClass = null;
if (method != null)
{
GenerateDynamicCall(method, true);
return;
}
}
for (var j = num - 1; j >= 0; j--)
{
var u000F = PopVariant();
array2[j] = u000F;
if (u000F.IsAddr())
{
u000F = FetchByAddr(u000F);
}
if (u000F.GetVariantType() != null)
{
u000F = VariantFactory.Convert(null, u000F.GetVariantType()).CopyFrom(u000F);
}
var u000F2 = VariantFactory.Convert(null, GetTypeById(u0006.ArgsTypeToOutput[j].TypeId)).CopyFrom(u000F);
array[j] = u000F2.GetValueAbstract();
if (j == 0 & mayVirtual && !u0006.IsStatic() && array[j] == null)
{
throw new NullReferenceException();
}
}
var executor = new VmExecutor(_instrCodesDb);
var callees = new object[]
{
_module.Assembly
};
object obj;
try
{
obj = executor.Invoke(_srcVirtualizedStream, pos, array, methodGenericArgs, classGenericArgs, callees);
}
finally
{
for (var k = 0; k < array2.Length; k++)
{
var u000F3 = array2[k];
if (u000F3.IsAddr())
{
var obj2 = array[k];
AssignByReference(u000F3, VariantFactory.Convert(obj2, null));
}
}
}
var type = executor.GetTypeById(executor._methodHeader.ReturnTypeId);
if (type != VoidType)
{
PushVariant(VariantFactory.Convert(obj, type));
}
}
// Token: 0x06000202 RID: 514 RVA: 0x0000C150 File Offset: 0x0000A350
public static object CreateValueTypeInstance(Type t) // \u0002
{
if (t.IsValueType)
{
return Activator.CreateInstance(t);
}
return null;
}
// Token: 0x0600020B RID: 523 RVA: 0x0000C51C File Offset: 0x0000A71C
private void Ldc_r4_(VariantBase val) // \u0003\u200B\u2000
{
PushVariant(val);
}
// Token: 0x0600020D RID: 525 RVA: 0x0000C550 File Offset: 0x0000A750
private void Stelem(Type t) // \u0003
{
var obj = PopVariant().GetValueAbstract();
var idx = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
Stelem(t, obj, idx, array);
}
// Token: 0x06000210 RID: 528 RVA: 0x0000C5C4 File Offset: 0x0000A7C4
private void Ldvirtftn_(VariantBase vMethodId) // \u0003\u200A
{
var methodBase = FindMethodById(((IntVariant)vMethodId).GetValue());
var declaringType = methodBase.DeclaringType;
var type = PopVariant().GetValueAbstract().GetType();
var parameters = methodBase.GetParameters();
var paramTypes = new Type[parameters.Length];
for (var i = 0; i < parameters.Length; i++)
{
paramTypes[i] = parameters[i].ParameterType;
}
while (type != null && type != declaringType)
{
var method = type.GetMethod(methodBase.Name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetProperty | BindingFlags.SetProperty | BindingFlags.ExactBinding, null, CallingConventions.Any, paramTypes, null);
if (method != null && method.GetBaseDefinition() == methodBase)
{
methodBase = method;
break;
}
type = type.BaseType;
}
var push = new MethodVariant();
push.SetValue(methodBase);
PushVariant(push);
}
// Token: 0x06000213 RID: 531 RVA: 0x0000C750 File Offset: 0x0000A950
private void Ldind_u4_(VariantBase dummy) // \u000E\u2002\u2001
{
Ldind(typeof(uint));
}
// Token: 0x06000218 RID: 536 RVA: 0x0000C810 File Offset: 0x0000AA10
private void Ldind_i2_(VariantBase dummy) // \u0003\u2002\u2001
{
Ldind(typeof(short));
}
// Token: 0x0600021A RID: 538 RVA: 0x0000C830 File Offset: 0x0000AA30
private void Ldind_u2_(VariantBase dummy) // \u000F\u2001\u2001
{
Ldind(typeof(ushort));
}
// Token: 0x0600021B RID: 539 RVA: 0x0000C844 File Offset: 0x0000AA44
private void Break_(VariantBase dummy) // \u0005\u2002
{
Debugger.Break();
}
// Token: 0x0600021D RID: 541 RVA: 0x0000C878 File Offset: 0x0000AA78
private void Ldc_i4_m1_(VariantBase dummy) // \u0002\u2005
{
var iv = new IntVariant();
iv.SetValue(-1);
PushVariant(iv);
}
// Token: 0x0600021E RID: 542 RVA: 0x0000C88C File Offset: 0x0000AA8C
private void ExecuteNextInstruction() // \u0002\u2000
{
try
{
TryExecuteNextInstruction();
}
catch (Exception ex)
{
OnException(ex, 0u);
}
}
// Token: 0x06000220 RID: 544 RVA: 0x0000F07C File Offset: 0x0000D27C
private void OnException(object ex, uint pos) // \u0002
{
_wasException = ex != null;
_exception = ex;
if (_wasException)
{
_ehStack.Clear();
}
if (!_wasException)
{
_ehStack.PushBack(new ExcHandlerFrame { Pos = pos });
}
foreach (var catchBlock in _catchBlocks)
{
if (PosInRange(_myBufferPos, catchBlock.Start, catchBlock.Len))
{
switch (catchBlock.Kind)
{
case 0:
if (_wasException)
{
var type = ex.GetType();
var type2 = GetTypeById(catchBlock.ExcTypeId);
if (type == type2 || type.IsSubclassOf(type2))
{
_ehStack.PushBack(new ExcHandlerFrame
{
Pos = catchBlock.Pos,
Exception = ex
});
_wasException = false;
}
}
break;
case 1:
if (_wasException)
{
_ehStack.PushBack(new ExcHandlerFrame { Pos = catchBlock.Pos });
}
break;
case 2:
if (_wasException || !PosInRange((long)(ulong)pos, catchBlock.Start, catchBlock.Len))
{
_ehStack.PushBack(new ExcHandlerFrame { Pos = catchBlock.Pos });
}
break;
case 4:
if (_wasException)
{
_ehStack.PushBack(new ExcHandlerFrame
{
Pos = catchBlock.PosKind4,
Exception = ex
});
}
break;
}
}
}
ExecuteExceptionHandler();
}
// Token: 0x06000221 RID: 545 RVA: 0x0000F210 File Offset: 0x0000D410
private void Stloc_0_(VariantBase dummy) // \u0008\u2003
{
PopToLocal(0);
}
// Token: 0x06000222 RID: 546 RVA: 0x0000F21C File Offset: 0x0000D41C
private void Ldind_ref_(VariantBase dummy) // \u0003\u2003\u2001
{
Ldind(SimpleTypeHelper.ObjectType);
}
// Token: 0x06000223 RID: 547 RVA: 0x0000F22C File Offset: 0x0000D42C
private void Stind_r4_(VariantBase dummy) // \u0006\u2006
{
Stind();
}
// Token: 0x06000224 RID: 548 RVA: 0x0000F234 File Offset: 0x0000D434
private void Newarr_(VariantBase vTypeId) // \u0002\u2001\u2001
{
var vLength = PopVariant();
var ivLength = vLength as IntVariant;
int length;
if (ivLength != null)
{
length = ivLength.GetValue();
}
else
{
var ipvLength = vLength as IntPtrVariant;
if (ipvLength != null)
{
length = ipvLength.GetValue().ToInt32();
}
else
{
var uipvLength = vLength as UIntPtrVariant;
if (uipvLength == null)
{
throw new Exception();
}
length = (int)uipvLength.GetValue().ToUInt32();
}
}
var array = Array.CreateInstance(GetTypeById(((IntVariant)vTypeId).GetValue()), length);
var push = new ArrayVariant();
push.SetValue(array);
PushVariant(push);
}
// Token: 0x06000226 RID: 550 RVA: 0x0000F308 File Offset: 0x0000D508
private bool RefToMdArrayItem(MethodBase mb, object array, ref object result, object[] oidxs) // \u0003
{
if (!mb.IsStatic && mb.Name == StringDecryptor.GetString(-1550345964) /* Address */)
{
var methodInfo = mb as MethodInfo;
if (methodInfo != null)
{
var type = methodInfo.ReturnType;
if (type.IsByRef)
{
type = type.GetElementType();
var num = oidxs.Length;
if (num >= 1 && oidxs[0] is int)
{
var idxs = new int[num];
for (var i = 0; i < num; i++)
{
idxs[i] = (int)oidxs[i];
}
var val = new MdArrayValueVariant();
val.SetArray((Array)array);
val.SetIndexes(idxs);
val.SetHeldType(type);
result = val;
return true;
}
}
}
}
return false;
}
// Token: 0x0600022C RID: 556 RVA: 0x0000F86C File Offset: 0x0000DA6C
private void Stelem_r4_(VariantBase dummy) // \u0005\u200A
{
Stelem(typeof(float));
}
// Token: 0x0600022E RID: 558 RVA: 0x0000F8AC File Offset: 0x0000DAAC
private void Ldarg_2_(VariantBase dummy) // \u0006\u2003
{
PushVariant(_variantOutputArgs[2].Clone());
}
// Token: 0x06000230 RID: 560 RVA: 0x0000F8DC File Offset: 0x0000DADC
private void Not_(VariantBase dummy) // \u0008\u2002\u2001
{
PushVariant(Not(PopVariant()));
}
// Token: 0x06000232 RID: 562 RVA: 0x0000F914 File Offset: 0x0000DB14
private void Ldind_i1_(VariantBase dummy) // \u000F\u2005\u2000
{
Ldind(typeof(sbyte));
}
// Token: 0x06000233 RID: 563 RVA: 0x0000F928 File Offset: 0x0000DB28
private void Stloc_2_(VariantBase dummy) // \u000F\u2009
{
PopToLocal(2);
}
// Token: 0x06000235 RID: 565 RVA: 0x0000F96C File Offset: 0x0000DB6C
private void Stloc_1_(VariantBase dummy) // \u000E\u2009\u2000
{
PopToLocal(1);
}
// Token: 0x06000236 RID: 566 RVA: 0x0000F978 File Offset: 0x0000DB78
private void Pop_(VariantBase dummy) // \u0003
{
PopVariant();
}
// Token: 0x0600023A RID: 570 RVA: 0x0000F9D4 File Offset: 0x0000DBD4
private void Ldc_r8_(VariantBase val) // \u0005\u200B\u2000
{
PushVariant(val);
}
// Token: 0x0600023F RID: 575 RVA: 0x0000FDF4 File Offset: 0x0000DFF4
private void Ldelem_r4_(VariantBase dummy) // \u0008\u200B
{
Ldelem(typeof(float));
}
// Token: 0x06000240 RID: 576 RVA: 0x0000FE08 File Offset: 0x0000E008
private void UnlockInterlockedIfAny(ref BoolHolder wasLocked) // \u0002
{
if (wasLocked.Val)
{
Monitor.Exit(InterlockedLock);
}
}
// Token: 0x06000241 RID: 577 RVA: 0x0000FE1C File Offset: 0x0000E01C
private void Ldarg_0_(VariantBase dummy) // \u0003\u2007
{
PushVariant(_variantOutputArgs[0].Clone());
}
// Token: 0x06000245 RID: 581 RVA: 0x00010198 File Offset: 0x0000E398
private VariantBase Not(VariantBase val) // \u0005
{
switch (val.GetTypeCode())
{
case VariantBase.Vtc.Tc19Int:
var iv = new IntVariant();
iv.SetValue(~((IntVariant)val).GetValue());
return iv;
case VariantBase.Vtc.Tc24Long:
var lv = new LongVariant();
lv.SetValue(~((LongVariant)val).GetValue());
return lv;
case VariantBase.Vtc.Tc5Enum:
var underlyingType = Enum.GetUnderlyingType(val.GetValueAbstract().GetType());
if (underlyingType == typeof(ulong))
{
var ret = new UlongVariant();
ret.SetValue(~Convert.ToUInt64(val.GetValueAbstract()));
return ret;
}
if (underlyingType == typeof(long))
{
var ret = new LongVariant();
ret.SetValue(~Convert.ToInt64(val.GetValueAbstract()));
return ret;
}
if (underlyingType == typeof(uint))
{
var ret = new UintVariant();
ret.SetValue(~Convert.ToUInt32(val.GetValueAbstract()));
return ret;
}
var result = new IntVariant();
result.SetValue(~Convert.ToInt32(val.GetValueAbstract()));
return result;
case VariantBase.Vtc.Tc21Double:
if (IntPtr.Size == 4)
{
var ret = new DoubleVariant();
ret.SetValue(double.NaN);
return ret;
}
break;
case VariantBase.Vtc.Tc8Float:
if (IntPtr.Size == 4)
{
var ret = new FloatVariant();
ret.SetValue(float.NaN);
return ret;
}
break;
case VariantBase.Vtc.Tc18Object:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Not);
gen.Emit(OpCodes.Ret);
var oret = new IntPtrVariant();
((IntPtrVariant)oret).SetValue(((IntPtr)dyn.Invoke(null, new[] { val.GetValueAbstract() })));
return oret;
}
throw new InvalidProgramException();
}
// Token: 0x06000246 RID: 582 RVA: 0x0001025C File Offset: 0x0000E45C
private void Ldind_i8_(VariantBase dummy) // \u0005\u2006
{
Ldind(typeof(long));
}
// Token: 0x06000247 RID: 583 RVA: 0x00010270 File Offset: 0x0000E470
private void Clt_(VariantBase dummy) // \u0002\u2004\u2001
{
var v2 = PopVariant();
var v1 = PopVariant();
var push = new IntVariant();
push.SetValue(UniCompare(v1, v2, ComparisonKind.LT, false) ? 1 : 0);
PushVariant(push);
}
// Token: 0x06000249 RID: 585 RVA: 0x00010348 File Offset: 0x0000E548
private void Nop_(VariantBase dummy) // \u0005\u2005
{
}
// Token: 0x0600024B RID: 587 RVA: 0x00010498 File Offset: 0x0000E698
private void TryExecuteNextInstruction() // \u000E
{
var key = _myBufferReader.ReadInt32();
VmInstr instr;
if (!_vmInstrDb.TryGetValue(key, out instr))
{
throw new InvalidOperationException(StringDecryptor.GetString(-1550345644) /* Unsupported instruction. */);
}
instr.Func(ReadOperand(_myBufferReader, instr.Id.OperandType));
_myBufferPos = _myBufferReader.GetBuffer().GetPos();
}
// Token: 0x0600024E RID: 590 RVA: 0x000105B4 File Offset: 0x0000E7B4
private void Stelem_i1_(VariantBase dummy) // \u0002\u2003
{
var obj = PopVariant().GetValueAbstract();
var idx = PopLong();
var array = (Array)PopVariant().GetValueAbstract();
var elementType = array.GetType().GetElementType();
checked
{
if (elementType == typeof(sbyte))
{
((sbyte[])array)[(int)(IntPtr)idx] = (sbyte)VariantFactory.Convert(obj, typeof(sbyte)).GetValueAbstract();
return;
}
if (elementType == typeof(byte))
{
((byte[])array)[(int)(IntPtr)idx] = (byte)VariantFactory.Convert(obj, typeof(byte)).GetValueAbstract();
return;
}
if (elementType == typeof(bool))
{
((bool[])array)[(int)(IntPtr)idx] = (bool)VariantFactory.Convert(obj, typeof(bool)).GetValueAbstract();
return;
}
if (elementType.IsEnum)
{
Stelem(elementType, obj, idx, array);
return;
}
Stelem(typeof(sbyte), obj, idx, array);
}
}
// Token: 0x0600024F RID: 591 RVA: 0x000106B8 File Offset: 0x0000E8B8
private void Starg_s_(VariantBase vidx) // \u000E\u2007\u2000
{
var idx = (ByteVariant)vidx;
_variantOutputArgs[idx.GetValue()].CopyFrom(PopVariant());
}
// Token: 0x06000251 RID: 593 RVA: 0x00010748 File Offset: 0x0000E948
private void Ldlen_(VariantBase dummy) // \u000E\u200B\u2000
{
var array = (Array)PopVariant().GetValueAbstract();
var len = new IntVariant();
len.SetValue(array.Length);
PushVariant(len);
}
// Token: 0x06000256 RID: 598 RVA: 0x00010948 File Offset: 0x0000EB48
private void Ldelem_i2_(VariantBase dummy) // \u0008\u2000
{
Ldelem(typeof(short));
}
// Token: 0x06000257 RID: 599 RVA: 0x0001095C File Offset: 0x0000EB5C
private void Ldarg_(VariantBase vidx) // \u000E\u2000\u2000
{
var idx = (UshortVariant)vidx;
PushVariant(_variantOutputArgs[idx.GetValue()].Clone());
}
// Token: 0x06000258 RID: 600 RVA: 0x0001098C File Offset: 0x0000EB8C
private void Clt_un_(VariantBase dummy) // \u0003\u2000\u2001
{
var v2 = PopVariant();
var v1 = PopVariant();
var push = new IntVariant();
push.SetValue(UniCompare(v1, v2, ComparisonKind.LT, true) ? 1 : 0);
PushVariant(push);
}
// Token: 0x06000259 RID: 601 RVA: 0x000109C8 File Offset: 0x0000EBC8
private void Dup_(VariantBase dummy) // \u0002\u2006\u2000
{
var v = PopVariant();
PushVariant(v);
PushVariant(v.Clone());
}
// Token: 0x0600025A RID: 602 RVA: 0x000109F4 File Offset: 0x0000EBF4
[Conditional("DEBUG")]
private void DoNothing(object dummy) // \u0002
{
}
// Token: 0x0600025B RID: 603 RVA: 0x000109F8 File Offset: 0x0000EBF8
private VariantBase[] ArgsToVariantOutputArgs(object[] args) // u0002
{
var methodHeaderArgsTypeToOutput = _methodHeader.ArgsTypeToOutput;
var num = methodHeaderArgsTypeToOutput.Length;
var retArgs = new VariantBase[num];
for (var i = 0; i < num; i++)
{
var obj = args[i];
var type = GetTypeById(methodHeaderArgsTypeToOutput[i].TypeId);
var type2 = ElementedTypeHelper.TryGoToPointerOrReferenceElementType(type);
Type type3;
if (type2 == SimpleTypeHelper.ObjectType || SimpleTypeHelper.IsNullableGeneric(type2))
{
type3 = type;
}
else
{
type3 = obj?.GetType() ?? type;
}
if (obj != null && !type.IsAssignableFrom(type3) && type.IsByRef && !type.GetElementType().IsAssignableFrom(type3))
{
throw new ArgumentException(string.Format(StringDecryptor.GetString(-1550345390) /* Object of type {0} cannot be converted to type {1}. */, type3, type));
}
retArgs[i] = VariantFactory.Convert(obj, type3);
}
if (!_methodHeader.IsStatic() && GetTypeById(_methodHeader.ClassId).IsValueType)
{
var expr_EB = new VariantBaseHolder();
expr_EB.SetValue(retArgs[0]);
retArgs[0] = expr_EB;
}
for (var j = 0; j < num; j++)
{
if (methodHeaderArgsTypeToOutput[j].IsOutput)
{
var expr_116 = new VariantBaseHolder();
expr_116.SetValue(retArgs[j]);
retArgs[j] = expr_116;
}
}
return retArgs;
}
// Token: 0x0600025D RID: 605 RVA: 0x00010B3C File Offset: 0x0000ED3C
private void Stind() // \u0003
{
var v2 = PopVariant();
var v1 = PopVariant();
AssignByReference(v1, v2);
}
// Token: 0x0600025E RID: 606 RVA: 0x00010B60 File Offset: 0x0000ED60
private void Endfinally_(VariantBase dummy) // \u0005\u2000\u2001
{
ExecuteExceptionHandler();
}
// Token: 0x0600025F RID: 607 RVA: 0x00010B68 File Offset: 0x0000ED68
private bool PosInRange(long pos, uint start, uint len) // \u0002
{
return pos >= (long)(ulong)start && pos <= (long)(ulong)(start + len);
}
// Token: 0x06000260 RID: 608 RVA: 0x00010B7C File Offset: 0x0000ED7C
private bool IsCompatible(MethodBase mb) // \u0002
{
return mb.IsVirtual && GetTypeById(_methodHeader.ClassId).IsSubclassOf(mb.DeclaringType);
}
// Token: 0x06000263 RID: 611 RVA: 0x00010C00 File Offset: 0x0000EE00
private void Stelem_(VariantBase vTypeId) // \u0006\u2004\u2000
{
Stelem(GetTypeById(((IntVariant)vTypeId).GetValue()));
}
// Token: 0x06000265 RID: 613 RVA: 0x00010C40 File Offset: 0x0000EE40
private void Ldelem_u1_(VariantBase dummy) // \u0006\u2004
{
Ldelem(typeof(byte));
}
// Token: 0x06000267 RID: 615 RVA: 0x00010C80 File Offset: 0x0000EE80
private void Cgt_(VariantBase dummy) // \u0005\u2001\u2000
{
var v2 = PopVariant();
var v1 = PopVariant();
var push = new IntVariant();
push.SetValue(UniCompare(v1, v2, ComparisonKind.GT, false) ? 1 : 0);
PushVariant(push);
}
private VariantBase And(VariantBase org_v1, VariantBase org_v2)
{
VariantBase v1, v2;
var tc = CommonType(org_v1, org_v2, out v1, out v2, true);
VariantBase ret;
switch (tc)
{
case VariantBase.Vtc.Tc9Uint:
uint uv1 = ((UintVariant)v1).GetValue(), uv2 = ((UintVariant)v2).GetValue();
var uvret = new UintVariant();
ret = uvret;
uvret.SetValue(uv1 & uv2);
break;
case VariantBase.Vtc.Tc19Int:
int iv1 = ((IntVariant)v1).GetValue(), iv2 = ((IntVariant)v2).GetValue();
var ivret = new IntVariant();
ret = ivret;
ivret.SetValue(iv1 & iv2);
break;
case VariantBase.Vtc.Tc21Double:
{
/*double dv1 = ((DoubleVariant)v1).GetValue(), dv2 = ((DoubleVariant)v2).GetValue(); // естественный алгоритм
long lv1 = (dv1 < 0) ? (long)dv1 : (long)(ulong)dv1;
long lv2 = (dv2 < 0) ? (long)dv2 : (long)(ulong)dv2;
var dvret = new DoubleVariant();
ret = dvret;
var l64 = (ulong) lv1 & (ulong) lv2;
if (l64 >> 32 == UInt32.MaxValue) l64 &= UInt32.MaxValue;
dvret.SetValue(l64);*/
var dvret = new DoubleVariant();
ret = dvret;
dvret.SetValue((4 == IntPtr.Size) ? Double.NaN : (double)0); // иногда у фреймворка бывает мусор, но чаще эти значения...
}
break;
case VariantBase.Vtc.Tc8Float:
{
/*float fv1 = ((FloatVariant) v1).GetValue(), fv2 = ((FloatVariant) v2).GetValue(); // естественный алгоритм
long lv1 = (fv1 < 0) ? (long)fv1 : (long)(ulong)fv1;
long lv2 = (fv2 < 0) ? (long)fv2 : (long)(ulong)fv2;
var fvret = new FloatVariant();
ret = fvret;
var l64 = (ulong)lv1 & (ulong)lv2;
if (l64 >> 32 == UInt32.MaxValue) l64 &= UInt32.MaxValue;
fvret.SetValue(l64);*/
var fvret = new FloatVariant();
ret = fvret;
fvret.SetValue((4 == IntPtr.Size) ? float.NaN : (float)0.0); // иногда у фреймворка бывает мусор, но чаще эти значения...
}
break;
case VariantBase.Vtc.Tc24Long:
{
long lv1 = ((LongVariant)v1).GetValue(), lv2 = ((LongVariant)v2).GetValue();
var lvret = new LongVariant();
ret = lvret;
lvret.SetValue(lv1 & lv2);
}
break;
case VariantBase.Vtc.Tc7Ulong:
ulong ulv1 = ((UlongVariant)v1).GetValue(), ulv2 = ((UlongVariant)v2).GetValue();
var ulvret = new UlongVariant();
ret = ulvret;
ulvret.SetValue(ulv1 & ulv2);
break;
default:
// это нужно будет заменить на соотв. msil-код
var dyn = new DynamicMethod(String.Empty, typeof(IntPtr), new[] { typeof(object), typeof(object) }, typeof(void), true);
var gen = dyn.GetILGenerator();
gen.Emit(OpCodes.Ldarg_1);
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.And);
gen.Emit(OpCodes.Ret);
ret = new IntPtrVariant();
((IntPtrVariant)ret).SetValue(((IntPtr)dyn.Invoke(null, new[] { org_v1.GetValueAbstract(), org_v2.GetValueAbstract() })));
break;
}
return ret;
}
// Token: 0x0600026E RID: 622 RVA: 0x000110D8 File Offset: 0x0000F2D8
private void Ldind(Type t) // \u0005
{
PushVariant(VariantFactory.Convert(FetchByAddr(PopVariant()).GetValueAbstract(), t));
}
// Token: 0x0600026F RID: 623 RVA: 0x00011104 File Offset: 0x0000F304
private void Starg_(VariantBase vidx) // \u000F\u2008\u2000
{
var idx = (UshortVariant)vidx;
_variantOutputArgs[idx.GetValue()].CopyFrom(PopVariant());
}
// Token: 0x06000270 RID: 624 RVA: 0x00011138 File Offset: 0x0000F338
private void Ret() // \u0008
{
_retFound = true;
}
// Token: 0x06000273 RID: 627 RVA: 0x00011480 File Offset: 0x0000F680
private void Stind_r8_(VariantBase dummy) // \u0005\u2004\u2000
{
Stind();
}
// Token: 0x06000275 RID: 629 RVA: 0x00011510 File Offset: 0x0000F710
private void Rethrow_(VariantBase dummy) // \u0003\u200A\u2000
{
if (_exception == null)
{
throw new InvalidOperationException();
}
_myBufferPos = _myBufferReader.GetBuffer().GetPos();
ThrowStoreCrossDomain(_exception);
}
// Token: 0x06000278 RID: 632 RVA: 0x00011838 File Offset: 0x0000FA38
private void Ldelem_u4_(VariantBase dummy) // \u0003\u2003
{
Ldelem(typeof(uint));
}
// Token: 0x0600027A RID: 634 RVA: 0x00011994 File Offset: 0x0000FB94
private void Invoke(VmMethodRefTokenInfo mref) // \u0002
{
//var arg_18_0 = (U0008U2007)U0003U2008.Get_u0005();
var methodBase = FindMethodById(mref.Pos, ReadToken(mref.Pos));
//methodBase.GetParameters();
var pos = mref.Flags;
var mayVirtual = (pos & 1073741824) != 0;
pos &= -1073741825;
var methodGenericArgs = _methodGenericArgs;
var classGenericArgs = _classGenericArgs;
try
{
_methodGenericArgs = methodBase is ConstructorInfo ? Type.EmptyTypes : methodBase.GetGenericArguments();
_classGenericArgs = methodBase.DeclaringType.GetGenericArguments();
Invoke(pos, _methodGenericArgs, _classGenericArgs, mayVirtual);
}
finally
{
_methodGenericArgs = methodGenericArgs;
_classGenericArgs = classGenericArgs;
}
}
// Token: 0x0600027B RID: 635 RVA: 0x00011A5C File Offset: 0x0000FC5C
private void Ldc_i8_(VariantBase val) // \u0006\u2007\u2000
{
PushVariant(val);
}
// Token: 0x0600027E RID: 638 RVA: 0x00011CB8 File Offset: 0x0000FEB8
private void Ldelem_r8_(VariantBase dummy) // \u000E\u2002\u2000
{
Ldelem(typeof(double));
}
// Token: 0x06000280 RID: 640 RVA: 0x00011DB4 File Offset: 0x0000FFB4
private void Stloc_3_(VariantBase dummy) // \u0003\u2004\u2000
{
PopToLocal(3);
}
// Token: 0x06000281 RID: 641 RVA: 0x00011DC0 File Offset: 0x0000FFC0
private void Ckfinite_(VariantBase dummy) // \u000F\u2003
{
var v = PopVariant();
if (v.GetTypeCode() == VariantBase.Vtc.Tc5Enum)
{
v = VariantBase.SignedVariantFromEnum((EnumVariant)v);
}
double val = double.NaN;
bool con = v.GetValueAbstract() is IConvertible;
if (con)
{
val = Convert.ToDouble(v.GetValueAbstract());
if (double.IsNaN(val) || double.IsInfinity(val))
{
throw new OverflowException(StringDecryptor.GetString(-1550347095) /* The value is not finite real number. */);
}
}
if (IsFloating(v))
{
PushVariant(v);
} else
{
var push = new DoubleVariant();
push.SetValue(val);
PushVariant(push);
}
}
// Token: 0x06000288 RID: 648 RVA: 0x00012170 File Offset: 0x00010370
private void Stind_ref_(VariantBase dummy) // \u0002\u2008
{
Stind();
}
// Token: 0x06000289 RID: 649 RVA: 0x00012178 File Offset: 0x00010378
private void PopToLocal(int idx) // \u0002
{
var pop = PopVariant();
if (pop is ReferenceVariantBase)
{
_localVariables[idx] = pop;
return;
}
_localVariables[idx].CopyFrom(pop);
}
// Token: 0x0600028B RID: 651 RVA: 0x00012260 File Offset: 0x00010460
private void Ldobj_(VariantBase vTypeId) // \u000E\u2008
{
var type = GetTypeById(((IntVariant)vTypeId).GetValue());
Ldind(type);
}
// Token: 0x0600028C RID: 652 RVA: 0x00012288 File Offset: 0x00010488
private void Ldloc_1_(VariantBase dummy) // \u0003\u2008\u2000
{
PushVariant(_localVariables[1].Clone());
}
// Token: 0x0600028E RID: 654 RVA: 0x00012348 File Offset: 0x00010548
private void Ldelem_i1_(VariantBase dummy) // \u0005\u2009\u2000
{
Ldelem(typeof(sbyte));
}
// Token: 0x06000290 RID: 656 RVA: 0x00012370 File Offset: 0x00010570
private void JumpToPos(uint val) // \u0002
{
_storedPos = val;
}
// Token: 0x06000291 RID: 657 RVA: 0x00012380 File Offset: 0x00010580
public void VoidInvoke(Stream virtualizedStream, string pos, object[] args) // \u0002
{
Invoke(virtualizedStream, pos, args);
}
// Token: 0x06000295 RID: 661 RVA: 0x00012420 File Offset: 0x00010620
private void _u0002u2002u2001(VariantBase dummy) // \u0002\u2002\u2001
{
}
// Token: 0x06000298 RID: 664 RVA: 0x00012590 File Offset: 0x00010790
private void LoopUntilRet() // \u0005\u2000
{
var usedSize = _myBufferReader.GetBuffer().UsedSize();
while (!_retFound)
{
if (_storedPos.HasValue)
{
_myBufferReader.GetBuffer().SetPos((long)(ulong)_storedPos.Value);
_storedPos = null;
}
ExecuteNextInstruction();
if (_myBufferReader.GetBuffer().GetPos() >= usedSize && !_storedPos.HasValue)
{
break;
}
}
}
// Token: 0x06000299 RID: 665 RVA: 0x00012614 File Offset: 0x00010814
private VmInstrInfo GetInstrById(int id) // \u0002
{
return _instrCodesDb.MyFieldsEnumerator().FirstOrDefault(current => current.Id == id);
}
// Token: 0x0600029A RID: 666 RVA: 0x00012670 File Offset: 0x00010870
private void Ldloc_(VariantBase val) // \u000F\u200A\u2000
{
PushVariant(_localVariables[((UshortVariant)val).GetValue()].Clone());
}
// Token: 0x0600029E RID: 670 RVA: 0x00012718 File Offset: 0x00010918
private bool Isinst(VariantBase obj, Type t) // \u0002
{
if (obj.GetValueAbstract() == null)
{
return true;
}
var type = obj.GetVariantType() ?? obj.GetValueAbstract().GetType();
if (type == t || t.IsAssignableFrom(type))
{
return true;
}
if (!type.IsValueType && !t.IsValueType && Marshal.IsComObject(obj.GetValueAbstract()))
{
IntPtr intPtr;
try
{
intPtr = Marshal.GetComInterfaceForObject(obj.GetValueAbstract(), t);
}
catch (InvalidCastException)
{
intPtr = IntPtr.Zero;
}
if (intPtr != IntPtr.Zero)
{
try
{
Marshal.Release(intPtr);
}
catch
{
}
return true;
}
}
return false;
}
// Token: 0x0600029F RID: 671 RVA: 0x000127C4 File Offset: 0x000109C4
private void Ldind_r8_(VariantBase dummy) // \u000E\u2008\u2000
{
Ldind(typeof(double));
}
// Token: 0x060002A1 RID: 673 RVA: 0x00012870 File Offset: 0x00010A70
private void Stobj_(VariantBase dummy) // \u0005\u2009
{
Stind();
}
// Token: 0x060002A4 RID: 676 RVA: 0x00012A44 File Offset: 0x00010C44
private void Cgt_un_(VariantBase dummy) // \u0006\u2002
{
var v2 = PopVariant();
var v1 = PopVariant();
var push = new IntVariant();
push.SetValue(UniCompare(v1, v2, ComparisonKind.GT, true) ? 1 : 0);
PushVariant(push);
}
// Token: 0x060002A7 RID: 679 RVA: 0x00012CDC File Offset: 0x00010EDC
private bool AreCompatible(Type t1, UniversalTokenInfo ut2) // \u0002
{
var t2 = (VmClassTokenInfo)ut2.VmToken;
if (ElementedTypeHelper.TryGoToElementType(t1).IsGenericParameter)
{
return t2 == null || t2.IsOuterClassGeneric;
}
return TypeCompatibility.Check(t1, GetTypeById(ut2.MetadataToken));
}
// Token: 0x060002A9 RID: 681 RVA: 0x00012D38 File Offset: 0x00010F38
private void Ldloca_(VariantBase vLocIdx) // \u0006\u2005
{
var push = new LocalsIdxHolderVariant();
push.SetValue(((UshortVariant)vLocIdx).GetValue());
PushVariant(push);
}
// Token: 0x060002AA RID: 682 RVA: 0x00012D64 File Offset: 0x00010F64
private void Ldarg_3_(VariantBase dummy) // \u000E\u2009
{
PushVariant(_variantOutputArgs[3].Clone());
}
// Token: 0x060002AC RID: 684 RVA: 0x00012DB8 File Offset: 0x00010FB8
/*[Conditional("DEBUG")]
public static void DoNothing(string dummy) // \u0002
{
}*/
// Token: 0x0600021F RID: 543 RVA: 0x0000C8BC File Offset: 0x0000AABC
private Dictionary<int, VmInstr> CreateVmInstrDb() // \u0002
{
return new Dictionary<int, VmInstr>(256)
{
{
_instrCodesDb.Conv_ovf_i4_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i4_un_, Conv_ovf_i4_un_)
},
{
_instrCodesDb.Shr_un_.Id,
new VmInstr(_instrCodesDb.Shr_un_, Shr_un_)
},
{
_instrCodesDb.Conv_i_.Id,
new VmInstr(_instrCodesDb.Conv_i_, Conv_i_)
},
{
_instrCodesDb.Conv_ovf_i_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i_un_, Conv_ovf_i_un_)
},
{
_instrCodesDb.Stelem_i_.Id,
new VmInstr(_instrCodesDb.Stelem_i_, Stelem_i_)
},
{
_instrCodesDb.Starg_s_.Id,
new VmInstr(_instrCodesDb.Starg_s_, Starg_s_)
},
{
_instrCodesDb.Sizeof_.Id,
new VmInstr(_instrCodesDb.Sizeof_, Sizeof_)
},
{
_instrCodesDb.Ldarg_s_.Id,
new VmInstr(_instrCodesDb.Ldarg_s_, Ldarg_s_)
},
{
_instrCodesDb.Stelem_i4_.Id,
new VmInstr(_instrCodesDb.Stelem_i4_, Stelem_i4_)
},
{
_instrCodesDb.Calli_.Id,
new VmInstr(_instrCodesDb.Calli_, Calli_)
},
{
_instrCodesDb.Ldc_i4_7_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_7_, Ldc_i4_7_)
},
{
_instrCodesDb.Newobj_.Id,
new VmInstr(_instrCodesDb.Newobj_, Newobj_)
},
{
_instrCodesDb.Ldind_u4_.Id,
new VmInstr(_instrCodesDb.Ldind_u4_, Ldind_u4_)
},
{
_instrCodesDb.Cgt_un_.Id,
new VmInstr(_instrCodesDb.Cgt_un_, Cgt_un_)
},
{
_instrCodesDb.Conv_u1_.Id,
new VmInstr(_instrCodesDb.Conv_u1_, Conv_u1_)
},
{
_instrCodesDb.Ldelem_ref_.Id,
new VmInstr(_instrCodesDb.Ldelem_ref_, Ldelem_ref_)
},
{
_instrCodesDb.U0006U2008U2000.Id,
new VmInstr(_instrCodesDb.U0006U2008U2000, _u0002u2002u2001)
},
{
_instrCodesDb.Newarr_.Id,
new VmInstr(_instrCodesDb.Newarr_, Newarr_)
},
{
_instrCodesDb.Ldarga_s_.Id,
new VmInstr(_instrCodesDb.Ldarga_s_, Ldarga_s_)
},
{
_instrCodesDb.Bgt_.Id,
new VmInstr(_instrCodesDb.Bgt_, Bgt_)
},
{
_instrCodesDb.Ldflda_.Id,
new VmInstr(_instrCodesDb.Ldflda_, Ldflda_)
},
{
_instrCodesDb.Sub_.Id,
new VmInstr(_instrCodesDb.Sub_, Sub_)
},
{
_instrCodesDb.Endfilter_.Id,
new VmInstr(_instrCodesDb.Endfilter_, Endfilter_)
},
{
_instrCodesDb.Conv_ovf_u_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u_un_, Conv_ovf_u_un_)
},
{
_instrCodesDb.Ldc_i4_1_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_1_, Ldc_i4_1_)
},
{
_instrCodesDb.Conv_ovf_i_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i_, Conv_ovf_i_)
},
{
_instrCodesDb.Add_ovf_.Id,
new VmInstr(_instrCodesDb.Add_ovf_, Add_ovf_)
},
{
_instrCodesDb.Ldftn_.Id,
new VmInstr(_instrCodesDb.Ldftn_, Ldftn_)
},
{
_instrCodesDb.Stfld_.Id,
new VmInstr(_instrCodesDb.Stfld_, Stfld_)
},
{
_instrCodesDb.Ldc_i4_5_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_5_, Ldc_i4_5_)
},
{
_instrCodesDb.Xor_.Id,
new VmInstr(_instrCodesDb.Xor_, Xor_)
},
{
_instrCodesDb.Conv_u2_.Id,
new VmInstr(_instrCodesDb.Conv_u2_, Conv_u2_)
},
{
_instrCodesDb.Div_un_.Id,
new VmInstr(_instrCodesDb.Div_un_, Div_un_)
},
{
_instrCodesDb.Stloc_3_.Id,
new VmInstr(_instrCodesDb.Stloc_3_, Stloc_3_)
},
{
_instrCodesDb.Ret_.Id,
new VmInstr(_instrCodesDb.Ret_, Ret_)
},
{
_instrCodesDb.Ldc_i4_m1_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_m1_, Ldc_i4_m1_)
},
{
_instrCodesDb.Ldarg_1_.Id,
new VmInstr(_instrCodesDb.Ldarg_1_, Ldarg_1_)
},
{
_instrCodesDb.Div_.Id,
new VmInstr(_instrCodesDb.Div_, Div_)
},
{
_instrCodesDb.Ldnull_.Id,
new VmInstr(_instrCodesDb.Ldnull_, Ldnull_)
},
{
_instrCodesDb.Break_.Id,
new VmInstr(_instrCodesDb.Break_, Break_)
},
{
_instrCodesDb.Cgt_.Id,
new VmInstr(_instrCodesDb.Cgt_, Cgt_)
},
{
_instrCodesDb.Arglist_.Id,
new VmInstr(_instrCodesDb.Arglist_, Arglist_)
},
{
_instrCodesDb.Ldloc_.Id,
new VmInstr(_instrCodesDb.Ldloc_, Ldloc_)
},
{
_instrCodesDb.Conv_u_.Id,
new VmInstr(_instrCodesDb.Conv_u_, Conv_u_)
},
{
_instrCodesDb.Ldelem_i_.Id,
new VmInstr(_instrCodesDb.Ldelem_i_, Ldelem_i_)
},
{
_instrCodesDb.Conv_ovf_i1_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i1_un_, Conv_ovf_i1_un_)
},
{
_instrCodesDb.Cpblk_.Id,
new VmInstr(_instrCodesDb.Cpblk_, Cpblk_)
},
{
_instrCodesDb.Add_.Id,
new VmInstr(_instrCodesDb.Add_, Add_)
},
{
_instrCodesDb.Initblk_.Id,
new VmInstr(_instrCodesDb.Initblk_, Initblk_)
},
{
_instrCodesDb.Ldind_i_.Id,
new VmInstr(_instrCodesDb.Ldind_i_, Ldind_i_)
},
{
_instrCodesDb.Ldelem_u4_.Id,
new VmInstr(_instrCodesDb.Ldelem_u4_, Ldelem_u4_)
},
{
_instrCodesDb.Stind_ref_.Id,
new VmInstr(_instrCodesDb.Stind_ref_, Stind_ref_)
},
{
_instrCodesDb.Ldelem_i1_.Id,
new VmInstr(_instrCodesDb.Ldelem_i1_, Ldelem_i1_)
},
{
_instrCodesDb.Ldloc_3_.Id,
new VmInstr(_instrCodesDb.Ldloc_3_, Ldloc_3_)
},
{
_instrCodesDb.Stind_i8_.Id,
new VmInstr(_instrCodesDb.Stind_i8_, Stind_i8_)
},
{
_instrCodesDb.Conv_i1_.Id,
new VmInstr(_instrCodesDb.Conv_i1_, Conv_i1_)
},
{
_instrCodesDb.Ldelem_.Id,
new VmInstr(_instrCodesDb.Ldelem_, Ldelem_)
},
{
_instrCodesDb.Clt_un_.Id,
new VmInstr(_instrCodesDb.Clt_un_, Clt_un_)
},
{
_instrCodesDb.Ldelem_i4_.Id,
new VmInstr(_instrCodesDb.Ldelem_i4_, Ldelem_i4_)
},
{
_instrCodesDb.Mkrefany_.Id,
new VmInstr(_instrCodesDb.Mkrefany_, Mkrefany_)
},
{
_instrCodesDb.Neg_.Id,
new VmInstr(_instrCodesDb.Neg_, Neg_)
},
{
_instrCodesDb.Leave_.Id,
new VmInstr(_instrCodesDb.Leave_, Leave_)
},
{
_instrCodesDb.Ldc_i4_2_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_2_, Ldc_i4_2_)
},
{
_instrCodesDb.Conv_ovf_i2_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i2_, Conv_ovf_i2_)
},
{
_instrCodesDb.Ldloc_2_.Id,
new VmInstr(_instrCodesDb.Ldloc_2_, Ldloc_2_)
},
{
_instrCodesDb.Bgt_un_.Id,
new VmInstr(_instrCodesDb.Bgt_un_, Bgt_un_)
},
{
_instrCodesDb.Stsfld_.Id,
new VmInstr(_instrCodesDb.Stsfld_, Stsfld_)
},
/*{
_instrCodesDb.Nop_.Id,
new VmInstr(_instrCodesDb.Nop_, u000Fu2004)
},*/
{
_instrCodesDb.Shr_.Id,
new VmInstr(_instrCodesDb.Shr_, Shr_)
},
{
_instrCodesDb.Ldind_ref_.Id,
new VmInstr(_instrCodesDb.Ldind_ref_, Ldind_ref_)
},
{
_instrCodesDb.Ldfld_.Id,
new VmInstr(_instrCodesDb.Ldfld_, Ldfld_)
},
{
_instrCodesDb.Ldlen_.Id,
new VmInstr(_instrCodesDb.Ldlen_, Ldlen_)
},
{
_instrCodesDb.Stelem_ref_.Id,
new VmInstr(_instrCodesDb.Stelem_ref_, Stelem_ref_)
},
{
_instrCodesDb.Ceq_.Id,
new VmInstr(_instrCodesDb.Ceq_, Ceq_)
},
{
_instrCodesDb.Conv_ovf_u2_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u2_, Conv_ovf_u2_)
},
{
_instrCodesDb.Add_ovf_un_.Id,
new VmInstr(_instrCodesDb.Add_ovf_un_, Add_ovf_un_)
},
{
_instrCodesDb.Conv_ovf_i8_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i8_, Conv_ovf_i8_)
},
{
_instrCodesDb.Stind_i2_.Id,
new VmInstr(_instrCodesDb.Stind_i2_, Stind_i2_)
},
{
_instrCodesDb.Stelem_i1_.Id,
new VmInstr(_instrCodesDb.Stelem_i1_, Stelem_i1_)
},
{
_instrCodesDb.Ldloca_.Id,
new VmInstr(_instrCodesDb.Ldloca_, Ldloca_)
},
{
_instrCodesDb.Stind_r4_.Id,
new VmInstr(_instrCodesDb.Stind_r4_, Stind_r4_)
},
{
_instrCodesDb.Stloc_s_.Id,
new VmInstr(_instrCodesDb.Stloc_s_, Stloc_s_)
},
{
_instrCodesDb.Refanyval_.Id,
new VmInstr(_instrCodesDb.Refanyval_, Refanyval_)
},
{
_instrCodesDb.Clt_.Id,
new VmInstr(_instrCodesDb.Clt_, Clt_)
},
{
_instrCodesDb.Stelem_r4_.Id,
new VmInstr(_instrCodesDb.Stelem_r4_, Stelem_r4_)
},
{
_instrCodesDb.Stelem_r8_.Id,
new VmInstr(_instrCodesDb.Stelem_r8_, Stelem_r8_)
},
{
_instrCodesDb.Conv_u4_.Id,
new VmInstr(_instrCodesDb.Conv_u4_, Conv_u4_)
},
{
_instrCodesDb.Ldc_i8_.Id,
new VmInstr(_instrCodesDb.Ldc_i8_, Ldc_i8_)
},
{
_instrCodesDb.Ldind_r4_.Id,
new VmInstr(_instrCodesDb.Ldind_r4_, Ldind_r4_)
},
{
_instrCodesDb.Conv_r_un_.Id,
new VmInstr(_instrCodesDb.Conv_r_un_, Conv_r_un_)
},
{
_instrCodesDb.Ldtoken_.Id,
new VmInstr(_instrCodesDb.Ldtoken_, Ldtoken_)
},
{
_instrCodesDb.Blt_un_.Id,
new VmInstr(_instrCodesDb.Blt_un_, Blt_un_)
},
{
_instrCodesDb.Brtrue_.Id,
new VmInstr(_instrCodesDb.Brtrue_, Brtrue_)
},
{
_instrCodesDb.Switch_.Id,
new VmInstr(_instrCodesDb.Switch_, Switch_)
},
{
_instrCodesDb.Refanytype_.Id,
new VmInstr(_instrCodesDb.Refanytype_, Refanytype_)
},
{
_instrCodesDb.Stobj_.Id,
new VmInstr(_instrCodesDb.Stobj_, Stobj_)
},
{
_instrCodesDb.Ble_un_.Id,
new VmInstr(_instrCodesDb.Ble_un_, Ble_un_)
},
{
_instrCodesDb.Conv_ovf_i8_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i8_un_, Conv_ovf_i8_un_)
},
{
_instrCodesDb.Conv_ovf_u4_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u4_un_, Conv_ovf_u4_un_)
},
{
_instrCodesDb.Ldind_i8_.Id,
new VmInstr(_instrCodesDb.Ldind_i8_, Ldind_i8_)
},
{
_instrCodesDb.U000EU2006U2000.Id,
new VmInstr(_instrCodesDb.U000EU2006U2000, Invoke)
},
{
_instrCodesDb.Endfinally_.Id,
new VmInstr(_instrCodesDb.Endfinally_, Endfinally_)
},
{
_instrCodesDb.Conv_ovf_u8_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u8_un_, Conv_ovf_u8_un_)
},
{
_instrCodesDb.Ldelem_i2_.Id,
new VmInstr(_instrCodesDb.Ldelem_i2_, Ldelem_i2_)
},
{
_instrCodesDb.Ldc_i4_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_, Ldc_i4_)
},
{
_instrCodesDb.U000FU2001.Id,
new VmInstr(_instrCodesDb.U000FU2001, _u0006u2003u2001)
},
{
_instrCodesDb.Conv_i4_.Id,
new VmInstr(_instrCodesDb.Conv_i4_, Conv_i4_)
},
{
_instrCodesDb.Ldind_u1_.Id,
new VmInstr(_instrCodesDb.Ldind_u1_, Ldind_u1_)
},
{
_instrCodesDb.Rethrow_.Id,
new VmInstr(_instrCodesDb.Rethrow_, Rethrow_)
},
{
_instrCodesDb.Conv_ovf_i1_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i1_, Conv_ovf_i1_)
},
{
_instrCodesDb.Box_.Id,
new VmInstr(_instrCodesDb.Box_, Box_)
},
{
_instrCodesDb.Localloc_.Id,
new VmInstr(_instrCodesDb.Localloc_, Localloc_)
},
{
_instrCodesDb.Ldelem_r8_.Id,
new VmInstr(_instrCodesDb.Ldelem_r8_, Ldelem_r8_)
},
{
_instrCodesDb.Throw_.Id,
new VmInstr(_instrCodesDb.Throw_, Throw_)
},
{
_instrCodesDb.Ldvirtftn_.Id,
new VmInstr(_instrCodesDb.Ldvirtftn_, Ldvirtftn_)
},
{
_instrCodesDb.Mul_ovf_un_.Id,
new VmInstr(_instrCodesDb.Mul_ovf_un_, Mul_ovf_un_)
},
{
_instrCodesDb.Conv_ovf_i4_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i4_, Conv_ovf_i4_)
},
{
_instrCodesDb.Ldloc_0_.Id,
new VmInstr(_instrCodesDb.Ldloc_0_, Ldloc_0_)
},
{
_instrCodesDb.Starg_.Id,
new VmInstr(_instrCodesDb.Starg_, Starg_)
},
{
_instrCodesDb.Stind_i1_.Id,
new VmInstr(_instrCodesDb.Stind_i1_, Stind_i1_)
},
{
_instrCodesDb.Ldind_i2_.Id,
new VmInstr(_instrCodesDb.Ldind_i2_, Ldind_i2_)
},
{
_instrCodesDb.And_.Id,
new VmInstr(_instrCodesDb.And_, And_)
},
{
_instrCodesDb.Ldc_i4_6_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_6_, Ldc_i4_6_)
},
{
_instrCodesDb.Nop_.Id,
new VmInstr(_instrCodesDb.Nop_, Nop_)
},
{
_instrCodesDb.Ldind_i4_.Id,
new VmInstr(_instrCodesDb.Ldind_i4_, Ldind_i4_)
},
{
_instrCodesDb.Dup_.Id,
new VmInstr(_instrCodesDb.Dup_, Dup_)
},
{
_instrCodesDb.Mul_.Id,
new VmInstr(_instrCodesDb.Mul_, Mul_)
},
{
_instrCodesDb.Stloc_2_.Id,
new VmInstr(_instrCodesDb.Stloc_2_, Stloc_2_)
},
{
_instrCodesDb.Or_.Id,
new VmInstr(_instrCodesDb.Or_, Or_)
},
{
_instrCodesDb.Conv_u8_.Id,
new VmInstr(_instrCodesDb.Conv_u8_, Conv_u8_)
},
{
_instrCodesDb.Conv_ovf_u1_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u1_, Conv_ovf_u1_)
},
{
_instrCodesDb.Sub_ovf_.Id,
new VmInstr(_instrCodesDb.Sub_ovf_, Sub_ovf_)
},
{
_instrCodesDb.Conv_ovf_u1_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u1_un_, Conv_ovf_u1_un_)
},
{
_instrCodesDb.Ldelem_r4_.Id,
new VmInstr(_instrCodesDb.Ldelem_r4_, Ldelem_r4_)
},
{
_instrCodesDb.Conv_r8_.Id,
new VmInstr(_instrCodesDb.Conv_r8_, Conv_r8_)
},
{
_instrCodesDb.Stloc_0_.Id,
new VmInstr(_instrCodesDb.Stloc_0_, Stloc_0_)
},
{
_instrCodesDb.Conv_ovf_u8_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u8_, Conv_ovf_u8_)
},
{
_instrCodesDb.Brfalse_.Id,
new VmInstr(_instrCodesDb.Brfalse_, Brfalse_)
},
{
_instrCodesDb.Ldarg_3_.Id,
new VmInstr(_instrCodesDb.Ldarg_3_, Ldarg_3_)
},
{
_instrCodesDb.Ldarg_.Id,
new VmInstr(_instrCodesDb.Ldarg_, Ldarg_)
},
{
_instrCodesDb.Ldc_r4_.Id,
new VmInstr(_instrCodesDb.Ldc_r4_, Ldc_r4_)
},
{
_instrCodesDb.Initobj_.Id,
new VmInstr(_instrCodesDb.Initobj_, Initobj_)
},
{
_instrCodesDb.Stloc_.Id,
new VmInstr(_instrCodesDb.Stloc_, Stloc_)
},
{
_instrCodesDb.Stind_i4_.Id,
new VmInstr(_instrCodesDb.Stind_i4_, Stind_i4_)
},
{
_instrCodesDb.Callvirt_.Id,
new VmInstr(_instrCodesDb.Callvirt_, Callvirt_)
},
{
_instrCodesDb.Stelem_i2_.Id,
new VmInstr(_instrCodesDb.Stelem_i2_, Stelem_i2_)
},
{
_instrCodesDb.Conv_ovf_u_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u_, Conv_ovf_u_)
},
{
_instrCodesDb.Cpobj_.Id,
new VmInstr(_instrCodesDb.Cpobj_, Cpobj_)
},
{
_instrCodesDb.Rem_.Id,
new VmInstr(_instrCodesDb.Rem_, Rem_)
},
{
_instrCodesDb.Stind_r8_.Id,
new VmInstr(_instrCodesDb.Stind_r8_, Stind_r8_)
},
{
_instrCodesDb.Stloc_1_.Id,
new VmInstr(_instrCodesDb.Stloc_1_, Stloc_1_)
},
{
_instrCodesDb.Conv_ovf_u4_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u4_, Conv_ovf_u4_)
},
{
_instrCodesDb.Ldc_i4_0_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_0_, Ldc_i4_0_)
},
{
_instrCodesDb.Stind_i_.Id,
new VmInstr(_instrCodesDb.Stind_i_, Stind_i_)
},
{
_instrCodesDb.Stelem_i8_.Id,
new VmInstr(_instrCodesDb.Stelem_i8_, Stelem_i8_)
},
{
_instrCodesDb.Ldelema_.Id,
new VmInstr(_instrCodesDb.Ldelema_, Ldelema_)
},
{
_instrCodesDb.Ldsflda_.Id,
new VmInstr(_instrCodesDb.Ldsflda_, Ldsflda_)
},
{
_instrCodesDb.Ldsfld_.Id,
new VmInstr(_instrCodesDb.Ldsfld_, Ldsfld_)
},
{
_instrCodesDb.Isinst_.Id,
new VmInstr(_instrCodesDb.Isinst_, Isinst_)
},
{
_instrCodesDb.Conv_i2_.Id,
new VmInstr(_instrCodesDb.Conv_i2_, Conv_i2_)
},
{
_instrCodesDb.Stelem_.Id,
new VmInstr(_instrCodesDb.Stelem_, Stelem_)
},
{
_instrCodesDb.Ldind_r8_.Id,
new VmInstr(_instrCodesDb.Ldind_r8_, Ldind_r8_)
},
{
_instrCodesDb.Ldc_r8_.Id,
new VmInstr(_instrCodesDb.Ldc_r8_, Ldc_r8_)
},
{
_instrCodesDb.Bge_.Id,
new VmInstr(_instrCodesDb.Bge_, Bge_)
},
{
_instrCodesDb.Ldind_i1_.Id,
new VmInstr(_instrCodesDb.Ldind_i1_, Ldind_i1_)
},
{
_instrCodesDb.Ldelem_u1_.Id,
new VmInstr(_instrCodesDb.Ldelem_u1_, Ldelem_u1_)
},
{
_instrCodesDb.Ldstr_.Id,
new VmInstr(_instrCodesDb.Ldstr_, Ldstr_)
},
{
_instrCodesDb.Ldloca_s_.Id,
new VmInstr(_instrCodesDb.Ldloca_s_, Ldloca_s_)
},
{
_instrCodesDb.Ldelem_i8_.Id,
new VmInstr(_instrCodesDb.Ldelem_i8_, Ldelem_i8_)
},
{
_instrCodesDb.Ldc_i4_8_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_8_, Ldc_i4_8_)
},
{
_instrCodesDb.Blt_.Id,
new VmInstr(_instrCodesDb.Blt_, Blt_)
},
{
_instrCodesDb.Unbox_.Id,
new VmInstr(_instrCodesDb.Unbox_, Unbox_)
},
{
_instrCodesDb.Bge_un_.Id,
new VmInstr(_instrCodesDb.Bge_un_, Bge_un_)
},
{
_instrCodesDb.Ldelem_u2_.Id,
new VmInstr(_instrCodesDb.Ldelem_u2_, Ldelem_u2_)
},
{
_instrCodesDb.Ldind_u2_.Id,
new VmInstr(_instrCodesDb.Ldind_u2_, Ldind_u2_)
},
{
_instrCodesDb.Sub_ovf_un_.Id,
new VmInstr(_instrCodesDb.Sub_ovf_un_, Sub_ovf_un_)
},
{
_instrCodesDb.Ldc_i4_4_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_4_, Ldc_i4_4_)
},
{
_instrCodesDb.Ldarg_0_.Id,
new VmInstr(_instrCodesDb.Ldarg_0_, Ldarg_0_)
},
{
_instrCodesDb.Rem_un_.Id,
new VmInstr(_instrCodesDb.Rem_un_, Rem_un_)
},
{
_instrCodesDb.Ldloc_1_.Id,
new VmInstr(_instrCodesDb.Ldloc_1_, Ldloc_1_)
},
{
_instrCodesDb.Bne_un_.Id,
new VmInstr(_instrCodesDb.Bne_un_, Bne_un_)
},
{
_instrCodesDb.Conv_ovf_i2_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_i2_un_, Conv_ovf_i2_un_)
},
{
_instrCodesDb.Ckfinite_.Id,
new VmInstr(_instrCodesDb.Ckfinite_, Ckfinite_)
},
{
_instrCodesDb.Ldobj_.Id,
new VmInstr(_instrCodesDb.Ldobj_, Ldobj_)
},
{
_instrCodesDb.Pop_.Id,
new VmInstr(_instrCodesDb.Pop_, Pop_)
},
{
_instrCodesDb.Constrained_.Id,
new VmInstr(_instrCodesDb.Constrained_, Constrained_)
},
{
_instrCodesDb.Ldc_i4_s_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_s_, Ldc_i4_s_)
},
{
_instrCodesDb.Ldloc_s_.Id,
new VmInstr(_instrCodesDb.Ldloc_s_, Ldloc_s_)
},
{
_instrCodesDb.Ldarg_2_.Id,
new VmInstr(_instrCodesDb.Ldarg_2_, Ldarg_2_)
},
{
_instrCodesDb.Ldarga_.Id,
new VmInstr(_instrCodesDb.Ldarga_, Ldarga_)
},
{
_instrCodesDb.Conv_i8_.Id,
new VmInstr(_instrCodesDb.Conv_i8_, Conv_i8_)
},
{
_instrCodesDb.Br_.Id,
new VmInstr(_instrCodesDb.Br_, Br_)
},
{
_instrCodesDb.Ldc_i4_3_.Id,
new VmInstr(_instrCodesDb.Ldc_i4_3_, Ldc_i4_3_)
},
{
_instrCodesDb.Mul_ovf_.Id,
new VmInstr(_instrCodesDb.Mul_ovf_, Mul_ovf_)
},
{
_instrCodesDb.Shl_.Id,
new VmInstr(_instrCodesDb.Shl_, Shl_)
},
{
_instrCodesDb.Castclass_.Id,
new VmInstr(_instrCodesDb.Castclass_, Castclass_)
},
{
_instrCodesDb.Jmp_.Id,
new VmInstr(_instrCodesDb.Jmp_, Jmp_)
},
{
_instrCodesDb.Beq_.Id,
new VmInstr(_instrCodesDb.Beq_, Beq_)
},
{
_instrCodesDb.Conv_r4_.Id,
new VmInstr(_instrCodesDb.Conv_r4_, Conv_r4_)
},
{
_instrCodesDb.Ble_.Id,
new VmInstr(_instrCodesDb.Ble_, Ble_)
},
{
_instrCodesDb.Conv_ovf_u2_un_.Id,
new VmInstr(_instrCodesDb.Conv_ovf_u2_un_, Conv_ovf_u2_un_)
},
{
_instrCodesDb.Call_.Id,
new VmInstr(_instrCodesDb.Call_, Call_)
},
{
_instrCodesDb.Not_.Id,
new VmInstr(_instrCodesDb.Not_, Not_)
}
};
}
}
// Token: 0x02000042 RID: 66
public sealed class LocalVarType // \u0008
{
// Token: 0x060002E4 RID: 740 RVA: 0x00013F08 File Offset: 0x00012108
// Token: 0x060002E5 RID: 741 RVA: 0x00013F10 File Offset: 0x00012110
// Token: 0x04000171 RID: 369
public int TypeId /* \u0002 */ { get; set; }
}
// Token: 0x0200004D RID: 77
public sealed class ArgTypeToOutput // \u000E
{
// Token: 0x06000321 RID: 801 RVA: 0x00014C74 File Offset: 0x00012E74
// Token: 0x06000322 RID: 802 RVA: 0x00014C7C File Offset: 0x00012E7C
// Token: 0x0400017C RID: 380
public int TypeId /* \u0002 */ { get; set; }
// Token: 0x06000323 RID: 803 RVA: 0x00014C88 File Offset: 0x00012E88
// Token: 0x06000324 RID: 804 RVA: 0x00014C90 File Offset: 0x00012E90
// Token: 0x0400017D RID: 381
public bool IsOutput /* \u0003 */ { get; set; }
}
// Token: 0x0200005E RID: 94
internal sealed class CatchBlock
{
// Token: 0x0600036B RID: 875 RVA: 0x00015AFC File Offset: 0x00013CFC
// Token: 0x0600036C RID: 876 RVA: 0x00015B04 File Offset: 0x00013D04
// Token: 0x04000189 RID: 393
public byte Kind { get; set; }
// Token: 0x0600036D RID: 877 RVA: 0x00015B10 File Offset: 0x00013D10
// Token: 0x0600036E RID: 878 RVA: 0x00015B18 File Offset: 0x00013D18
// Token: 0x0400018A RID: 394
public int ExcTypeId { get; set; }
// Token: 0x0600036F RID: 879 RVA: 0x00015B24 File Offset: 0x00013D24
// Token: 0x06000370 RID: 880 RVA: 0x00015B2C File Offset: 0x00013D2C
// Token: 0x0400018B RID: 395
public uint PosKind4 { get; set; }
// Token: 0x06000371 RID: 881 RVA: 0x00015B38 File Offset: 0x00013D38
// Token: 0x06000372 RID: 882 RVA: 0x00015B40 File Offset: 0x00013D40
// Token: 0x0400018C RID: 396
public uint Start { get; set; }
// Token: 0x06000373 RID: 883 RVA: 0x00015B4C File Offset: 0x00013D4C
// Token: 0x06000374 RID: 884 RVA: 0x00015B54 File Offset: 0x00013D54
// Token: 0x0400018D RID: 397
public uint Pos { get; set; } // \u0005
// Token: 0x06000375 RID: 885 RVA: 0x00015B60 File Offset: 0x00013D60
// Token: 0x06000376 RID: 886 RVA: 0x00015B68 File Offset: 0x00013D68
// Token: 0x0400018E RID: 398
public uint Len { get; set; }
}
// Token: 0x02000049 RID: 73
internal abstract class VmTokenInfo // \u0008\u2006
{
internal enum Kind : byte
{
Class0, Field1, Method2, String3, MethodRef4
}
// Token: 0x0600030D RID: 781
public abstract Kind TokenKind(); // \u0008\u2006\u2008\u2000\u2002\u200A\u0002
}
// Token: 0x02000017 RID: 23
internal sealed class UniversalTokenInfo // \u0003\u2008
{
// Token: 0x06000097 RID: 151 RVA: 0x00003E9C File Offset: 0x0000209C
// Token: 0x06000098 RID: 152 RVA: 0x00003EA4 File Offset: 0x000020A4
// Token: 0x04000020 RID: 32
public byte IsVm { get; set; }
// Token: 0x06000099 RID: 153 RVA: 0x00003EB0 File Offset: 0x000020B0
// Token: 0x0600009A RID: 154 RVA: 0x00003EB8 File Offset: 0x000020B8
// Token: 0x04000021 RID: 33
public int MetadataToken { get; set; }
// Token: 0x0600009B RID: 155 RVA: 0x00003EC4 File Offset: 0x000020C4
// Token: 0x0600009C RID: 156 RVA: 0x00003ECC File Offset: 0x000020CC
// Token: 0x04000022 RID: 34
public VmTokenInfo VmToken { get; set; }
}
// Token: 0x02000016 RID: 22
internal sealed class VmMethodRefTokenInfo : VmTokenInfo // \u0003\u2007
{
// Token: 0x06000091 RID: 145 RVA: 0x00003E68 File Offset: 0x00002068
// Token: 0x06000092 RID: 146 RVA: 0x00003E70 File Offset: 0x00002070
// Token: 0x0400001E RID: 30
public int Flags { get; set; }
// Token: 0x06000093 RID: 147 RVA: 0x00003E7C File Offset: 0x0000207C
// Token: 0x06000094 RID: 148 RVA: 0x00003E84 File Offset: 0x00002084
// Token: 0x0400001F RID: 31
public int Pos { get; set; }
// Token: 0x06000095 RID: 149 RVA: 0x00003E90 File Offset: 0x00002090
public override Kind TokenKind() // \u0008\u2006\u2008\u2000\u2002\u200A\u0002
{
return Kind.MethodRef4;
}
}
// Token: 0x0200004A RID: 74
internal sealed class VmMethodTokenInfo : VmTokenInfo // \u0008\u2007
{
// Token: 0x0600030F RID: 783 RVA: 0x00014BB0 File Offset: 0x00012DB0
// Token: 0x06000310 RID: 784 RVA: 0x00014BB8 File Offset: 0x00012DB8
// Token: 0x04000176 RID: 374
public byte Flags { get; set; }
// Token: 0x06000311 RID: 785 RVA: 0x00014BC4 File Offset: 0x00012DC4
public bool IsStatic() // \u0002
{
return (Flags & 2) > 0;
}
// Token: 0x06000312 RID: 786 RVA: 0x00014BD4 File Offset: 0x00012DD4
public bool IsGeneric() // \u0003
{
return (Flags & 1) > 0;
}
// Token: 0x06000313 RID: 787 RVA: 0x00014BE4 File Offset: 0x00012DE4
// Token: 0x06000314 RID: 788 RVA: 0x00014BEC File Offset: 0x00012DEC
// Token: 0x04000177 RID: 375
public UniversalTokenInfo Class { get; set; }
// Token: 0x06000315 RID: 789 RVA: 0x00014BF8 File Offset: 0x00012DF8
// Token: 0x06000316 RID: 790 RVA: 0x00014C00 File Offset: 0x00012E00
// Token: 0x04000178 RID: 376
public string Name { get; set; }
// Token: 0x06000317 RID: 791 RVA: 0x00014C0C File Offset: 0x00012E0C
// Token: 0x06000318 RID: 792 RVA: 0x00014C14 File Offset: 0x00012E14
// Token: 0x04000179 RID: 377
public UniversalTokenInfo[] Parameters { get; set; }
// Token: 0x06000319 RID: 793 RVA: 0x00014C20 File Offset: 0x00012E20
// Token: 0x0600031A RID: 794 RVA: 0x00014C28 File Offset: 0x00012E28
// Token: 0x0400017A RID: 378
public UniversalTokenInfo[] GenericArguments { get; set; }
// Token: 0x0600031B RID: 795 RVA: 0x00014C34 File Offset: 0x00012E34
// Token: 0x0600031C RID: 796 RVA: 0x00014C3C File Offset: 0x00012E3C
// Token: 0x0400017B RID: 379
public UniversalTokenInfo ReturnType { get; set; }
// Token: 0x0600031D RID: 797 RVA: 0x00014C48 File Offset: 0x00012E48
public override Kind TokenKind() // \u0008\u2006\u2008\u2000\u2002\u200A\u0002
{
return Kind.Method2;
}
}
// Token: 0x02000056 RID: 86
internal sealed class VmStringTokenInfo : VmTokenInfo // \u000E\u2007
{
// Token: 0x06000343 RID: 835 RVA: 0x000153CC File Offset: 0x000135CC
// Token: 0x06000344 RID: 836 RVA: 0x000153D4 File Offset: 0x000135D4
// Token: 0x04000185 RID: 389
public string Value { get; set; }
// Token: 0x06000345 RID: 837 RVA: 0x000153E0 File Offset: 0x000135E0
public override Kind TokenKind() // \u0008\u2006\u2008\u2000\u2002\u200A\u0002
{
return Kind.String3;
}
}
// Token: 0x02000060 RID: 96
internal sealed class VmFieldTokenInfo : VmTokenInfo // \u000F\u2006
{
// Token: 0x06000382 RID: 898 RVA: 0x00015C38 File Offset: 0x00013E38
// Token: 0x06000383 RID: 899 RVA: 0x00015C40 File Offset: 0x00013E40
// Token: 0x04000191 RID: 401
public UniversalTokenInfo Class { get; set; }
// Token: 0x06000384 RID: 900 RVA: 0x00015C4C File Offset: 0x00013E4C
// Token: 0x06000385 RID: 901 RVA: 0x00015C54 File Offset: 0x00013E54
// Token: 0x04000192 RID: 402
public string Name { get; set; }
// Token: 0x06000386 RID: 902 RVA: 0x00015C60 File Offset: 0x00013E60
// Token: 0x06000387 RID: 903 RVA: 0x00015C68 File Offset: 0x00013E68
// Token: 0x04000193 RID: 403
public bool IsStatic { get; set; }
// Token: 0x06000388 RID: 904 RVA: 0x00015C74 File Offset: 0x00013E74
public override Kind TokenKind() // \u0008\u2006\u2008\u2000\u2002\u200A\u0002
{
return Kind.Field1;
}
}
// Token: 0x02000061 RID: 97
internal sealed class VmClassTokenInfo : VmTokenInfo // \u000F\u2007
{
// Token: 0x04000194 RID: 404
// Token: 0x0600038A RID: 906 RVA: 0x00015C90 File Offset: 0x00013E90
// Token: 0x0600038B RID: 907 RVA: 0x00015C98 File Offset: 0x00013E98
public string ClassName { get; set; }
// Token: 0x0600038C RID: 908 RVA: 0x00015CA4 File Offset: 0x00013EA4
// Token: 0x04000195 RID: 405
// Token: 0x0600038D RID: 909 RVA: 0x00015CAC File Offset: 0x00013EAC
public bool IsOuterClassGeneric { get; set; }
// Token: 0x0600038E RID: 910 RVA: 0x00015CB8 File Offset: 0x00013EB8
// Token: 0x04000196 RID: 406
// Token: 0x0600038F RID: 911 RVA: 0x00015CC0 File Offset: 0x00013EC0
public bool IsGeneric { get; set; }
// Token: 0x06000390 RID: 912 RVA: 0x00015CCC File Offset: 0x00013ECC
// Token: 0x04000197 RID: 407
// Token: 0x06000391 RID: 913 RVA: 0x00015CD4 File Offset: 0x00013ED4
public UniversalTokenInfo[] GenericArguments { get; set; }
// Token: 0x06000392 RID: 914 RVA: 0x00015CE0 File Offset: 0x00013EE0
// Token: 0x04000198 RID: 408
// Token: 0x06000393 RID: 915 RVA: 0x00015CE8 File Offset: 0x00013EE8
public int OuterClassGenericClassIdx { get; set; } = -1;
// Token: 0x06000394 RID: 916 RVA: 0x00015CF4 File Offset: 0x00013EF4
// Token: 0x04000199 RID: 409
// Token: 0x06000395 RID: 917 RVA: 0x00015CFC File Offset: 0x00013EFC
public int OuterClassGenericMethodIdx { get; set; } = -1;
// Token: 0x06000396 RID: 918 RVA: 0x00015D08 File Offset: 0x00013F08
public override Kind TokenKind() // \u0008\u2006\u2008\u2000\u2002\u200A\u0002
{
return Kind.Class0;
}
}
}
|