1#
2# sample small-but-valid classfile
3#
4
5cafe babe  # magic
60000       # minor_version
7002e       # major_version
80017       # constant_pool_count
9
10#
11# constant_pool
12#
1307 0003                    # 0001: class[Small]
1407 0004                    # 0002: class[java/lang/Object]
1501 0005 "Small"            # 0003: utf8["Small"]
1601 0010 "java/lang/Object" # 0004: utf8["java/lang/Object"]
1701 0005 "blort"            # 0005: utf8["blort"]
1801 0003 "()V"              # 0006: utf8["()V"]
1901 0004 "Code"             # 0007: utf8["Code"]
2008 0003                    # 0008: string["Small"]
2103 12345678                # 0009: integer[0x12345678]
2204 42f6e666                # 000a: float[123.45]
2305 12345678 9abcdef0       # 000b: long[0x1234567890abcdef0]
2406 41195895 5f8a0903       # 000d: double[415269.3433]
2501 0005 "blort"            # 000f: utf8["blort"]
2601 0007 "x/y/Zzz"          # 0010: utf8["x/y/Zzz"]
2701 0003 "()V"              # 0011: utf8["()V"]
280c 000f 0010               # 0012: nat[blort:x/y/Zzz]
290c 000f 0011               # 0013: nat[blort:()V]
3009 0001 0012               # 0014: field[Small.blort:x/y/Zzz]
310a 0001 0013               # 0015: method[Small.blort:()V]
320b 0001 0013               # 0016: ifaceMethod[Small.blort:()V]
33
340001  # access_flags
350001  # this_class
360002  # super_class
370000  # interfaces_count
380000  # fields_count
390001  # methods_count
40
41# methods[0]
420001  # access_flags
430005  # name
440006  # descriptor
450001  # attributes_count
46# attributes[0]
470007      # name
48000001dc  # length (note: == code_length + 0x0c)
490001      # max_stack
500001      # max_locals
51000001d0  # code_length
52
5300        # 0000: nop
5401        # 0001: aconst_null
5502        # 0002: aconst_m1
5603        # 0003: iconst_0
5704        # 0004: iconst_1
5805        # 0005: iconst_2
5906        # 0006: iconst_3
6007        # 0007: iconst_4
6108        # 0008: iconst_5
6209        # 0009: lconst_0
630a        # 000a: lconst_1
640b        # 000b: fconst_0
650c        # 000c: fconst_1
660d        # 000d: fconst_2
670e        # 000e: dconst_0
680f        # 000f: dconst_1
6910 45     # 0010: bipush #+45
7011 5432   # 0012: sipush #+5432
7112 08     # 0015: ldc <string>
7212 09     # 0017: ldc <integer>
7312 0a     # 0019: ldc <float>
7413 0008   # 001b: ldc_w <string>
7513 0009   # 001e: ldc_w <integer>
7613 000a   # 0021: ldc_w <float>
7714 000b   # 0024: ldc2_w <long>
7814 000d   # 0027: ldc2_w <double>
7915 01     # 002a: iload 01
8016 02     # 002c: lload 02
8117 03     # 002e: fload 03
8218 04     # 0030: dload 04
8319 05     # 0032: aload 05
841a        # 0034: iload_0
851b        # 0035: iload_1
861c        # 0036: iload_2
871d        # 0037: iload_3
881e        # 0038: lload_0
891f        # 0039: lload_1
9020        # 003a: lload_2
9121        # 003b: lload_3
9222        # 003c: fload_0
9323        # 003d: fload_1
9424        # 003e: fload_2
9525        # 003f: fload_3
9626        # 0040: dload_0
9727        # 0041: dload_1
9828        # 0042: dload_2
9929        # 0043: dload_3
1002a        # 0044: aload_0
1012b        # 0045: aload_1
1022c        # 0046: aload_2
1032d        # 0047: aload_3
1042e        # 0048: iaload
1052f        # 0049: laload
10630        # 004a: faload
10731        # 004b: daload
10832        # 004c: aaload
10933        # 004d: baload
11034        # 004e: caload
11135        # 004f: saload
11236 41     # 0050: istore 41
11337 42     # 0052: lstore 42
11438 43     # 0054: fstore 43
11539 44     # 0056: dstore 44
1163a 45     # 0058: astore 45
1173b        # 005a: istore_0
1183c        # 005b: istore_1
1193d        # 005c: istore_2
1203e        # 005d: istore_3
1213f        # 005e: lstore_0
12240        # 005f: lstore_1
12341        # 0060: lstore_2
12442        # 0061: lstore_3
12543        # 0062: fstore_0
12644        # 0063: fstore_1
12745        # 0064: fstore_2
12846        # 0065: fstore_3
12947        # 0066: dstore_0
13048        # 0067: dstore_1
13149        # 0068: dstore_2
1324a        # 0069: dstore_3
1334b        # 006a: astore_0
1344c        # 006b: astore_1
1354d        # 006c: astore_2
1364e        # 006d: astore_3
1374f        # 006e: iastore
13850        # 006f: lastore
13951        # 0070: fastore
14052        # 0071: dastore
14153        # 0072: aastore
14254        # 0073: bastore
14355        # 0074: castore
14456        # 0075: sastore
14557        # 0076: pop
14658        # 0077: pop2
14759        # 0078: dup
1485a        # 0079: dup_x1
1495b        # 007a: dup_x2
1505c        # 007b: dup2
1515d        # 007c: dup2_x1
1525e        # 007d: dup2_x2
1535f        # 007e: swap
15460        # 007f: iadd
15561        # 0080: ladd
15662        # 0081: fadd
15763        # 0082: dadd
15864        # 0083: isub
15965        # 0084: lsub
16066        # 0085: fsub
16167        # 0086: dsub
16268        # 0087: imul
16369        # 0088: lmul
1646a        # 0089: fmul
1656b        # 008a: dmul
1666c        # 008b: idiv
1676d        # 008c: ldiv
1686e        # 008d: fdiv
1696f        # 008e: ddiv
17070        # 008f: irem
17171        # 0090: lrem
17272        # 0091: frem
17373        # 0092: drem
17474        # 0093: ineg
17575        # 0094: lneg
17676        # 0095: fneg
17777        # 0096: dneg
17878        # 0097: ishl
17979        # 0098: lshl
1807a        # 0099: ishr
1817b        # 009a: lshr
1827c        # 009b: iushr
1837d        # 009c: lushr
1847e        # 009d: iand
1857f        # 009e: land
18680        # 009f: ior
18781        # 00a0: lor
18882        # 00a1: ixor
18983        # 00a2: lxor
19084 05 ff  # 00a3: iinc 05, #-1
19185        # 00a6: i2l
19286        # 00a7: i2f
19387        # 00a8: i2d
19488        # 00a9: l2i
19589        # 00aa: l2f
1968a        # 00ab: l2d
1978b        # 00ac: f2i
1988c        # 00ad: f2l
1998d        # 00ae: f2d
2008e        # 00af: d2i
2018f        # 00b0: d2l
20290        # 00b1: d2f
20391        # 00b2: i2b
20492        # 00b3: i2c
20593        # 00b4: i2s
20694        # 00b5: lcmp
20795        # 00b6: fcmpl
20896        # 00b7: fcmpg
20997        # 00b8: dcmpl
21098        # 00b9: dcmpg
21199 0000   # 00ba: ifeq 00ba
2129a fffd   # 00bd: ifne 00ba
2139b fffa   # 00c0: iflt 00ba
2149c fff7   # 00c3: ifge 00ba
2159d fff4   # 00c6: ifgt 00ba
2169e fff1   # 00c9: ifle 00ba
2179f 000f   # 00cc: if_icmpeq 00db
218a0 000c   # 00cf: if_icmpne 00db
219a1 0009   # 00d2: if_icmplt 00db
220a2 0006   # 00d5: if_icmpge 00db
221a3 0003   # 00d8: if_icmpgt 00db
222a4 0000   # 00db: if_icmple 00db
223a5 0000   # 00de: if_acmpeq 00de
224a6 0000   # 00e1: if_acmpne 00e1
225a7 ff1c   # 00e4: goto 0000
226a8 0000   # 00e7: jsr 00e7
227a9 2f     # 00ea: ret 2f
228aa 000000 # 00ec: tableswitch + padding
229 fffffffe #   default: 000000ea
230 12340000 #   low: 12340000
231 12340007 #   high: 12340007
232 ffffff14 #   [0]: 00000000
233 ffffff15 #   [1]: 00000001
234 ffffff16 #   [2]: 00000002
235 ffffff17 #   [3]: 00000003
236 ffffff18 #   [4]: 00000004
237 ffffff19 #   [5]: 00000005
238 ffffff1b #   [6]: 00000007
239 ffffff1d #   [7]: 00000009
240ab 000000 # 011c: lookupswitch + padding
241 ffffffd0 #   default: 000000ec
242 00000004 #   npairs: 4
243 89761234 #   match[0]: 89761234
244 0000002c #   offset[0]: 0148
245 00001000 #   match[1]: 00001000
246 0000002d #   offset[1]: 0149
247 03333333 #   match[2]: 03333333
248 0000002d #   offset[2]: 0149
249 79787776 #   match[3]: 79787776
250 0000002f #   offset[3]: 014b
251ac        # 0148: ireturn
252ad        # 0149: lreturn
253ae        # 014a: freturn
254af        # 014b: dreturn
255b0        # 014c: areturn
256b1        # 014d: return
257b2 0014   # 014e: getstatic 0014
258b3 0014   # 0151: putstatic 0014
259b4 0014   # 0154: getfield 0014
260b5 0014   # 0157: putfield 0014
261b6 0015   # 015a: invokevirtual 0015
262b7 0015   # 015d: invokespecial 0015
263b8 0015   # 0160: invokestatic 0015
264b9 0016 01 00  # 0163: invokeinterface 0016
265ba        # 0168: <unused>
266bb 0001   # 0169: new 0001
267bc 04     # 016c: newarray boolean
268bc 05     # 016e: newarray char
269bc 06     # 0170: newarray float
270bc 07     # 0172: newarray double
271bc 08     # 0174: newarray byte
272bc 09     # 0176: newarray short
273bc 0a     # 0178: newarray int
274bc 0b     # 017a: newarray long
275bd 0001   # 017c: anewarray 0001
276be        # 017f: arraylength
277bf        # 0180: athrow
278c0 0002   # 0181: checkcast 0002
279c1 0002   # 0184: instanceof 0002
280c2        # 0187: monitorenter
281c3        # 0188: monitorexit
282c415 0123 # 0189: wide iload 0123
283c416 0124 # 018d: wide lload 0124
284c417 0125 # 0191: wide fload 0125
285c418 0126 # 0195: wide dload 0126
286c419 0127 # 0199: wide aload 0127
287c436 20f0 # 019d: wide istore 20f0
288c437 20f1 # 01a1: wide lstore 20f1
289c438 20f2 # 01a5: wide fstore 20f2
290c439 20f3 # 01a9: wide dstore 20f3
291c43a 20f4 # 01ad: wide astore 20f4
292c4a9 ffff # 01b1: wide ret ffff
293c484 0002 1000 # 01b5: wide iinc 0002, 1000
294c5 0002 04 # 01bb: multianewarray 0002, #04
295c6 fe41   # 01bf: ifnull 0000
296c7 0000   # 01c2: ifnonnull 01c2
297c8 70000000 # 01c5: goto_w 700001c5
298c9 fffffffb # 01ca: jsr_w 000001c5
299ca        # 01cf: <unused>
300
3010000      # exception_table_length
3020000      # attributes_count
303
3040000  # attributes_count
305