-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparsers.js
More file actions
1306 lines (1266 loc) · 47.3 KB
/
parsers.js
File metadata and controls
1306 lines (1266 loc) · 47.3 KB
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
var Parser = require('binary-parser').Parser;
const ConstantClassInfo = Parser.start().uint16be("name_index");
const ConstantFieldrefInfo = Parser.start()
.uint16be("class_index")
.uint16be("name_and_type_index");
const ConstantMethodrefInfo = Parser.start()
.uint16be("class_index")
.uint16be("name_and_type_index");
const ConstantInterfaceMethodrefInfo = Parser.start()
.uint16be("class_index")
.uint16be("name_and_type_index");
const ConstantStringInfo = Parser.start().uint16be("string_index");
const ConstantIntegerInfo = Parser.start().uint32be("bytes");
const ConstantFloatInfo = Parser.start().uint32be("bytes");
const ConstantLongInfo = Parser.start()
.uint32be("high_bytes")
.uint32be("low_bytes");
const ConstantDoubleInfo = Parser.start()
.uint32be("high_bytes")
.uint32be("low_bytes");
const ConstantNameAndTypeInfo = Parser.start()
.uint16be("name_index")
.uint16be("descriptor_index");
const ConstantUtf8Info = Parser.start()
.uint16be("len")
.string("bytes", { length: "len" });
// @ts-ignore
const ConstantMethodHandleInfo = Parser.start()
.uint8("reference_kind")
.uint16be("reference_index");
const ConstantMethodTypeInfo = Parser.start().uint16be("descriptor_index");
const ConstantInvokeDynamicInfo = Parser.start()
.uint16be("bootstrap_method_attr_index")
.uint16be("name_and_type_index");
const CpInfo = Parser.start()
.uint8("tag")
.choice("info", {
tag: "tag",
choices: {
7: ConstantClassInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.1
9: ConstantFieldrefInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2
10: ConstantMethodrefInfo,
11: ConstantInterfaceMethodrefInfo,
8: ConstantStringInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.3
3: ConstantIntegerInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.4
4: ConstantFloatInfo,
5: ConstantLongInfo, //https://docs.oracle.com/javase/specs/jvms/se22/html/jvms-4.html#jvms-4.4.5 //2 byte
6: ConstantDoubleInfo,
12: ConstantNameAndTypeInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.6
1: ConstantUtf8Info, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.7,
15: ConstantMethodHandleInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.8,
16: ConstantMethodTypeInfo, //https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.9
18: ConstantInvokeDynamicInfo,
},
});
const VerificationTypeInfo = Parser.start()
.uint8("tag")
.choice("info", {
tag: "tag",
choices: {
0: Parser.start(), // Top_variable_info
1: Parser.start(), // Integer_variable_info
2: Parser.start(), // Float_variable_info
4: Parser.start(), // Long_variable_info
3: Parser.start(), // Double_variable_info
5: Parser.start(), // Null_variable_info
6: Parser.start(), // UninitializedThis_variable_info
7: Parser.start().uint16be("cpool_index"), // Object_variable_info
8: Parser.start().uint16be("offset"), // Uninitialized_variable_info
},
});
const LineNumberTableAttribute = Parser.start()
.uint16be("line_number_table_length")
.array("line_number_table", {
type: Parser.start().uint16be("start_pc").uint16be("line_number"),
length: "line_number_table_length",
});
const ConstantValueAttribute = Parser.start().uint16be("constantvalue_index");
const StackMapFrame = Parser.start()
.uint8("frame_type")
.nest("info", {
type: Parser.start().choice("data", {
tag: function () {
// Function to map frame_type to choice index
if (this.$parent.frame_type >= 0 && this.$parent.frame_type <= 63)
return 0; // same_frame
if (this.$parent.frame_type >= 64 && this.$parent.frame_type <= 127)
return 1; // same_locals_1_stack_item_frame
if (this.$parent.frame_type === 247) return 2; // same_locals_1_stack_item_frame_extended
if (this.$parent.frame_type >= 248 && this.$parent.frame_type <= 250)
return 3; // chop_frame
if (this.$parent.frame_type === 251) return 4; // same_frame_extended
if (this.$parent.frame_type >= 252 && this.$parent.frame_type <= 254)
return 5; // append_frame
if (this.$parent.frame_type === 255) return 6; // full_frame
return -1; // Invalid frame_type
},
choices: {
0: Parser.start(), // same_frame
1: Parser.start().nest("stack", {
// same_locals_1_stack_item_frame
type: VerificationTypeInfo,
}),
2: Parser.start() // same_locals_1_stack_item_frame_extended
.uint16be("offset_delta")
.nest("stack", {
type: VerificationTypeInfo,
}),
3: Parser.start().uint16be("offset_delta"), // chop_frame
4: Parser.start().uint16be("offset_delta"), // same_frame_extended
5: Parser.start() // append_frame
.useContextVars()
.uint16be("offset_delta")
.array("locals", {
type: VerificationTypeInfo,
length: function () {
return this.$parent.$parent.frame_type - 251;
},
}),
6: Parser.start() // full_frame
.uint16be("offset_delta")
.uint16be("number_of_locals")
.array("locals", {
type: VerificationTypeInfo,
length: "number_of_locals",
})
.uint16be("number_of_stack_items")
.array("stack", {
type: VerificationTypeInfo,
length: "number_of_stack_items",
}),
},
}),
formatter: function (frame) {
if (this.frame_type >= 0 && this.frame_type <= 63) {
frame.offset_delta = this.frame_type;
} else if (this.frame_type >= 64 && this.frame_type <= 127) {
frame.offset_delta = this.frame_type - 64;
}
return frame;
},
});
const StackMapTableAttribute = Parser.start()
.uint16be("number_of_entries")
.array("entries", {
type: StackMapFrame,
length: "number_of_entries",
});
const SourceFileAttribute = Parser.start().uint16be("sourcefile_index");
const BootstrapMethodsAttribute = Parser.start()
.uint16be("num_bootstrap_methods")
.array("bootstrap_methods", {
type: Parser.start()
.uint16be("bootstrap_method_ref")
.uint16be("num_bootstrap_arguments")
.array("bootstrap_arguments", {
type: "uint16be",
length: "num_bootstrap_arguments",
}),
length: "num_bootstrap_methods",
});
let ElementValue = Parser.start().namely("elementvalue").uint8("tag");
const AnnotationDefaultAttribute = Parser.start().nest("default_value", {
type: "elementvalue",
});
const Annotation = Parser.start()
.namely("annotation")
.uint16be("type_index")
.uint16be("num_element_value_pairs")
.array("element_value_pairs", {
type: Parser.start()
.uint16be("element_name_index")
.nest("value", { type: "elementvalue" }),
length: "num_element_value_pairs",
});
ElementValue = ElementValue.choice("value", {
tag: "tag",
choices: {
66: Parser.start().uint16be("const_value_index"), // byte ('B')
67: Parser.start().uint16be("const_value_index"), // char ('C')
68: Parser.start().uint16be("const_value_index"), // double ('D')
70: Parser.start().uint16be("const_value_index"), // float ('F')
73: Parser.start().uint16be("const_value_index"), // int ('I')
74: Parser.start().uint16be("const_value_index"), // long ('J')
83: Parser.start().uint16be("const_value_index"), // short ('S')
90: Parser.start().uint16be("const_value_index"), // boolean ('Z')
115: Parser.start().uint16be("const_value_index"), // String ('s')
101: Parser.start()
.uint16be("type_name_index")
.uint16be("const_name_index"), // enum constant ('e')
99: Parser.start().uint16be("class_info_index"), // class ('c')
64: Parser.start().nest("annotation_value", { type: "annotation" }), // annotation ('@')
91: Parser.start() // array ('[')
.uint16be("num_values")
.array("values", { type: "elementvalue", length: "num_values" }),
},
});
const DeprecatedAttribute = Parser.start();
const SourceDebugExtensionAttribute = Parser.start()
.uint32be("attribute_length")
.array("debug_extension", {
type: "uint8",
length: "attribute_length",
formatter: function (arr) {
return new TextDecoder().decode(new Uint8Array(arr));
},
});
const LocalVariableTableEntry = Parser.start()
.uint16be("start_pc")
.uint16be("length")
.uint16be("name_index")
.uint16be("descriptor_index")
.uint16be("index");
const LocalVariableTableAttribute = Parser.start()
.uint16be("local_variable_table_length")
.array("local_variable_table", {
type: LocalVariableTableEntry,
length: "local_variable_table_length",
});
const LocalVariableTypeTableEntry = Parser.start()
.uint16be("start_pc")
.uint16be("length")
.uint16be("name_index")
.uint16be("signature_index")
.uint16be("index");
const ExceptionsAttribute = Parser.start()
.uint16be("number_of_exceptions")
.array("exception_index_table", {
type: "uint16be",
length: "number_of_exceptions",
});
const InnerClassesEntry = Parser.start()
.uint16be("inner_class_info_index")
.uint16be("outer_class_info_index")
.uint16be("inner_name_index")
.uint16be("inner_class_access_flags");
const InnerClassesAttribute = Parser.start()
.uint16be("number_of_classes")
.array("classes", {
type: InnerClassesEntry,
length: "number_of_classes",
});
const EnclosingMethodAttribute = Parser.start()
.uint16be("class_index")
.uint16be("method_index");
const SyntheticAttribute = Parser.start(); // No data to parse for SyntheticAttribute
const SignatureAttribute = Parser.start().uint16be("signature_index");
const LocalVariableTypeTableAttribute = Parser.start()
.uint16be("local_variable_type_table_length")
.array("local_variable_type_table", {
type: LocalVariableTypeTableEntry,
length: "local_variable_type_table_length",
});
const RuntimeVisibleAnnotationsAttribute = Parser.start()
.uint16be("num_annotations")
.array("annotations", {
type: Annotation,
length: "num_annotations",
});
const RuntimeInvisibleAnnotationsAttribute = Parser.start()
.uint16be("num_annotations")
.array("annotations", {
type: Annotation,
length: "num_annotations",
});
const ParameterAnnotationsEntry = Parser.start()
.uint16be("num_annotations")
.array("annotations", {
type: Annotation,
length: "num_annotations",
});
const RuntimeVisibleParameterAnnotationsAttribute = Parser.start()
.uint8("num_parameters")
.array("parameter_annotations", {
type: ParameterAnnotationsEntry,
length: "num_parameters",
});
const RuntimeInvisibleParameterAnnotationsAttribute = Parser.start()
.uint8("num_parameters")
.array("parameter_annotations", {
type: ParameterAnnotationsEntry,
length: "num_parameters",
});
let CodeAttribute = Parser.start().namely("code_attribute");
//https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5
const AttributeInfo = Parser.start()
.useContextVars()
.namely("attribute_info")
.uint16be("attribute_name_index", {
formatter: function (_) {
return { index: _, name: this.$root.constant_pool?.entries[_] };
},
})
.uint32be("attribute_length")
.choice("info", {
tag: function () {
const nameInfo = this.attribute_name_index.name;
if (nameInfo && nameInfo.tag === 1) {
// CONSTANT_Utf8
return ((_) => {
switch (_) {
case "Code":
return 1;
case "ConstantValue":
return 2;
case "StackMapTable":
return 3;
case "LineNumberTable":
return 4;
case "SourceFile":
return 5;
case "BootstrapMethods":
return 6;
case "AnnotationDefault":
return 7;
case "RuntimeVisibleAnnotations":
return 8;
case "Deprecated":
return 9;
case "SourceDebugExtension":
return 10;
case "LocalVariableTable":
return 11;
case "LocalVariableTypeTable":
return 12;
case "Exceptions":
return 13;
case "InnerClasses":
return 14;
case "EnclosingMethod":
return 15;
case "Synthetic":
return 16;
case "Signature":
return 17;
case "RuntimeInvisibleAnnotations":
return 18; // Add RuntimeInvisibleAnnotations case
case "RuntimeVisibleParameterAnnotations":
return 19; // Add RuntimeVisibleParameterAnnotations case
case "RuntimeInvisibleParameterAnnotations":
return 20; // Add RuntimeInvisibleParameterAnnotations case
default:
return 0;
}
})(nameInfo.info.bytes);
}
return 0;
},
choices: {
//Code
1: "code_attribute",
//ConstantValue
2: ConstantValueAttribute,
3: StackMapTableAttribute,
4: LineNumberTableAttribute,
5: SourceFileAttribute,
6: BootstrapMethodsAttribute,
7: AnnotationDefaultAttribute,
8: RuntimeVisibleAnnotationsAttribute,
9: DeprecatedAttribute,
10: SourceDebugExtensionAttribute,
11: LocalVariableTableAttribute,
12: LocalVariableTypeTableAttribute,
13: ExceptionsAttribute,
14: InnerClassesAttribute,
15: EnclosingMethodAttribute,
16: SyntheticAttribute,
17: SignatureAttribute,
18: RuntimeInvisibleAnnotationsAttribute, // Add RuntimeInvisibleAnnotations choice
19: RuntimeVisibleParameterAnnotationsAttribute, // Add RuntimeVisibleParameterAnnotations choice
20: RuntimeInvisibleParameterAnnotationsAttribute, // Add RuntimeInvisibleParameterAnnotations choice
// Add other attribute types here as needed
0: Parser.start().array("info", {
type: "uint8",
length: function () {
return this.$parent.attribute_length;
},
}),
},
});
const WideInstructionParser = Parser.start()
.uint8("modifiedOpcode")
.uint16be("index")
.choice("info", {
tag: "modifiedOpcode",
choices: {
0x84: Parser.start().int16be("const").namely("iinc"), // iinc
0x15: Parser.start().namely("iload"), // iload
0x16: Parser.start().namely("lload"), // lload
0x17: Parser.start().namely("fload"), // fload
0x18: Parser.start().namely("dload"), // dload
0x19: Parser.start().namely("aload"), // aload
0x36: Parser.start().namely("istore"), // istore
0x37: Parser.start().namely("lstore"), // lstore
0x38: Parser.start().namely("fstore"), // fstore
0x39: Parser.start().namely("dstore"), // dstore
0x3a: Parser.start().namely("astore"), // astore
0xa9: Parser.start().namely("ret"), // ret
},
})
.namely("wide")
.buffer("length", {
length: () => 0,
formatter: function () {
// Total length INCLUDING the wide opcode itself:
// 1 (wide) + 1 (modifiedOpcode) + 2 (index) + optional 2 (const for iinc)
return 1 + 1 + 2 + (this.modifiedOpcode === 0x84 ? 2 : 0);
},
});
const TableswitchParser = Parser.start()
.namely("tableswitch")
.buffer("offset", {
length: () => 0,
formatter: function () {
return this.$parent.$parent.$parent.instructions
.map((_) => _.instruction.info.length)
.reduce((a, b) => a + b);
},
})
.buffer("padding", {
length: function () {
var the_length = (4 - ((this.offset + 1) % 4)) % 4;
return the_length;
},
})
.int32be("default", {
formatter: function (v) {
return v + this.offset;
},
})
.int32be("low")
.int32be("high")
.array("jumpOffsets", {
type: "int32be",
length: function () {
return this.high - this.low + 1;
},
formatter: function (att) {
return att.map((v) => v);
},
})
.buffer("length", {
length: () => 0,
formatter: function () {
return (
1 +
((4 - ((this.offset + 1) % 4)) % 4) +
4 +
4 +
4 +
4 * (this.high - this.low + 1)
);
},
});
const LookupswitchParser = Parser.start()
.namely("lookupswitch")
.buffer("offset", {
length: () => 0,
formatter: function () {
return this.$parent.$parent.$parent.instructions
.map((_) => _.instruction.info.length)
.reduce((a, b) => a + b);
},
})
.buffer("padding", {
length: function () {
const the_length = (4 - ((this.offset + 1) % 4)) % 4;
return the_length;
},
})
.int32be("default")
.int32be("npairs")
.array("matchOffsetPairs", {
type: Parser.start().int32be("match").int32be("offset"),
length: "npairs",
})
.buffer("length", {
length: () => 0,
formatter: function () {
return 1 + ((4 - ((this.offset + 1) % 4)) % 4) + 4 + 4 + 8 * this.npairs;
},
});
const InstructionParser = Parser.start()
.uint8("opcode")
.choice("info", {
tag: "opcode",
choices: {
0x00: Parser.start()
.namely("nop")
.buffer("length", { length: () => 0, formatter: () => 1 }), // nop
0x01: Parser.start()
.namely("aconst_null")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aconst_null
0x02: Parser.start()
.namely("iconst_m1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_m1
0x03: Parser.start()
.namely("iconst_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_0
0x04: Parser.start()
.namely("iconst_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_1
0x05: Parser.start()
.namely("iconst_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_2
0x06: Parser.start()
.namely("iconst_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_3
0x07: Parser.start()
.namely("iconst_4")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_4
0x08: Parser.start()
.namely("iconst_5")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iconst_5
0x09: Parser.start()
.namely("lconst_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lconst_0
0x0a: Parser.start()
.namely("lconst_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lconst_1
0x0b: Parser.start()
.namely("fconst_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fconst_0
0x0c: Parser.start()
.namely("fconst_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fconst_1
0x0d: Parser.start()
.namely("fconst_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fconst_2
0x0e: Parser.start()
.namely("dconst_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dconst_0
0x0f: Parser.start()
.namely("dconst_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dconst_1
0x10: Parser.start()
.int8("byte")
.namely("bipush")
.buffer("length", { length: () => 0, formatter: () => 2 }), // bipush
0x11: Parser.start()
.int16be("value")
.namely("sipush")
.buffer("length", { length: () => 0, formatter: () => 3 }), // sipush
0x12: Parser.start()
.uint8("index")
.namely("ldc")
.buffer("length", { length: () => 0, formatter: () => 2 }), // ldc
0x13: Parser.start()
.uint16be("index")
.namely("ldc_w")
.buffer("length", { length: () => 0, formatter: () => 3 }), // ldc_w
0x14: Parser.start()
.uint16be("index")
.namely("ldc2_w")
.buffer("length", { length: () => 0, formatter: () => 3 }), // ldc2_w
0x15: Parser.start()
.uint8("index")
.namely("iload")
.buffer("length", { length: () => 0, formatter: () => 2 }), // iload
0x16: Parser.start()
.uint8("index")
.namely("lload")
.buffer("length", { length: () => 0, formatter: () => 2 }), // lload
0x17: Parser.start()
.uint8("index")
.namely("fload")
.buffer("length", { length: () => 0, formatter: () => 2 }), // fload
0x18: Parser.start()
.uint8("index")
.namely("dload")
.buffer("length", { length: () => 0, formatter: () => 2 }), // dload
0x19: Parser.start()
.uint8("index")
.namely("aload")
.buffer("length", { length: () => 0, formatter: () => 2 }), // aload
0x1a: Parser.start()
.namely("iload_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iload_0
0x1b: Parser.start()
.namely("iload_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iload_1
0x1c: Parser.start()
.namely("iload_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iload_2
0x1d: Parser.start()
.namely("iload_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iload_3
0x1e: Parser.start()
.namely("lload_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lload_0
0x1f: Parser.start()
.namely("lload_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lload_1
0x20: Parser.start()
.namely("lload_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lload_2
0x21: Parser.start()
.namely("lload_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lload_3
0x22: Parser.start()
.namely("fload_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fload_0
0x23: Parser.start()
.namely("fload_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fload_1
0x24: Parser.start()
.namely("fload_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fload_2
0x25: Parser.start()
.namely("fload_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fload_3
0x26: Parser.start()
.namely("dload_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dload_0
0x27: Parser.start()
.namely("dload_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dload_1
0x28: Parser.start()
.namely("dload_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dload_2
0x29: Parser.start()
.namely("dload_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dload_3
0x2a: Parser.start()
.namely("aload_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aload_0
0x2b: Parser.start()
.namely("aload_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aload_1
0x2c: Parser.start()
.namely("aload_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aload_2
0x2d: Parser.start()
.namely("aload_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aload_3
0x2e: Parser.start()
.namely("iaload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iaload
0x2f: Parser.start()
.namely("laload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // laload
0x30: Parser.start()
.namely("faload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // faload
0x31: Parser.start()
.namely("daload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // daload
0x32: Parser.start()
.namely("aaload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aaload
0x33: Parser.start()
.namely("baload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // baload
0x34: Parser.start()
.namely("caload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // caload
0x35: Parser.start()
.namely("saload")
.buffer("length", { length: () => 0, formatter: () => 1 }), // saload
0x36: Parser.start()
.uint8("index")
.namely("istore")
.buffer("length", { length: () => 0, formatter: () => 2 }), // istore
0x37: Parser.start()
.uint8("index")
.namely("lstore")
.buffer("length", { length: () => 0, formatter: () => 2 }), // lstore
0x38: Parser.start()
.uint8("index")
.namely("fstore")
.buffer("length", { length: () => 0, formatter: () => 2 }), // fstore
0x39: Parser.start()
.uint8("index")
.namely("dstore")
.buffer("length", { length: () => 0, formatter: () => 2 }), // dstore
0x3a: Parser.start()
.uint8("index")
.namely("astore")
.buffer("length", { length: () => 0, formatter: () => 2 }), // astore
0x3b: Parser.start()
.namely("istore_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // istore_0
0x3c: Parser.start()
.namely("istore_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // istore_1
0x3d: Parser.start()
.namely("istore_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // istore_2
0x3e: Parser.start()
.namely("istore_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // istore_3
0x3f: Parser.start()
.namely("lstore_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lstore_0
0x40: Parser.start()
.namely("lstore_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lstore_1
0x41: Parser.start()
.namely("lstore_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lstore_2
0x42: Parser.start()
.namely("lstore_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lstore_3
0x43: Parser.start()
.namely("fstore_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fstore_0
0x44: Parser.start()
.namely("fstore_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fstore_1
0x45: Parser.start()
.namely("fstore_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fstore_2
0x46: Parser.start()
.namely("fstore_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fstore_3
0x47: Parser.start()
.namely("dstore_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dstore_0
0x48: Parser.start()
.namely("dstore_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dstore_1
0x49: Parser.start()
.namely("dstore_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dstore_2
0x4a: Parser.start()
.namely("dstore_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dstore_3
0x4b: Parser.start()
.namely("astore_0")
.buffer("length", { length: () => 0, formatter: () => 1 }), // astore_0
0x4c: Parser.start()
.namely("astore_1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // astore_1
0x4d: Parser.start()
.namely("astore_2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // astore_2
0x4e: Parser.start()
.namely("astore_3")
.buffer("length", { length: () => 0, formatter: () => 1 }), // astore_3
0x4f: Parser.start()
.namely("iastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iastore
0x50: Parser.start()
.namely("lastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lastore
0x51: Parser.start()
.namely("fastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fastore
0x52: Parser.start()
.namely("dastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dastore
0x53: Parser.start()
.namely("aastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // aastore
0x54: Parser.start()
.namely("bastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // bastore
0x55: Parser.start()
.namely("castore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // castore
0x56: Parser.start()
.namely("sastore")
.buffer("length", { length: () => 0, formatter: () => 1 }), // sastore
0x57: Parser.start()
.namely("pop")
.buffer("length", { length: () => 0, formatter: () => 1 }), // pop
0x58: Parser.start()
.namely("pop2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // pop2
0x59: Parser.start()
.namely("dup")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dup
0x5a: Parser.start()
.namely("dup_x1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dup_x1
0x5b: Parser.start()
.namely("dup_x2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dup_x2
0x5c: Parser.start()
.namely("dup2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dup2
0x5d: Parser.start()
.namely("dup2_x1")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dup2_x1
0x5e: Parser.start()
.namely("dup2_x2")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dup2_x2
0x5f: Parser.start()
.namely("swap")
.buffer("length", { length: () => 0, formatter: () => 1 }), // swap
0x60: Parser.start()
.namely("iadd")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iadd
0x61: Parser.start()
.namely("ladd")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ladd
0x62: Parser.start()
.namely("fadd")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fadd
0x63: Parser.start()
.namely("dadd")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dadd
0x64: Parser.start()
.namely("isub")
.buffer("length", { length: () => 0, formatter: () => 1 }), // isub
0x65: Parser.start()
.namely("lsub")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lsub
0x66: Parser.start()
.namely("fsub")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fsub
0x67: Parser.start()
.namely("dsub")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dsub
0x68: Parser.start()
.namely("imul")
.buffer("length", { length: () => 0, formatter: () => 1 }), // imul
0x69: Parser.start()
.namely("lmul")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lmul
0x6a: Parser.start()
.namely("fmul")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fmul
0x6b: Parser.start()
.namely("dmul")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dmul
0x6c: Parser.start()
.namely("idiv")
.buffer("length", { length: () => 0, formatter: () => 1 }), // idiv
0x6d: Parser.start()
.namely("ldiv")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ldiv
0x6e: Parser.start()
.namely("fdiv")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fdiv
0x6f: Parser.start()
.namely("ddiv")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ddiv
0x70: Parser.start()
.namely("irem")
.buffer("length", { length: () => 0, formatter: () => 1 }), // irem
0x71: Parser.start()
.namely("lrem")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lrem
0x72: Parser.start()
.namely("frem")
.buffer("length", { length: () => 0, formatter: () => 1 }), // frem
0x73: Parser.start()
.namely("drem")
.buffer("length", { length: () => 0, formatter: () => 1 }), // drem
0x74: Parser.start()
.namely("ineg")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ineg
0x75: Parser.start()
.namely("lneg")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lneg
0x76: Parser.start()
.namely("fneg")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fneg
0x77: Parser.start()
.namely("dneg")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dneg
0x78: Parser.start()
.namely("ishl")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ishl
0x79: Parser.start()
.namely("lshl")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lshl
0x7a: Parser.start()
.namely("ishr")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ishr
0x7b: Parser.start()
.namely("lshr")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lshr
0x7c: Parser.start()
.namely("iushr")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iushr
0x7d: Parser.start()
.namely("lushr")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lushr
0x7e: Parser.start()
.namely("iand")
.buffer("length", { length: () => 0, formatter: () => 1 }), // iand
0x7f: Parser.start()
.namely("land")
.buffer("length", { length: () => 0, formatter: () => 1 }), // land
0x80: Parser.start()
.namely("ior")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ior
0x81: Parser.start()
.namely("lor")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lor
0x82: Parser.start()
.namely("ixor")
.buffer("length", { length: () => 0, formatter: () => 1 }), // ixor
0x83: Parser.start()
.namely("lxor")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lxor
0x84: Parser.start()
.uint8("index")
.int8("const")
.namely("iinc")
.buffer("length", { length: () => 0, formatter: () => 3 }), // iinc
0x85: Parser.start()
.namely("i2l")
.buffer("length", { length: () => 0, formatter: () => 1 }), // i2l
0x86: Parser.start()
.namely("i2f")
.buffer("length", { length: () => 0, formatter: () => 1 }), // i2f
0x87: Parser.start()
.namely("i2d")
.buffer("length", { length: () => 0, formatter: () => 1 }), // i2d
0x88: Parser.start()
.namely("l2i")
.buffer("length", { length: () => 0, formatter: () => 1 }), // l2i
0x89: Parser.start()
.namely("l2f")
.buffer("length", { length: () => 0, formatter: () => 1 }), // l2f
0x8a: Parser.start()
.namely("l2d")
.buffer("length", { length: () => 0, formatter: () => 1 }), // l2d
0x8b: Parser.start()
.namely("f2i")
.buffer("length", { length: () => 0, formatter: () => 1 }), // f2i
0x8c: Parser.start()
.namely("f2l")
.buffer("length", { length: () => 0, formatter: () => 1 }), // f2l
0x8d: Parser.start()
.namely("f2d")
.buffer("length", { length: () => 0, formatter: () => 1 }), // f2d
0x8e: Parser.start()
.namely("d2i")
.buffer("length", { length: () => 0, formatter: () => 1 }), // d2i
0x8f: Parser.start()
.namely("d2l")
.buffer("length", { length: () => 0, formatter: () => 1 }), // d2l
0x90: Parser.start()
.namely("d2f")
.buffer("length", { length: () => 0, formatter: () => 1 }), // d2f
0x91: Parser.start()
.namely("i2b")
.buffer("length", { length: () => 0, formatter: () => 1 }), // i2b
0x92: Parser.start()
.namely("i2c")
.buffer("length", { length: () => 0, formatter: () => 1 }), // i2c
0x93: Parser.start()
.namely("i2s")
.buffer("length", { length: () => 0, formatter: () => 1 }), // i2s
0x94: Parser.start()
.namely("lcmp")
.buffer("length", { length: () => 0, formatter: () => 1 }), // lcmp
0x95: Parser.start()
.namely("fcmpl")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fcmpl
0x96: Parser.start()
.namely("fcmpg")
.buffer("length", { length: () => 0, formatter: () => 1 }), // fcmpg
0x97: Parser.start()
.namely("dcmpl")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dcmpl
0x98: Parser.start()
.namely("dcmpg")
.buffer("length", { length: () => 0, formatter: () => 1 }), // dcmpg
0x99: Parser.start()
.int16be("branchoffset")