polyfile-weave 0.5.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of polyfile-weave might be problematic. Click here for more details.
- polyfile/__init__.py +15 -0
- polyfile/__main__.py +394 -0
- polyfile/arithmetic.py +27 -0
- polyfile/ast.py +114 -0
- polyfile/debugger.py +1039 -0
- polyfile/expressions.py +346 -0
- polyfile/fileutils.py +343 -0
- polyfile/html.py +135 -0
- polyfile/http/__init__.py +1 -0
- polyfile/http/defacto.py +37 -0
- polyfile/http/deprecated.py +51 -0
- polyfile/http/experimental.py +67 -0
- polyfile/http/http_11.py +548 -0
- polyfile/http/matcher.py +37 -0
- polyfile/http/structured_headers.py +48 -0
- polyfile/iterators.py +72 -0
- polyfile/jpeg.py +24 -0
- polyfile/kaitai/__init__.py +0 -0
- polyfile/kaitai/compiler.py +156 -0
- polyfile/kaitai/parser.py +312 -0
- polyfile/kaitai/parsers/__init__.py +0 -0
- polyfile/kaitai/parsers/aix_utmp.py +116 -0
- polyfile/kaitai/parsers/allegro_dat.py +367 -0
- polyfile/kaitai/parsers/andes_firmware.py +64 -0
- polyfile/kaitai/parsers/android_bootldr_asus.py +105 -0
- polyfile/kaitai/parsers/android_bootldr_huawei.py +181 -0
- polyfile/kaitai/parsers/android_bootldr_qcom.py +217 -0
- polyfile/kaitai/parsers/android_dto.py +138 -0
- polyfile/kaitai/parsers/android_img.py +319 -0
- polyfile/kaitai/parsers/android_nanoapp_header.py +83 -0
- polyfile/kaitai/parsers/android_opengl_shaders_cache.py +151 -0
- polyfile/kaitai/parsers/android_sparse.py +237 -0
- polyfile/kaitai/parsers/android_super.py +401 -0
- polyfile/kaitai/parsers/apm_partition_table.py +196 -0
- polyfile/kaitai/parsers/apple_single_double.py +180 -0
- polyfile/kaitai/parsers/asn1_der.py +235 -0
- polyfile/kaitai/parsers/au.py +138 -0
- polyfile/kaitai/parsers/avantes_roh60.py +112 -0
- polyfile/kaitai/parsers/avi.py +296 -0
- polyfile/kaitai/parsers/bcd.py +111 -0
- polyfile/kaitai/parsers/bitcoin_transaction.py +210 -0
- polyfile/kaitai/parsers/blender_blend.py +334 -0
- polyfile/kaitai/parsers/bmp.py +780 -0
- polyfile/kaitai/parsers/bson.py +411 -0
- polyfile/kaitai/parsers/btrfs_stream.py +318 -0
- polyfile/kaitai/parsers/bytes_with_io.py +27 -0
- polyfile/kaitai/parsers/chrome_pak.py +194 -0
- polyfile/kaitai/parsers/code_6502.py +456 -0
- polyfile/kaitai/parsers/compressed_resource.py +217 -0
- polyfile/kaitai/parsers/cpio_old_le.py +154 -0
- polyfile/kaitai/parsers/cramfs.py +344 -0
- polyfile/kaitai/parsers/creative_voice_file.py +342 -0
- polyfile/kaitai/parsers/dbf.py +274 -0
- polyfile/kaitai/parsers/dcmp_0.py +664 -0
- polyfile/kaitai/parsers/dcmp_1.py +422 -0
- polyfile/kaitai/parsers/dcmp_2.py +312 -0
- polyfile/kaitai/parsers/dcmp_variable_length_integer.py +66 -0
- polyfile/kaitai/parsers/dex.py +1086 -0
- polyfile/kaitai/parsers/dicom.py +4370 -0
- polyfile/kaitai/parsers/dime_message.py +201 -0
- polyfile/kaitai/parsers/dns_packet.py +569 -0
- polyfile/kaitai/parsers/doom_wad.py +654 -0
- polyfile/kaitai/parsers/dos_datetime.py +191 -0
- polyfile/kaitai/parsers/dos_mz.py +172 -0
- polyfile/kaitai/parsers/ds_store.py +513 -0
- polyfile/kaitai/parsers/dtb.py +310 -0
- polyfile/kaitai/parsers/dune_2_pak.py +126 -0
- polyfile/kaitai/parsers/edid.py +472 -0
- polyfile/kaitai/parsers/efivar_signature_list.py +331 -0
- polyfile/kaitai/parsers/elf.py +2482 -0
- polyfile/kaitai/parsers/ethernet_frame.py +114 -0
- polyfile/kaitai/parsers/exif.py +723 -0
- polyfile/kaitai/parsers/ext2.py +537 -0
- polyfile/kaitai/parsers/fallout2_dat.py +187 -0
- polyfile/kaitai/parsers/fallout_dat.py +156 -0
- polyfile/kaitai/parsers/fasttracker_xm_module.py +558 -0
- polyfile/kaitai/parsers/ftl_dat.py +90 -0
- polyfile/kaitai/parsers/genmidi_op2.py +161 -0
- polyfile/kaitai/parsers/gettext_mo.py +541 -0
- polyfile/kaitai/parsers/gif.py +492 -0
- polyfile/kaitai/parsers/gimp_brush.py +244 -0
- polyfile/kaitai/parsers/glibc_utmp.py +114 -0
- polyfile/kaitai/parsers/gltf_binary.py +132 -0
- polyfile/kaitai/parsers/google_protobuf.py +151 -0
- polyfile/kaitai/parsers/gpt_partition_table.py +175 -0
- polyfile/kaitai/parsers/gran_turismo_vol.py +140 -0
- polyfile/kaitai/parsers/grub2_font.py +337 -0
- polyfile/kaitai/parsers/gzip.py +232 -0
- polyfile/kaitai/parsers/hashcat_restore.py +60 -0
- polyfile/kaitai/parsers/hccap.py +111 -0
- polyfile/kaitai/parsers/hccapx.py +103 -0
- polyfile/kaitai/parsers/heaps_pak.py +177 -0
- polyfile/kaitai/parsers/heroes_of_might_and_magic_agg.py +116 -0
- polyfile/kaitai/parsers/heroes_of_might_and_magic_bmp.py +34 -0
- polyfile/kaitai/parsers/icmp_packet.py +136 -0
- polyfile/kaitai/parsers/ico.py +129 -0
- polyfile/kaitai/parsers/id3v1_1.py +220 -0
- polyfile/kaitai/parsers/id3v2_3.py +324 -0
- polyfile/kaitai/parsers/id3v2_4.py +423 -0
- polyfile/kaitai/parsers/ines.py +282 -0
- polyfile/kaitai/parsers/ipv4_packet.py +158 -0
- polyfile/kaitai/parsers/ipv6_packet.py +55 -0
- polyfile/kaitai/parsers/iso9660.py +544 -0
- polyfile/kaitai/parsers/java_class.py +1113 -0
- polyfile/kaitai/parsers/jpeg.py +361 -0
- polyfile/kaitai/parsers/luks.py +149 -0
- polyfile/kaitai/parsers/lzh.py +165 -0
- polyfile/kaitai/parsers/mac_os_resource_snd.py +493 -0
- polyfile/kaitai/parsers/mach_o.py +3033 -0
- polyfile/kaitai/parsers/mach_o_fat.py +92 -0
- polyfile/kaitai/parsers/magicavoxel_vox.py +391 -0
- polyfile/kaitai/parsers/manifest.json +1 -0
- polyfile/kaitai/parsers/mbr_partition_table.py +119 -0
- polyfile/kaitai/parsers/mcap.py +1015 -0
- polyfile/kaitai/parsers/microsoft_cfb.py +293 -0
- polyfile/kaitai/parsers/microsoft_network_monitor_v2.py +309 -0
- polyfile/kaitai/parsers/microsoft_pe.py +765 -0
- polyfile/kaitai/parsers/mifare_classic.py +706 -0
- polyfile/kaitai/parsers/minecraft_nbt.py +449 -0
- polyfile/kaitai/parsers/monomakh_sapr_chg.py +69 -0
- polyfile/kaitai/parsers/mozilla_mar.py +239 -0
- polyfile/kaitai/parsers/mp4.py +333 -0
- polyfile/kaitai/parsers/msgpack.py +467 -0
- polyfile/kaitai/parsers/nitf.py +1189 -0
- polyfile/kaitai/parsers/nt_mdt_pal.py +155 -0
- polyfile/kaitai/parsers/ogg.py +118 -0
- polyfile/kaitai/parsers/openpgp_message.py +993 -0
- polyfile/kaitai/parsers/packet_ppi.py +515 -0
- polyfile/kaitai/parsers/pcap.py +344 -0
- polyfile/kaitai/parsers/pcf_font.py +506 -0
- polyfile/kaitai/parsers/pcx.py +195 -0
- polyfile/kaitai/parsers/pcx_dcx.py +79 -0
- polyfile/kaitai/parsers/phar_without_stub.py +399 -0
- polyfile/kaitai/parsers/php_serialized_value.py +505 -0
- polyfile/kaitai/parsers/png.py +721 -0
- polyfile/kaitai/parsers/protocol_body.py +260 -0
- polyfile/kaitai/parsers/psx_tim.py +104 -0
- polyfile/kaitai/parsers/python_pickle.py +718 -0
- polyfile/kaitai/parsers/python_pyc_27.py +510 -0
- polyfile/kaitai/parsers/quake_mdl.py +441 -0
- polyfile/kaitai/parsers/quake_pak.py +112 -0
- polyfile/kaitai/parsers/quicktime_mov.py +634 -0
- polyfile/kaitai/parsers/rar.py +265 -0
- polyfile/kaitai/parsers/regf.py +569 -0
- polyfile/kaitai/parsers/renderware_binary_stream.py +877 -0
- polyfile/kaitai/parsers/resource_fork.py +611 -0
- polyfile/kaitai/parsers/respack.py +57 -0
- polyfile/kaitai/parsers/riff.py +409 -0
- polyfile/kaitai/parsers/rpm.py +964 -0
- polyfile/kaitai/parsers/rtcp_payload.py +579 -0
- polyfile/kaitai/parsers/rtp_packet.py +150 -0
- polyfile/kaitai/parsers/rtpdump.py +115 -0
- polyfile/kaitai/parsers/ruby_marshal.py +423 -0
- polyfile/kaitai/parsers/s3m.py +493 -0
- polyfile/kaitai/parsers/saints_row_2_vpp_pc.py +254 -0
- polyfile/kaitai/parsers/shapefile_index.py +174 -0
- polyfile/kaitai/parsers/shapefile_main.py +893 -0
- polyfile/kaitai/parsers/some_ip.py +209 -0
- polyfile/kaitai/parsers/some_ip_container.py +37 -0
- polyfile/kaitai/parsers/some_ip_sd.py +86 -0
- polyfile/kaitai/parsers/some_ip_sd_entries.py +160 -0
- polyfile/kaitai/parsers/some_ip_sd_options.py +374 -0
- polyfile/kaitai/parsers/specpr.py +404 -0
- polyfile/kaitai/parsers/sqlite3.py +472 -0
- polyfile/kaitai/parsers/ssh_public_key.py +252 -0
- polyfile/kaitai/parsers/standard_midi_file.py +390 -0
- polyfile/kaitai/parsers/stl.py +111 -0
- polyfile/kaitai/parsers/sudoers_ts.py +201 -0
- polyfile/kaitai/parsers/swf.py +406 -0
- polyfile/kaitai/parsers/systemd_journal.py +361 -0
- polyfile/kaitai/parsers/tcp_segment.py +57 -0
- polyfile/kaitai/parsers/tga.py +213 -0
- polyfile/kaitai/parsers/tls_client_hello.py +293 -0
- polyfile/kaitai/parsers/tr_dos_image.py +322 -0
- polyfile/kaitai/parsers/tsm.py +198 -0
- polyfile/kaitai/parsers/ttf.py +1847 -0
- polyfile/kaitai/parsers/udp_datagram.py +42 -0
- polyfile/kaitai/parsers/uefi_te.py +236 -0
- polyfile/kaitai/parsers/uimage.py +198 -0
- polyfile/kaitai/parsers/utf8_string.py +137 -0
- polyfile/kaitai/parsers/vfat.py +410 -0
- polyfile/kaitai/parsers/vlq_base128_be.py +104 -0
- polyfile/kaitai/parsers/vlq_base128_le.py +129 -0
- polyfile/kaitai/parsers/vmware_vmdk.py +167 -0
- polyfile/kaitai/parsers/vp8_ivf.py +112 -0
- polyfile/kaitai/parsers/warcraft_2_pud.py +423 -0
- polyfile/kaitai/parsers/wav.py +1014 -0
- polyfile/kaitai/parsers/websocket.py +167 -0
- polyfile/kaitai/parsers/windows_evt_log.py +304 -0
- polyfile/kaitai/parsers/windows_lnk_file.py +467 -0
- polyfile/kaitai/parsers/windows_minidump.py +575 -0
- polyfile/kaitai/parsers/windows_resource_file.py +243 -0
- polyfile/kaitai/parsers/windows_shell_items.py +190 -0
- polyfile/kaitai/parsers/windows_systemtime.py +52 -0
- polyfile/kaitai/parsers/wmf.py +502 -0
- polyfile/kaitai/parsers/xar.py +181 -0
- polyfile/kaitai/parsers/xwd.py +189 -0
- polyfile/kaitai/parsers/zip.py +685 -0
- polyfile/kaitai/parsers/zisofs.py +158 -0
- polyfile/kaitai/parsers/zx_spectrum_tap.py +184 -0
- polyfile/kaitaimatcher.py +113 -0
- polyfile/languagematcher.py +217 -0
- polyfile/logger.py +135 -0
- polyfile/magic.py +2983 -0
- polyfile/magic_defs/COPYING +29 -0
- polyfile/magic_defs/__init__.py +0 -0
- polyfile/magic_defs/acorn +102 -0
- polyfile/magic_defs/adi +13 -0
- polyfile/magic_defs/adventure +122 -0
- polyfile/magic_defs/aes +29 -0
- polyfile/magic_defs/algol68 +35 -0
- polyfile/magic_defs/allegro +9 -0
- polyfile/magic_defs/alliant +18 -0
- polyfile/magic_defs/alpha +32 -0
- polyfile/magic_defs/amanda +12 -0
- polyfile/magic_defs/amigaos +218 -0
- polyfile/magic_defs/android +259 -0
- polyfile/magic_defs/animation +1197 -0
- polyfile/magic_defs/aout +46 -0
- polyfile/magic_defs/apache +28 -0
- polyfile/magic_defs/apl +7 -0
- polyfile/magic_defs/apple +773 -0
- polyfile/magic_defs/application +7 -0
- polyfile/magic_defs/applix +13 -0
- polyfile/magic_defs/apt +52 -0
- polyfile/magic_defs/archive +2586 -0
- polyfile/magic_defs/aria +38 -0
- polyfile/magic_defs/arm +50 -0
- polyfile/magic_defs/asf +132 -0
- polyfile/magic_defs/assembler +18 -0
- polyfile/magic_defs/asterix +18 -0
- polyfile/magic_defs/att3b +41 -0
- polyfile/magic_defs/audio +1291 -0
- polyfile/magic_defs/avm +33 -0
- polyfile/magic_defs/basis +18 -0
- polyfile/magic_defs/beetle +7 -0
- polyfile/magic_defs/ber +65 -0
- polyfile/magic_defs/bflt +14 -0
- polyfile/magic_defs/bhl +10 -0
- polyfile/magic_defs/bioinformatics +178 -0
- polyfile/magic_defs/biosig +154 -0
- polyfile/magic_defs/blackberry +8 -0
- polyfile/magic_defs/blcr +25 -0
- polyfile/magic_defs/blender +50 -0
- polyfile/magic_defs/blit +24 -0
- polyfile/magic_defs/bm +10 -0
- polyfile/magic_defs/bout +11 -0
- polyfile/magic_defs/bsdi +33 -0
- polyfile/magic_defs/bsi +10 -0
- polyfile/magic_defs/btsnoop +13 -0
- polyfile/magic_defs/burp +7 -0
- polyfile/magic_defs/bytecode +41 -0
- polyfile/magic_defs/c-lang +110 -0
- polyfile/magic_defs/c64 +531 -0
- polyfile/magic_defs/cad +437 -0
- polyfile/magic_defs/cafebabe +107 -0
- polyfile/magic_defs/cbor +21 -0
- polyfile/magic_defs/ccf +14 -0
- polyfile/magic_defs/cddb +12 -0
- polyfile/magic_defs/chord +15 -0
- polyfile/magic_defs/cisco +12 -0
- polyfile/magic_defs/citrus +12 -0
- polyfile/magic_defs/clarion +27 -0
- polyfile/magic_defs/claris +48 -0
- polyfile/magic_defs/clipper +65 -0
- polyfile/magic_defs/clojure +30 -0
- polyfile/magic_defs/coff +98 -0
- polyfile/magic_defs/commands +201 -0
- polyfile/magic_defs/communications +22 -0
- polyfile/magic_defs/compress +461 -0
- polyfile/magic_defs/console +1213 -0
- polyfile/magic_defs/convex +69 -0
- polyfile/magic_defs/coverage +91 -0
- polyfile/magic_defs/cracklib +14 -0
- polyfile/magic_defs/crypto +31 -0
- polyfile/magic_defs/csv +8 -0
- polyfile/magic_defs/ctags +6 -0
- polyfile/magic_defs/ctf +23 -0
- polyfile/magic_defs/cubemap +8 -0
- polyfile/magic_defs/cups +56 -0
- polyfile/magic_defs/dact +11 -0
- polyfile/magic_defs/database +886 -0
- polyfile/magic_defs/dataone +47 -0
- polyfile/magic_defs/dbpf +15 -0
- polyfile/magic_defs/der +146 -0
- polyfile/magic_defs/diamond +12 -0
- polyfile/magic_defs/dif +33 -0
- polyfile/magic_defs/diff +41 -0
- polyfile/magic_defs/digital +59 -0
- polyfile/magic_defs/dolby +69 -0
- polyfile/magic_defs/dsf +25 -0
- polyfile/magic_defs/dump +96 -0
- polyfile/magic_defs/dwarfs +45 -0
- polyfile/magic_defs/dyadic +61 -0
- polyfile/magic_defs/ebml +8 -0
- polyfile/magic_defs/edid +11 -0
- polyfile/magic_defs/editors +43 -0
- polyfile/magic_defs/efi +15 -0
- polyfile/magic_defs/elf +379 -0
- polyfile/magic_defs/encore +22 -0
- polyfile/magic_defs/epoc +62 -0
- polyfile/magic_defs/erlang +21 -0
- polyfile/magic_defs/espressif +57 -0
- polyfile/magic_defs/esri +28 -0
- polyfile/magic_defs/etf +33 -0
- polyfile/magic_defs/fcs +9 -0
- polyfile/magic_defs/filesystems +2694 -0
- polyfile/magic_defs/finger +16 -0
- polyfile/magic_defs/firmware +133 -0
- polyfile/magic_defs/flash +62 -0
- polyfile/magic_defs/flif +36 -0
- polyfile/magic_defs/fonts +449 -0
- polyfile/magic_defs/forth +82 -0
- polyfile/magic_defs/fortran +9 -0
- polyfile/magic_defs/frame +62 -0
- polyfile/magic_defs/freebsd +164 -0
- polyfile/magic_defs/fsav +128 -0
- polyfile/magic_defs/fusecompress +12 -0
- polyfile/magic_defs/games +696 -0
- polyfile/magic_defs/gcc +17 -0
- polyfile/magic_defs/gconv +10 -0
- polyfile/magic_defs/gentoo +85 -0
- polyfile/magic_defs/geo +166 -0
- polyfile/magic_defs/geos +20 -0
- polyfile/magic_defs/gimp +77 -0
- polyfile/magic_defs/git +13 -0
- polyfile/magic_defs/glibc +21 -0
- polyfile/magic_defs/gnome +59 -0
- polyfile/magic_defs/gnu +173 -0
- polyfile/magic_defs/gnumeric +8 -0
- polyfile/magic_defs/gpt +240 -0
- polyfile/magic_defs/gpu +28 -0
- polyfile/magic_defs/grace +21 -0
- polyfile/magic_defs/graphviz +12 -0
- polyfile/magic_defs/gringotts +48 -0
- polyfile/magic_defs/guile +13 -0
- polyfile/magic_defs/hardware +12 -0
- polyfile/magic_defs/hitachi-sh +30 -0
- polyfile/magic_defs/hp +433 -0
- polyfile/magic_defs/human68k +26 -0
- polyfile/magic_defs/ibm370 +52 -0
- polyfile/magic_defs/ibm6000 +35 -0
- polyfile/magic_defs/icc +214 -0
- polyfile/magic_defs/iff +80 -0
- polyfile/magic_defs/images +4210 -0
- polyfile/magic_defs/inform +9 -0
- polyfile/magic_defs/intel +310 -0
- polyfile/magic_defs/interleaf +9 -0
- polyfile/magic_defs/island +10 -0
- polyfile/magic_defs/ispell +63 -0
- polyfile/magic_defs/isz +15 -0
- polyfile/magic_defs/java +52 -0
- polyfile/magic_defs/javascript +171 -0
- polyfile/magic_defs/jpeg +252 -0
- polyfile/magic_defs/json +8 -0
- polyfile/magic_defs/karma +9 -0
- polyfile/magic_defs/kde +11 -0
- polyfile/magic_defs/keepass +20 -0
- polyfile/magic_defs/kerberos +45 -0
- polyfile/magic_defs/kicad +85 -0
- polyfile/magic_defs/kml +34 -0
- polyfile/magic_defs/lammps +64 -0
- polyfile/magic_defs/lecter +6 -0
- polyfile/magic_defs/lex +12 -0
- polyfile/magic_defs/lif +50 -0
- polyfile/magic_defs/linux +557 -0
- polyfile/magic_defs/lisp +78 -0
- polyfile/magic_defs/llvm +22 -0
- polyfile/magic_defs/locoscript +12 -0
- polyfile/magic_defs/lua +31 -0
- polyfile/magic_defs/luks +126 -0
- polyfile/magic_defs/m4 +11 -0
- polyfile/magic_defs/mach +303 -0
- polyfile/magic_defs/macintosh +505 -0
- polyfile/magic_defs/macos +7 -0
- polyfile/magic_defs/magic +10 -0
- polyfile/magic_defs/magic.mgc +0 -0
- polyfile/magic_defs/mail.news +132 -0
- polyfile/magic_defs/make +21 -0
- polyfile/magic_defs/map +413 -0
- polyfile/magic_defs/maple +109 -0
- polyfile/magic_defs/marc21 +30 -0
- polyfile/magic_defs/mathcad +8 -0
- polyfile/magic_defs/mathematica +188 -0
- polyfile/magic_defs/matroska +17 -0
- polyfile/magic_defs/mcrypt +52 -0
- polyfile/magic_defs/measure +44 -0
- polyfile/magic_defs/mercurial +13 -0
- polyfile/magic_defs/metastore +8 -0
- polyfile/magic_defs/meteorological +53 -0
- polyfile/magic_defs/microfocus +21 -0
- polyfile/magic_defs/mime +9 -0
- polyfile/magic_defs/mips +120 -0
- polyfile/magic_defs/mirage +8 -0
- polyfile/magic_defs/misctools +140 -0
- polyfile/magic_defs/mkid +11 -0
- polyfile/magic_defs/mlssa +8 -0
- polyfile/magic_defs/mmdf +6 -0
- polyfile/magic_defs/modem +92 -0
- polyfile/magic_defs/modulefile +9 -0
- polyfile/magic_defs/motorola +71 -0
- polyfile/magic_defs/mozilla +37 -0
- polyfile/magic_defs/msdos +2304 -0
- polyfile/magic_defs/msooxml +68 -0
- polyfile/magic_defs/msvc +222 -0
- polyfile/magic_defs/msx +309 -0
- polyfile/magic_defs/mup +24 -0
- polyfile/magic_defs/music +17 -0
- polyfile/magic_defs/nasa +7 -0
- polyfile/magic_defs/natinst +24 -0
- polyfile/magic_defs/ncr +49 -0
- polyfile/magic_defs/neko +12 -0
- polyfile/magic_defs/netbsd +251 -0
- polyfile/magic_defs/netscape +26 -0
- polyfile/magic_defs/netware +11 -0
- polyfile/magic_defs/news +13 -0
- polyfile/magic_defs/nifty +202 -0
- polyfile/magic_defs/nim-lang +29 -0
- polyfile/magic_defs/nitpicker +14 -0
- polyfile/magic_defs/numpy +9 -0
- polyfile/magic_defs/oasis +12 -0
- polyfile/magic_defs/ocaml +14 -0
- polyfile/magic_defs/octave +6 -0
- polyfile/magic_defs/ole2compounddocs +760 -0
- polyfile/magic_defs/olf +98 -0
- polyfile/magic_defs/openfst +17 -0
- polyfile/magic_defs/opentimestamps +16 -0
- polyfile/magic_defs/oric +16 -0
- polyfile/magic_defs/os2 +186 -0
- polyfile/magic_defs/os400 +39 -0
- polyfile/magic_defs/os9 +80 -0
- polyfile/magic_defs/osf1 +10 -0
- polyfile/magic_defs/palm +156 -0
- polyfile/magic_defs/parix +13 -0
- polyfile/magic_defs/parrot +22 -0
- polyfile/magic_defs/pascal +39 -0
- polyfile/magic_defs/pbf +11 -0
- polyfile/magic_defs/pbm +8 -0
- polyfile/magic_defs/pc88 +24 -0
- polyfile/magic_defs/pc98 +77 -0
- polyfile/magic_defs/pci_ids +116 -0
- polyfile/magic_defs/pcjr +8 -0
- polyfile/magic_defs/pdf +51 -0
- polyfile/magic_defs/pdp +42 -0
- polyfile/magic_defs/perl +100 -0
- polyfile/magic_defs/pgf +52 -0
- polyfile/magic_defs/pgp +581 -0
- polyfile/magic_defs/pgp-binary-keys +388 -0
- polyfile/magic_defs/pkgadd +7 -0
- polyfile/magic_defs/plan9 +25 -0
- polyfile/magic_defs/playdate +57 -0
- polyfile/magic_defs/plus5 +18 -0
- polyfile/magic_defs/pmem +46 -0
- polyfile/magic_defs/polyfile_zip +5 -0
- polyfile/magic_defs/polyml +23 -0
- polyfile/magic_defs/printer +269 -0
- polyfile/magic_defs/project +10 -0
- polyfile/magic_defs/psdbms +14 -0
- polyfile/magic_defs/psl +14 -0
- polyfile/magic_defs/pulsar +13 -0
- polyfile/magic_defs/puzzle +17 -0
- polyfile/magic_defs/pwsafe +14 -0
- polyfile/magic_defs/pyramid +12 -0
- polyfile/magic_defs/python +305 -0
- polyfile/magic_defs/qt +30 -0
- polyfile/magic_defs/revision +66 -0
- polyfile/magic_defs/riff +840 -0
- polyfile/magic_defs/rinex +44 -0
- polyfile/magic_defs/ringdove +45 -0
- polyfile/magic_defs/rpi +52 -0
- polyfile/magic_defs/rpm +45 -0
- polyfile/magic_defs/rpmsg +7 -0
- polyfile/magic_defs/rst +11 -0
- polyfile/magic_defs/rtf +94 -0
- polyfile/magic_defs/ruby +55 -0
- polyfile/magic_defs/rust +21 -0
- polyfile/magic_defs/sc +7 -0
- polyfile/magic_defs/sccs +24 -0
- polyfile/magic_defs/scientific +144 -0
- polyfile/magic_defs/securitycerts +6 -0
- polyfile/magic_defs/selinux +24 -0
- polyfile/magic_defs/sendmail +37 -0
- polyfile/magic_defs/sequent +42 -0
- polyfile/magic_defs/sereal +35 -0
- polyfile/magic_defs/sgi +144 -0
- polyfile/magic_defs/sgml +161 -0
- polyfile/magic_defs/sharc +23 -0
- polyfile/magic_defs/sinclair +40 -0
- polyfile/magic_defs/sisu +18 -0
- polyfile/magic_defs/sketch +6 -0
- polyfile/magic_defs/smalltalk +25 -0
- polyfile/magic_defs/smile +34 -0
- polyfile/magic_defs/sniffer +482 -0
- polyfile/magic_defs/softquad +40 -0
- polyfile/magic_defs/sosi +40 -0
- polyfile/magic_defs/spec +21 -0
- polyfile/magic_defs/spectrum +184 -0
- polyfile/magic_defs/sql +288 -0
- polyfile/magic_defs/ssh +39 -0
- polyfile/magic_defs/ssl +20 -0
- polyfile/magic_defs/statistics +45 -0
- polyfile/magic_defs/subtitle +38 -0
- polyfile/magic_defs/sun +141 -0
- polyfile/magic_defs/svf +5 -0
- polyfile/magic_defs/sylk +36 -0
- polyfile/magic_defs/symbos +42 -0
- polyfile/magic_defs/sysex +429 -0
- polyfile/magic_defs/tcl +29 -0
- polyfile/magic_defs/teapot +6 -0
- polyfile/magic_defs/terminfo +63 -0
- polyfile/magic_defs/tex +141 -0
- polyfile/magic_defs/tgif +7 -0
- polyfile/magic_defs/ti-8x +239 -0
- polyfile/magic_defs/timezone +42 -0
- polyfile/magic_defs/tplink +95 -0
- polyfile/magic_defs/troff +38 -0
- polyfile/magic_defs/tuxedo +8 -0
- polyfile/magic_defs/typeset +8 -0
- polyfile/magic_defs/uf2 +72 -0
- polyfile/magic_defs/unicode +15 -0
- polyfile/magic_defs/unisig +12 -0
- polyfile/magic_defs/unknown +34 -0
- polyfile/magic_defs/usd +21 -0
- polyfile/magic_defs/uterus +16 -0
- polyfile/magic_defs/uuencode +28 -0
- polyfile/magic_defs/vacuum-cleaner +54 -0
- polyfile/magic_defs/varied.out +46 -0
- polyfile/magic_defs/varied.script +21 -0
- polyfile/magic_defs/vax +32 -0
- polyfile/magic_defs/vicar +17 -0
- polyfile/magic_defs/virtual +307 -0
- polyfile/magic_defs/virtutech +12 -0
- polyfile/magic_defs/visx +32 -0
- polyfile/magic_defs/vms +30 -0
- polyfile/magic_defs/vmware +6 -0
- polyfile/magic_defs/vorbis +155 -0
- polyfile/magic_defs/vxl +14 -0
- polyfile/magic_defs/warc +16 -0
- polyfile/magic_defs/weak +16 -0
- polyfile/magic_defs/web +18 -0
- polyfile/magic_defs/webassembly +17 -0
- polyfile/magic_defs/windows +1811 -0
- polyfile/magic_defs/wireless +7 -0
- polyfile/magic_defs/wordprocessors +630 -0
- polyfile/magic_defs/wsdl +23 -0
- polyfile/magic_defs/x68000 +25 -0
- polyfile/magic_defs/xdelta +13 -0
- polyfile/magic_defs/xenix +106 -0
- polyfile/magic_defs/xilinx +58 -0
- polyfile/magic_defs/xo65 +37 -0
- polyfile/magic_defs/xwindows +43 -0
- polyfile/magic_defs/yara +17 -0
- polyfile/magic_defs/zfs +96 -0
- polyfile/magic_defs/zilog +12 -0
- polyfile/magic_defs/zip +126 -0
- polyfile/magic_defs/zyxel +17 -0
- polyfile/nes.py +144 -0
- polyfile/nitf.py +15 -0
- polyfile/pdf.py +1264 -0
- polyfile/pickles.py +45 -0
- polyfile/polyfile.py +409 -0
- polyfile/profiling.py +115 -0
- polyfile/repl.py +624 -0
- polyfile/search.py +310 -0
- polyfile/serialization.py +323 -0
- polyfile/structmatcher.py +46 -0
- polyfile/structs.py +281 -0
- polyfile/templates/download.js +162 -0
- polyfile/templates/hexdump.css +268 -0
- polyfile/templates/hexdump.js +756 -0
- polyfile/templates/jquery-3.4.1.min.js +2 -0
- polyfile/templates/template.html +119 -0
- polyfile/wildcards.py +62 -0
- polyfile/zipmatcher.py +183 -0
- polyfile_weave-0.5.5.dist-info/METADATA +173 -0
- polyfile_weave-0.5.5.dist-info/RECORD +585 -0
- polyfile_weave-0.5.5.dist-info/WHEEL +5 -0
- polyfile_weave-0.5.5.dist-info/entry_points.txt +2 -0
- polyfile_weave-0.5.5.dist-info/licenses/LICENSE +202 -0
- polyfile_weave-0.5.5.dist-info/top_level.txt +2 -0
- polymerge/__init__.py +1 -0
- polymerge/__main__.py +296 -0
- polymerge/cfg.py +127 -0
- polymerge/polymerge.py +227 -0
- polymerge/polytracker.py +190 -0
|
@@ -0,0 +1,1113 @@
|
|
|
1
|
+
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
|
2
|
+
|
|
3
|
+
from pkg_resources import parse_version
|
|
4
|
+
import kaitaistruct
|
|
5
|
+
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
|
|
6
|
+
import collections
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
|
|
11
|
+
raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__))
|
|
12
|
+
|
|
13
|
+
class JavaClass(KaitaiStruct):
|
|
14
|
+
"""
|
|
15
|
+
.. seealso::
|
|
16
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
.. seealso::
|
|
20
|
+
Source - https://docs.oracle.com/javase/specs/jls/se6/jls3.pdf
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
.. seealso::
|
|
24
|
+
Source - https://github.com/openjdk/jdk/blob/jdk-21%2B14/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
.. seealso::
|
|
28
|
+
Source - https://github.com/openjdk/jdk/blob/jdk-21%2B14/src/java.base/share/native/include/classfile_constants.h.template
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
.. seealso::
|
|
32
|
+
Source - https://github.com/openjdk/jdk/blob/jdk-21%2B14/src/hotspot/share/classfile/classFileParser.cpp
|
|
33
|
+
"""
|
|
34
|
+
SEQ_FIELDS = ["magic", "version_minor", "version_major", "constant_pool_count", "constant_pool", "access_flags", "this_class", "super_class", "interfaces_count", "interfaces", "fields_count", "fields", "methods_count", "methods", "attributes_count", "attributes"]
|
|
35
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
36
|
+
self._io = _io
|
|
37
|
+
self._parent = _parent
|
|
38
|
+
self._root = _root if _root else self
|
|
39
|
+
self._debug = collections.defaultdict(dict)
|
|
40
|
+
|
|
41
|
+
def _read(self):
|
|
42
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
43
|
+
self.magic = self._io.read_bytes(4)
|
|
44
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
45
|
+
if not self.magic == b"\xCA\xFE\xBA\xBE":
|
|
46
|
+
raise kaitaistruct.ValidationNotEqualError(b"\xCA\xFE\xBA\xBE", self.magic, self._io, u"/seq/0")
|
|
47
|
+
self._debug['version_minor']['start'] = self._io.pos()
|
|
48
|
+
self.version_minor = self._io.read_u2be()
|
|
49
|
+
self._debug['version_minor']['end'] = self._io.pos()
|
|
50
|
+
self._debug['version_major']['start'] = self._io.pos()
|
|
51
|
+
self.version_major = self._io.read_u2be()
|
|
52
|
+
self._debug['version_major']['end'] = self._io.pos()
|
|
53
|
+
if not self.version_major >= 43:
|
|
54
|
+
raise kaitaistruct.ValidationLessThanError(43, self.version_major, self._io, u"/seq/2")
|
|
55
|
+
self._debug['constant_pool_count']['start'] = self._io.pos()
|
|
56
|
+
self.constant_pool_count = self._io.read_u2be()
|
|
57
|
+
self._debug['constant_pool_count']['end'] = self._io.pos()
|
|
58
|
+
self._debug['constant_pool']['start'] = self._io.pos()
|
|
59
|
+
self.constant_pool = [None] * ((self.constant_pool_count - 1))
|
|
60
|
+
for i in range((self.constant_pool_count - 1)):
|
|
61
|
+
if not 'arr' in self._debug['constant_pool']:
|
|
62
|
+
self._debug['constant_pool']['arr'] = []
|
|
63
|
+
self._debug['constant_pool']['arr'].append({'start': self._io.pos()})
|
|
64
|
+
_t_constant_pool = JavaClass.ConstantPoolEntry((self.constant_pool[(i - 1)].is_two_entries if i != 0 else False), self._io, self, self._root)
|
|
65
|
+
_t_constant_pool._read()
|
|
66
|
+
self.constant_pool[i] = _t_constant_pool
|
|
67
|
+
self._debug['constant_pool']['arr'][i]['end'] = self._io.pos()
|
|
68
|
+
|
|
69
|
+
self._debug['constant_pool']['end'] = self._io.pos()
|
|
70
|
+
self._debug['access_flags']['start'] = self._io.pos()
|
|
71
|
+
self.access_flags = self._io.read_u2be()
|
|
72
|
+
self._debug['access_flags']['end'] = self._io.pos()
|
|
73
|
+
self._debug['this_class']['start'] = self._io.pos()
|
|
74
|
+
self.this_class = self._io.read_u2be()
|
|
75
|
+
self._debug['this_class']['end'] = self._io.pos()
|
|
76
|
+
self._debug['super_class']['start'] = self._io.pos()
|
|
77
|
+
self.super_class = self._io.read_u2be()
|
|
78
|
+
self._debug['super_class']['end'] = self._io.pos()
|
|
79
|
+
self._debug['interfaces_count']['start'] = self._io.pos()
|
|
80
|
+
self.interfaces_count = self._io.read_u2be()
|
|
81
|
+
self._debug['interfaces_count']['end'] = self._io.pos()
|
|
82
|
+
self._debug['interfaces']['start'] = self._io.pos()
|
|
83
|
+
self.interfaces = [None] * (self.interfaces_count)
|
|
84
|
+
for i in range(self.interfaces_count):
|
|
85
|
+
if not 'arr' in self._debug['interfaces']:
|
|
86
|
+
self._debug['interfaces']['arr'] = []
|
|
87
|
+
self._debug['interfaces']['arr'].append({'start': self._io.pos()})
|
|
88
|
+
self.interfaces[i] = self._io.read_u2be()
|
|
89
|
+
self._debug['interfaces']['arr'][i]['end'] = self._io.pos()
|
|
90
|
+
|
|
91
|
+
self._debug['interfaces']['end'] = self._io.pos()
|
|
92
|
+
self._debug['fields_count']['start'] = self._io.pos()
|
|
93
|
+
self.fields_count = self._io.read_u2be()
|
|
94
|
+
self._debug['fields_count']['end'] = self._io.pos()
|
|
95
|
+
self._debug['fields']['start'] = self._io.pos()
|
|
96
|
+
self.fields = [None] * (self.fields_count)
|
|
97
|
+
for i in range(self.fields_count):
|
|
98
|
+
if not 'arr' in self._debug['fields']:
|
|
99
|
+
self._debug['fields']['arr'] = []
|
|
100
|
+
self._debug['fields']['arr'].append({'start': self._io.pos()})
|
|
101
|
+
_t_fields = JavaClass.FieldInfo(self._io, self, self._root)
|
|
102
|
+
_t_fields._read()
|
|
103
|
+
self.fields[i] = _t_fields
|
|
104
|
+
self._debug['fields']['arr'][i]['end'] = self._io.pos()
|
|
105
|
+
|
|
106
|
+
self._debug['fields']['end'] = self._io.pos()
|
|
107
|
+
self._debug['methods_count']['start'] = self._io.pos()
|
|
108
|
+
self.methods_count = self._io.read_u2be()
|
|
109
|
+
self._debug['methods_count']['end'] = self._io.pos()
|
|
110
|
+
self._debug['methods']['start'] = self._io.pos()
|
|
111
|
+
self.methods = [None] * (self.methods_count)
|
|
112
|
+
for i in range(self.methods_count):
|
|
113
|
+
if not 'arr' in self._debug['methods']:
|
|
114
|
+
self._debug['methods']['arr'] = []
|
|
115
|
+
self._debug['methods']['arr'].append({'start': self._io.pos()})
|
|
116
|
+
_t_methods = JavaClass.MethodInfo(self._io, self, self._root)
|
|
117
|
+
_t_methods._read()
|
|
118
|
+
self.methods[i] = _t_methods
|
|
119
|
+
self._debug['methods']['arr'][i]['end'] = self._io.pos()
|
|
120
|
+
|
|
121
|
+
self._debug['methods']['end'] = self._io.pos()
|
|
122
|
+
self._debug['attributes_count']['start'] = self._io.pos()
|
|
123
|
+
self.attributes_count = self._io.read_u2be()
|
|
124
|
+
self._debug['attributes_count']['end'] = self._io.pos()
|
|
125
|
+
self._debug['attributes']['start'] = self._io.pos()
|
|
126
|
+
self.attributes = [None] * (self.attributes_count)
|
|
127
|
+
for i in range(self.attributes_count):
|
|
128
|
+
if not 'arr' in self._debug['attributes']:
|
|
129
|
+
self._debug['attributes']['arr'] = []
|
|
130
|
+
self._debug['attributes']['arr'].append({'start': self._io.pos()})
|
|
131
|
+
_t_attributes = JavaClass.AttributeInfo(self._io, self, self._root)
|
|
132
|
+
_t_attributes._read()
|
|
133
|
+
self.attributes[i] = _t_attributes
|
|
134
|
+
self._debug['attributes']['arr'][i]['end'] = self._io.pos()
|
|
135
|
+
|
|
136
|
+
self._debug['attributes']['end'] = self._io.pos()
|
|
137
|
+
|
|
138
|
+
class VersionGuard(KaitaiStruct):
|
|
139
|
+
"""`class` file format version 45.3 (appeared in the very first publicly
|
|
140
|
+
known release of Java SE AND JDK 1.0.2, released 23th January 1996) is so
|
|
141
|
+
ancient that it's taken for granted. Earlier formats seem to be
|
|
142
|
+
undocumented. Changes of `version_minor` don't change `class` format.
|
|
143
|
+
Earlier `version_major`s likely belong to Oak programming language, the
|
|
144
|
+
proprietary predecessor of Java.
|
|
145
|
+
|
|
146
|
+
.. seealso::
|
|
147
|
+
James Gosling, Bill Joy and Guy Steele. The Java Language Specification. English. Ed. by Lisa Friendly. Addison-Wesley, Aug. 1996, p. 825. ISBN: 0-201-63451-1.
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
.. seealso::
|
|
151
|
+
Frank Yellin and Tim Lindholm. The Java Virtual Machine Specification. English. Ed. by Lisa Friendly. Addison-Wesley, Sept. 1996, p. 475. ISBN: 0-201-63452-X.
|
|
152
|
+
"""
|
|
153
|
+
SEQ_FIELDS = ["_unnamed0"]
|
|
154
|
+
def __init__(self, major, _io, _parent=None, _root=None):
|
|
155
|
+
self._io = _io
|
|
156
|
+
self._parent = _parent
|
|
157
|
+
self._root = _root if _root else self
|
|
158
|
+
self.major = major
|
|
159
|
+
self._debug = collections.defaultdict(dict)
|
|
160
|
+
|
|
161
|
+
def _read(self):
|
|
162
|
+
self._debug['_unnamed0']['start'] = self._io.pos()
|
|
163
|
+
self._unnamed0 = self._io.read_bytes(0)
|
|
164
|
+
self._debug['_unnamed0']['end'] = self._io.pos()
|
|
165
|
+
_ = self.unnamed_0
|
|
166
|
+
if not self._root.version_major >= self.major:
|
|
167
|
+
raise kaitaistruct.ValidationExprError(self.unnamed_0, self._io, u"/types/version_guard/seq/0")
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class FloatCpInfo(KaitaiStruct):
|
|
171
|
+
"""
|
|
172
|
+
.. seealso::
|
|
173
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.5
|
|
174
|
+
"""
|
|
175
|
+
SEQ_FIELDS = ["value"]
|
|
176
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
177
|
+
self._io = _io
|
|
178
|
+
self._parent = _parent
|
|
179
|
+
self._root = _root if _root else self
|
|
180
|
+
self._debug = collections.defaultdict(dict)
|
|
181
|
+
|
|
182
|
+
def _read(self):
|
|
183
|
+
self._debug['value']['start'] = self._io.pos()
|
|
184
|
+
self.value = self._io.read_f4be()
|
|
185
|
+
self._debug['value']['end'] = self._io.pos()
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class AttributeInfo(KaitaiStruct):
|
|
189
|
+
"""
|
|
190
|
+
.. seealso::
|
|
191
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7
|
|
192
|
+
"""
|
|
193
|
+
SEQ_FIELDS = ["name_index", "attribute_length", "info"]
|
|
194
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
195
|
+
self._io = _io
|
|
196
|
+
self._parent = _parent
|
|
197
|
+
self._root = _root if _root else self
|
|
198
|
+
self._debug = collections.defaultdict(dict)
|
|
199
|
+
|
|
200
|
+
def _read(self):
|
|
201
|
+
self._debug['name_index']['start'] = self._io.pos()
|
|
202
|
+
self.name_index = self._io.read_u2be()
|
|
203
|
+
self._debug['name_index']['end'] = self._io.pos()
|
|
204
|
+
self._debug['attribute_length']['start'] = self._io.pos()
|
|
205
|
+
self.attribute_length = self._io.read_u4be()
|
|
206
|
+
self._debug['attribute_length']['end'] = self._io.pos()
|
|
207
|
+
self._debug['info']['start'] = self._io.pos()
|
|
208
|
+
_on = self.name_as_str
|
|
209
|
+
if _on == u"SourceFile":
|
|
210
|
+
self._raw_info = self._io.read_bytes(self.attribute_length)
|
|
211
|
+
_io__raw_info = KaitaiStream(BytesIO(self._raw_info))
|
|
212
|
+
self.info = JavaClass.AttributeInfo.AttrBodySourceFile(_io__raw_info, self, self._root)
|
|
213
|
+
self.info._read()
|
|
214
|
+
elif _on == u"LineNumberTable":
|
|
215
|
+
self._raw_info = self._io.read_bytes(self.attribute_length)
|
|
216
|
+
_io__raw_info = KaitaiStream(BytesIO(self._raw_info))
|
|
217
|
+
self.info = JavaClass.AttributeInfo.AttrBodyLineNumberTable(_io__raw_info, self, self._root)
|
|
218
|
+
self.info._read()
|
|
219
|
+
elif _on == u"Exceptions":
|
|
220
|
+
self._raw_info = self._io.read_bytes(self.attribute_length)
|
|
221
|
+
_io__raw_info = KaitaiStream(BytesIO(self._raw_info))
|
|
222
|
+
self.info = JavaClass.AttributeInfo.AttrBodyExceptions(_io__raw_info, self, self._root)
|
|
223
|
+
self.info._read()
|
|
224
|
+
elif _on == u"Code":
|
|
225
|
+
self._raw_info = self._io.read_bytes(self.attribute_length)
|
|
226
|
+
_io__raw_info = KaitaiStream(BytesIO(self._raw_info))
|
|
227
|
+
self.info = JavaClass.AttributeInfo.AttrBodyCode(_io__raw_info, self, self._root)
|
|
228
|
+
self.info._read()
|
|
229
|
+
else:
|
|
230
|
+
self.info = self._io.read_bytes(self.attribute_length)
|
|
231
|
+
self._debug['info']['end'] = self._io.pos()
|
|
232
|
+
|
|
233
|
+
class AttrBodyCode(KaitaiStruct):
|
|
234
|
+
"""
|
|
235
|
+
.. seealso::
|
|
236
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3
|
|
237
|
+
"""
|
|
238
|
+
SEQ_FIELDS = ["max_stack", "max_locals", "code_length", "code", "exception_table_length", "exception_table", "attributes_count", "attributes"]
|
|
239
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
240
|
+
self._io = _io
|
|
241
|
+
self._parent = _parent
|
|
242
|
+
self._root = _root if _root else self
|
|
243
|
+
self._debug = collections.defaultdict(dict)
|
|
244
|
+
|
|
245
|
+
def _read(self):
|
|
246
|
+
self._debug['max_stack']['start'] = self._io.pos()
|
|
247
|
+
self.max_stack = self._io.read_u2be()
|
|
248
|
+
self._debug['max_stack']['end'] = self._io.pos()
|
|
249
|
+
self._debug['max_locals']['start'] = self._io.pos()
|
|
250
|
+
self.max_locals = self._io.read_u2be()
|
|
251
|
+
self._debug['max_locals']['end'] = self._io.pos()
|
|
252
|
+
self._debug['code_length']['start'] = self._io.pos()
|
|
253
|
+
self.code_length = self._io.read_u4be()
|
|
254
|
+
self._debug['code_length']['end'] = self._io.pos()
|
|
255
|
+
self._debug['code']['start'] = self._io.pos()
|
|
256
|
+
self.code = self._io.read_bytes(self.code_length)
|
|
257
|
+
self._debug['code']['end'] = self._io.pos()
|
|
258
|
+
self._debug['exception_table_length']['start'] = self._io.pos()
|
|
259
|
+
self.exception_table_length = self._io.read_u2be()
|
|
260
|
+
self._debug['exception_table_length']['end'] = self._io.pos()
|
|
261
|
+
self._debug['exception_table']['start'] = self._io.pos()
|
|
262
|
+
self.exception_table = [None] * (self.exception_table_length)
|
|
263
|
+
for i in range(self.exception_table_length):
|
|
264
|
+
if not 'arr' in self._debug['exception_table']:
|
|
265
|
+
self._debug['exception_table']['arr'] = []
|
|
266
|
+
self._debug['exception_table']['arr'].append({'start': self._io.pos()})
|
|
267
|
+
_t_exception_table = JavaClass.AttributeInfo.AttrBodyCode.ExceptionEntry(self._io, self, self._root)
|
|
268
|
+
_t_exception_table._read()
|
|
269
|
+
self.exception_table[i] = _t_exception_table
|
|
270
|
+
self._debug['exception_table']['arr'][i]['end'] = self._io.pos()
|
|
271
|
+
|
|
272
|
+
self._debug['exception_table']['end'] = self._io.pos()
|
|
273
|
+
self._debug['attributes_count']['start'] = self._io.pos()
|
|
274
|
+
self.attributes_count = self._io.read_u2be()
|
|
275
|
+
self._debug['attributes_count']['end'] = self._io.pos()
|
|
276
|
+
self._debug['attributes']['start'] = self._io.pos()
|
|
277
|
+
self.attributes = [None] * (self.attributes_count)
|
|
278
|
+
for i in range(self.attributes_count):
|
|
279
|
+
if not 'arr' in self._debug['attributes']:
|
|
280
|
+
self._debug['attributes']['arr'] = []
|
|
281
|
+
self._debug['attributes']['arr'].append({'start': self._io.pos()})
|
|
282
|
+
_t_attributes = JavaClass.AttributeInfo(self._io, self, self._root)
|
|
283
|
+
_t_attributes._read()
|
|
284
|
+
self.attributes[i] = _t_attributes
|
|
285
|
+
self._debug['attributes']['arr'][i]['end'] = self._io.pos()
|
|
286
|
+
|
|
287
|
+
self._debug['attributes']['end'] = self._io.pos()
|
|
288
|
+
|
|
289
|
+
class ExceptionEntry(KaitaiStruct):
|
|
290
|
+
"""
|
|
291
|
+
.. seealso::
|
|
292
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3
|
|
293
|
+
"""
|
|
294
|
+
SEQ_FIELDS = ["start_pc", "end_pc", "handler_pc", "catch_type"]
|
|
295
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
296
|
+
self._io = _io
|
|
297
|
+
self._parent = _parent
|
|
298
|
+
self._root = _root if _root else self
|
|
299
|
+
self._debug = collections.defaultdict(dict)
|
|
300
|
+
|
|
301
|
+
def _read(self):
|
|
302
|
+
self._debug['start_pc']['start'] = self._io.pos()
|
|
303
|
+
self.start_pc = self._io.read_u2be()
|
|
304
|
+
self._debug['start_pc']['end'] = self._io.pos()
|
|
305
|
+
self._debug['end_pc']['start'] = self._io.pos()
|
|
306
|
+
self.end_pc = self._io.read_u2be()
|
|
307
|
+
self._debug['end_pc']['end'] = self._io.pos()
|
|
308
|
+
self._debug['handler_pc']['start'] = self._io.pos()
|
|
309
|
+
self.handler_pc = self._io.read_u2be()
|
|
310
|
+
self._debug['handler_pc']['end'] = self._io.pos()
|
|
311
|
+
self._debug['catch_type']['start'] = self._io.pos()
|
|
312
|
+
self.catch_type = self._io.read_u2be()
|
|
313
|
+
self._debug['catch_type']['end'] = self._io.pos()
|
|
314
|
+
|
|
315
|
+
@property
|
|
316
|
+
def catch_exception(self):
|
|
317
|
+
if hasattr(self, '_m_catch_exception'):
|
|
318
|
+
return self._m_catch_exception if hasattr(self, '_m_catch_exception') else None
|
|
319
|
+
|
|
320
|
+
if self.catch_type != 0:
|
|
321
|
+
self._m_catch_exception = self._root.constant_pool[(self.catch_type - 1)]
|
|
322
|
+
|
|
323
|
+
return self._m_catch_exception if hasattr(self, '_m_catch_exception') else None
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
class AttrBodyExceptions(KaitaiStruct):
|
|
328
|
+
"""
|
|
329
|
+
.. seealso::
|
|
330
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.5
|
|
331
|
+
"""
|
|
332
|
+
SEQ_FIELDS = ["number_of_exceptions", "exceptions"]
|
|
333
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
334
|
+
self._io = _io
|
|
335
|
+
self._parent = _parent
|
|
336
|
+
self._root = _root if _root else self
|
|
337
|
+
self._debug = collections.defaultdict(dict)
|
|
338
|
+
|
|
339
|
+
def _read(self):
|
|
340
|
+
self._debug['number_of_exceptions']['start'] = self._io.pos()
|
|
341
|
+
self.number_of_exceptions = self._io.read_u2be()
|
|
342
|
+
self._debug['number_of_exceptions']['end'] = self._io.pos()
|
|
343
|
+
self._debug['exceptions']['start'] = self._io.pos()
|
|
344
|
+
self.exceptions = [None] * (self.number_of_exceptions)
|
|
345
|
+
for i in range(self.number_of_exceptions):
|
|
346
|
+
if not 'arr' in self._debug['exceptions']:
|
|
347
|
+
self._debug['exceptions']['arr'] = []
|
|
348
|
+
self._debug['exceptions']['arr'].append({'start': self._io.pos()})
|
|
349
|
+
_t_exceptions = JavaClass.AttributeInfo.AttrBodyExceptions.ExceptionTableEntry(self._io, self, self._root)
|
|
350
|
+
_t_exceptions._read()
|
|
351
|
+
self.exceptions[i] = _t_exceptions
|
|
352
|
+
self._debug['exceptions']['arr'][i]['end'] = self._io.pos()
|
|
353
|
+
|
|
354
|
+
self._debug['exceptions']['end'] = self._io.pos()
|
|
355
|
+
|
|
356
|
+
class ExceptionTableEntry(KaitaiStruct):
|
|
357
|
+
SEQ_FIELDS = ["index"]
|
|
358
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
359
|
+
self._io = _io
|
|
360
|
+
self._parent = _parent
|
|
361
|
+
self._root = _root if _root else self
|
|
362
|
+
self._debug = collections.defaultdict(dict)
|
|
363
|
+
|
|
364
|
+
def _read(self):
|
|
365
|
+
self._debug['index']['start'] = self._io.pos()
|
|
366
|
+
self.index = self._io.read_u2be()
|
|
367
|
+
self._debug['index']['end'] = self._io.pos()
|
|
368
|
+
|
|
369
|
+
@property
|
|
370
|
+
def as_info(self):
|
|
371
|
+
if hasattr(self, '_m_as_info'):
|
|
372
|
+
return self._m_as_info if hasattr(self, '_m_as_info') else None
|
|
373
|
+
|
|
374
|
+
self._m_as_info = self._root.constant_pool[(self.index - 1)].cp_info
|
|
375
|
+
return self._m_as_info if hasattr(self, '_m_as_info') else None
|
|
376
|
+
|
|
377
|
+
@property
|
|
378
|
+
def name_as_str(self):
|
|
379
|
+
if hasattr(self, '_m_name_as_str'):
|
|
380
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
381
|
+
|
|
382
|
+
self._m_name_as_str = self.as_info.name_as_str
|
|
383
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
class AttrBodySourceFile(KaitaiStruct):
|
|
388
|
+
"""
|
|
389
|
+
.. seealso::
|
|
390
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.10
|
|
391
|
+
"""
|
|
392
|
+
SEQ_FIELDS = ["sourcefile_index"]
|
|
393
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
394
|
+
self._io = _io
|
|
395
|
+
self._parent = _parent
|
|
396
|
+
self._root = _root if _root else self
|
|
397
|
+
self._debug = collections.defaultdict(dict)
|
|
398
|
+
|
|
399
|
+
def _read(self):
|
|
400
|
+
self._debug['sourcefile_index']['start'] = self._io.pos()
|
|
401
|
+
self.sourcefile_index = self._io.read_u2be()
|
|
402
|
+
self._debug['sourcefile_index']['end'] = self._io.pos()
|
|
403
|
+
|
|
404
|
+
@property
|
|
405
|
+
def sourcefile_as_str(self):
|
|
406
|
+
if hasattr(self, '_m_sourcefile_as_str'):
|
|
407
|
+
return self._m_sourcefile_as_str if hasattr(self, '_m_sourcefile_as_str') else None
|
|
408
|
+
|
|
409
|
+
self._m_sourcefile_as_str = self._root.constant_pool[(self.sourcefile_index - 1)].cp_info.value
|
|
410
|
+
return self._m_sourcefile_as_str if hasattr(self, '_m_sourcefile_as_str') else None
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
class AttrBodyLineNumberTable(KaitaiStruct):
|
|
414
|
+
"""
|
|
415
|
+
.. seealso::
|
|
416
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.12
|
|
417
|
+
"""
|
|
418
|
+
SEQ_FIELDS = ["line_number_table_length", "line_number_table"]
|
|
419
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
420
|
+
self._io = _io
|
|
421
|
+
self._parent = _parent
|
|
422
|
+
self._root = _root if _root else self
|
|
423
|
+
self._debug = collections.defaultdict(dict)
|
|
424
|
+
|
|
425
|
+
def _read(self):
|
|
426
|
+
self._debug['line_number_table_length']['start'] = self._io.pos()
|
|
427
|
+
self.line_number_table_length = self._io.read_u2be()
|
|
428
|
+
self._debug['line_number_table_length']['end'] = self._io.pos()
|
|
429
|
+
self._debug['line_number_table']['start'] = self._io.pos()
|
|
430
|
+
self.line_number_table = [None] * (self.line_number_table_length)
|
|
431
|
+
for i in range(self.line_number_table_length):
|
|
432
|
+
if not 'arr' in self._debug['line_number_table']:
|
|
433
|
+
self._debug['line_number_table']['arr'] = []
|
|
434
|
+
self._debug['line_number_table']['arr'].append({'start': self._io.pos()})
|
|
435
|
+
_t_line_number_table = JavaClass.AttributeInfo.AttrBodyLineNumberTable.LineNumberTableEntry(self._io, self, self._root)
|
|
436
|
+
_t_line_number_table._read()
|
|
437
|
+
self.line_number_table[i] = _t_line_number_table
|
|
438
|
+
self._debug['line_number_table']['arr'][i]['end'] = self._io.pos()
|
|
439
|
+
|
|
440
|
+
self._debug['line_number_table']['end'] = self._io.pos()
|
|
441
|
+
|
|
442
|
+
class LineNumberTableEntry(KaitaiStruct):
|
|
443
|
+
SEQ_FIELDS = ["start_pc", "line_number"]
|
|
444
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
445
|
+
self._io = _io
|
|
446
|
+
self._parent = _parent
|
|
447
|
+
self._root = _root if _root else self
|
|
448
|
+
self._debug = collections.defaultdict(dict)
|
|
449
|
+
|
|
450
|
+
def _read(self):
|
|
451
|
+
self._debug['start_pc']['start'] = self._io.pos()
|
|
452
|
+
self.start_pc = self._io.read_u2be()
|
|
453
|
+
self._debug['start_pc']['end'] = self._io.pos()
|
|
454
|
+
self._debug['line_number']['start'] = self._io.pos()
|
|
455
|
+
self.line_number = self._io.read_u2be()
|
|
456
|
+
self._debug['line_number']['end'] = self._io.pos()
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
@property
|
|
461
|
+
def name_as_str(self):
|
|
462
|
+
if hasattr(self, '_m_name_as_str'):
|
|
463
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
464
|
+
|
|
465
|
+
self._m_name_as_str = self._root.constant_pool[(self.name_index - 1)].cp_info.value
|
|
466
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
class MethodRefCpInfo(KaitaiStruct):
|
|
470
|
+
"""
|
|
471
|
+
.. seealso::
|
|
472
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2
|
|
473
|
+
"""
|
|
474
|
+
SEQ_FIELDS = ["class_index", "name_and_type_index"]
|
|
475
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
476
|
+
self._io = _io
|
|
477
|
+
self._parent = _parent
|
|
478
|
+
self._root = _root if _root else self
|
|
479
|
+
self._debug = collections.defaultdict(dict)
|
|
480
|
+
|
|
481
|
+
def _read(self):
|
|
482
|
+
self._debug['class_index']['start'] = self._io.pos()
|
|
483
|
+
self.class_index = self._io.read_u2be()
|
|
484
|
+
self._debug['class_index']['end'] = self._io.pos()
|
|
485
|
+
self._debug['name_and_type_index']['start'] = self._io.pos()
|
|
486
|
+
self.name_and_type_index = self._io.read_u2be()
|
|
487
|
+
self._debug['name_and_type_index']['end'] = self._io.pos()
|
|
488
|
+
|
|
489
|
+
@property
|
|
490
|
+
def class_as_info(self):
|
|
491
|
+
if hasattr(self, '_m_class_as_info'):
|
|
492
|
+
return self._m_class_as_info if hasattr(self, '_m_class_as_info') else None
|
|
493
|
+
|
|
494
|
+
self._m_class_as_info = self._root.constant_pool[(self.class_index - 1)].cp_info
|
|
495
|
+
return self._m_class_as_info if hasattr(self, '_m_class_as_info') else None
|
|
496
|
+
|
|
497
|
+
@property
|
|
498
|
+
def name_and_type_as_info(self):
|
|
499
|
+
if hasattr(self, '_m_name_and_type_as_info'):
|
|
500
|
+
return self._m_name_and_type_as_info if hasattr(self, '_m_name_and_type_as_info') else None
|
|
501
|
+
|
|
502
|
+
self._m_name_and_type_as_info = self._root.constant_pool[(self.name_and_type_index - 1)].cp_info
|
|
503
|
+
return self._m_name_and_type_as_info if hasattr(self, '_m_name_and_type_as_info') else None
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
class FieldInfo(KaitaiStruct):
|
|
507
|
+
"""
|
|
508
|
+
.. seealso::
|
|
509
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5
|
|
510
|
+
"""
|
|
511
|
+
SEQ_FIELDS = ["access_flags", "name_index", "descriptor_index", "attributes_count", "attributes"]
|
|
512
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
513
|
+
self._io = _io
|
|
514
|
+
self._parent = _parent
|
|
515
|
+
self._root = _root if _root else self
|
|
516
|
+
self._debug = collections.defaultdict(dict)
|
|
517
|
+
|
|
518
|
+
def _read(self):
|
|
519
|
+
self._debug['access_flags']['start'] = self._io.pos()
|
|
520
|
+
self.access_flags = self._io.read_u2be()
|
|
521
|
+
self._debug['access_flags']['end'] = self._io.pos()
|
|
522
|
+
self._debug['name_index']['start'] = self._io.pos()
|
|
523
|
+
self.name_index = self._io.read_u2be()
|
|
524
|
+
self._debug['name_index']['end'] = self._io.pos()
|
|
525
|
+
self._debug['descriptor_index']['start'] = self._io.pos()
|
|
526
|
+
self.descriptor_index = self._io.read_u2be()
|
|
527
|
+
self._debug['descriptor_index']['end'] = self._io.pos()
|
|
528
|
+
self._debug['attributes_count']['start'] = self._io.pos()
|
|
529
|
+
self.attributes_count = self._io.read_u2be()
|
|
530
|
+
self._debug['attributes_count']['end'] = self._io.pos()
|
|
531
|
+
self._debug['attributes']['start'] = self._io.pos()
|
|
532
|
+
self.attributes = [None] * (self.attributes_count)
|
|
533
|
+
for i in range(self.attributes_count):
|
|
534
|
+
if not 'arr' in self._debug['attributes']:
|
|
535
|
+
self._debug['attributes']['arr'] = []
|
|
536
|
+
self._debug['attributes']['arr'].append({'start': self._io.pos()})
|
|
537
|
+
_t_attributes = JavaClass.AttributeInfo(self._io, self, self._root)
|
|
538
|
+
_t_attributes._read()
|
|
539
|
+
self.attributes[i] = _t_attributes
|
|
540
|
+
self._debug['attributes']['arr'][i]['end'] = self._io.pos()
|
|
541
|
+
|
|
542
|
+
self._debug['attributes']['end'] = self._io.pos()
|
|
543
|
+
|
|
544
|
+
@property
|
|
545
|
+
def name_as_str(self):
|
|
546
|
+
if hasattr(self, '_m_name_as_str'):
|
|
547
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
548
|
+
|
|
549
|
+
self._m_name_as_str = self._root.constant_pool[(self.name_index - 1)].cp_info.value
|
|
550
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
class DoubleCpInfo(KaitaiStruct):
|
|
554
|
+
"""
|
|
555
|
+
.. seealso::
|
|
556
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.6
|
|
557
|
+
"""
|
|
558
|
+
SEQ_FIELDS = ["value"]
|
|
559
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
560
|
+
self._io = _io
|
|
561
|
+
self._parent = _parent
|
|
562
|
+
self._root = _root if _root else self
|
|
563
|
+
self._debug = collections.defaultdict(dict)
|
|
564
|
+
|
|
565
|
+
def _read(self):
|
|
566
|
+
self._debug['value']['start'] = self._io.pos()
|
|
567
|
+
self.value = self._io.read_f8be()
|
|
568
|
+
self._debug['value']['end'] = self._io.pos()
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class DynamicCpInfo(KaitaiStruct):
|
|
572
|
+
"""
|
|
573
|
+
.. seealso::
|
|
574
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html#jvms-4.4.10
|
|
575
|
+
"""
|
|
576
|
+
SEQ_FIELDS = ["_unnamed0", "bootstrap_method_attr_index", "name_and_type_index"]
|
|
577
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
578
|
+
self._io = _io
|
|
579
|
+
self._parent = _parent
|
|
580
|
+
self._root = _root if _root else self
|
|
581
|
+
self._debug = collections.defaultdict(dict)
|
|
582
|
+
|
|
583
|
+
def _read(self):
|
|
584
|
+
self._debug['_unnamed0']['start'] = self._io.pos()
|
|
585
|
+
self._unnamed0 = JavaClass.VersionGuard(55, self._io, self, self._root)
|
|
586
|
+
self._unnamed0._read()
|
|
587
|
+
self._debug['_unnamed0']['end'] = self._io.pos()
|
|
588
|
+
self._debug['bootstrap_method_attr_index']['start'] = self._io.pos()
|
|
589
|
+
self.bootstrap_method_attr_index = self._io.read_u2be()
|
|
590
|
+
self._debug['bootstrap_method_attr_index']['end'] = self._io.pos()
|
|
591
|
+
self._debug['name_and_type_index']['start'] = self._io.pos()
|
|
592
|
+
self.name_and_type_index = self._io.read_u2be()
|
|
593
|
+
self._debug['name_and_type_index']['end'] = self._io.pos()
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
class LongCpInfo(KaitaiStruct):
|
|
597
|
+
"""
|
|
598
|
+
.. seealso::
|
|
599
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.5
|
|
600
|
+
"""
|
|
601
|
+
SEQ_FIELDS = ["value"]
|
|
602
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
603
|
+
self._io = _io
|
|
604
|
+
self._parent = _parent
|
|
605
|
+
self._root = _root if _root else self
|
|
606
|
+
self._debug = collections.defaultdict(dict)
|
|
607
|
+
|
|
608
|
+
def _read(self):
|
|
609
|
+
self._debug['value']['start'] = self._io.pos()
|
|
610
|
+
self.value = self._io.read_u8be()
|
|
611
|
+
self._debug['value']['end'] = self._io.pos()
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
class InvokeDynamicCpInfo(KaitaiStruct):
|
|
615
|
+
"""
|
|
616
|
+
.. seealso::
|
|
617
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.10
|
|
618
|
+
"""
|
|
619
|
+
SEQ_FIELDS = ["_unnamed0", "bootstrap_method_attr_index", "name_and_type_index"]
|
|
620
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
621
|
+
self._io = _io
|
|
622
|
+
self._parent = _parent
|
|
623
|
+
self._root = _root if _root else self
|
|
624
|
+
self._debug = collections.defaultdict(dict)
|
|
625
|
+
|
|
626
|
+
def _read(self):
|
|
627
|
+
self._debug['_unnamed0']['start'] = self._io.pos()
|
|
628
|
+
self._unnamed0 = JavaClass.VersionGuard(51, self._io, self, self._root)
|
|
629
|
+
self._unnamed0._read()
|
|
630
|
+
self._debug['_unnamed0']['end'] = self._io.pos()
|
|
631
|
+
self._debug['bootstrap_method_attr_index']['start'] = self._io.pos()
|
|
632
|
+
self.bootstrap_method_attr_index = self._io.read_u2be()
|
|
633
|
+
self._debug['bootstrap_method_attr_index']['end'] = self._io.pos()
|
|
634
|
+
self._debug['name_and_type_index']['start'] = self._io.pos()
|
|
635
|
+
self.name_and_type_index = self._io.read_u2be()
|
|
636
|
+
self._debug['name_and_type_index']['end'] = self._io.pos()
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
class MethodHandleCpInfo(KaitaiStruct):
|
|
640
|
+
"""
|
|
641
|
+
.. seealso::
|
|
642
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.8
|
|
643
|
+
"""
|
|
644
|
+
|
|
645
|
+
class ReferenceKindEnum(Enum):
|
|
646
|
+
get_field = 1
|
|
647
|
+
get_static = 2
|
|
648
|
+
put_field = 3
|
|
649
|
+
put_static = 4
|
|
650
|
+
invoke_virtual = 5
|
|
651
|
+
invoke_static = 6
|
|
652
|
+
invoke_special = 7
|
|
653
|
+
new_invoke_special = 8
|
|
654
|
+
invoke_interface = 9
|
|
655
|
+
SEQ_FIELDS = ["_unnamed0", "reference_kind", "reference_index"]
|
|
656
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
657
|
+
self._io = _io
|
|
658
|
+
self._parent = _parent
|
|
659
|
+
self._root = _root if _root else self
|
|
660
|
+
self._debug = collections.defaultdict(dict)
|
|
661
|
+
|
|
662
|
+
def _read(self):
|
|
663
|
+
self._debug['_unnamed0']['start'] = self._io.pos()
|
|
664
|
+
self._unnamed0 = JavaClass.VersionGuard(51, self._io, self, self._root)
|
|
665
|
+
self._unnamed0._read()
|
|
666
|
+
self._debug['_unnamed0']['end'] = self._io.pos()
|
|
667
|
+
self._debug['reference_kind']['start'] = self._io.pos()
|
|
668
|
+
self.reference_kind = KaitaiStream.resolve_enum(JavaClass.MethodHandleCpInfo.ReferenceKindEnum, self._io.read_u1())
|
|
669
|
+
self._debug['reference_kind']['end'] = self._io.pos()
|
|
670
|
+
self._debug['reference_index']['start'] = self._io.pos()
|
|
671
|
+
self.reference_index = self._io.read_u2be()
|
|
672
|
+
self._debug['reference_index']['end'] = self._io.pos()
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
class ModulePackageCpInfo(KaitaiStruct):
|
|
676
|
+
"""Project Jigsaw modules introduced in Java 9
|
|
677
|
+
|
|
678
|
+
.. seealso::
|
|
679
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-3.html#jvms-3.16
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
.. seealso::
|
|
683
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html#jvms-4.4.11
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
.. seealso::
|
|
687
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html#jvms-4.4.12
|
|
688
|
+
"""
|
|
689
|
+
SEQ_FIELDS = ["_unnamed0", "name_index"]
|
|
690
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
691
|
+
self._io = _io
|
|
692
|
+
self._parent = _parent
|
|
693
|
+
self._root = _root if _root else self
|
|
694
|
+
self._debug = collections.defaultdict(dict)
|
|
695
|
+
|
|
696
|
+
def _read(self):
|
|
697
|
+
self._debug['_unnamed0']['start'] = self._io.pos()
|
|
698
|
+
self._unnamed0 = JavaClass.VersionGuard(53, self._io, self, self._root)
|
|
699
|
+
self._unnamed0._read()
|
|
700
|
+
self._debug['_unnamed0']['end'] = self._io.pos()
|
|
701
|
+
self._debug['name_index']['start'] = self._io.pos()
|
|
702
|
+
self.name_index = self._io.read_u2be()
|
|
703
|
+
self._debug['name_index']['end'] = self._io.pos()
|
|
704
|
+
|
|
705
|
+
@property
|
|
706
|
+
def name_as_info(self):
|
|
707
|
+
if hasattr(self, '_m_name_as_info'):
|
|
708
|
+
return self._m_name_as_info if hasattr(self, '_m_name_as_info') else None
|
|
709
|
+
|
|
710
|
+
self._m_name_as_info = self._root.constant_pool[(self.name_index - 1)].cp_info
|
|
711
|
+
return self._m_name_as_info if hasattr(self, '_m_name_as_info') else None
|
|
712
|
+
|
|
713
|
+
@property
|
|
714
|
+
def name_as_str(self):
|
|
715
|
+
if hasattr(self, '_m_name_as_str'):
|
|
716
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
717
|
+
|
|
718
|
+
self._m_name_as_str = self.name_as_info.value
|
|
719
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
class NameAndTypeCpInfo(KaitaiStruct):
|
|
723
|
+
"""
|
|
724
|
+
.. seealso::
|
|
725
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.6
|
|
726
|
+
"""
|
|
727
|
+
SEQ_FIELDS = ["name_index", "descriptor_index"]
|
|
728
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
729
|
+
self._io = _io
|
|
730
|
+
self._parent = _parent
|
|
731
|
+
self._root = _root if _root else self
|
|
732
|
+
self._debug = collections.defaultdict(dict)
|
|
733
|
+
|
|
734
|
+
def _read(self):
|
|
735
|
+
self._debug['name_index']['start'] = self._io.pos()
|
|
736
|
+
self.name_index = self._io.read_u2be()
|
|
737
|
+
self._debug['name_index']['end'] = self._io.pos()
|
|
738
|
+
self._debug['descriptor_index']['start'] = self._io.pos()
|
|
739
|
+
self.descriptor_index = self._io.read_u2be()
|
|
740
|
+
self._debug['descriptor_index']['end'] = self._io.pos()
|
|
741
|
+
|
|
742
|
+
@property
|
|
743
|
+
def name_as_info(self):
|
|
744
|
+
if hasattr(self, '_m_name_as_info'):
|
|
745
|
+
return self._m_name_as_info if hasattr(self, '_m_name_as_info') else None
|
|
746
|
+
|
|
747
|
+
self._m_name_as_info = self._root.constant_pool[(self.name_index - 1)].cp_info
|
|
748
|
+
return self._m_name_as_info if hasattr(self, '_m_name_as_info') else None
|
|
749
|
+
|
|
750
|
+
@property
|
|
751
|
+
def name_as_str(self):
|
|
752
|
+
if hasattr(self, '_m_name_as_str'):
|
|
753
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
754
|
+
|
|
755
|
+
self._m_name_as_str = self.name_as_info.value
|
|
756
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
757
|
+
|
|
758
|
+
@property
|
|
759
|
+
def descriptor_as_info(self):
|
|
760
|
+
if hasattr(self, '_m_descriptor_as_info'):
|
|
761
|
+
return self._m_descriptor_as_info if hasattr(self, '_m_descriptor_as_info') else None
|
|
762
|
+
|
|
763
|
+
self._m_descriptor_as_info = self._root.constant_pool[(self.descriptor_index - 1)].cp_info
|
|
764
|
+
return self._m_descriptor_as_info if hasattr(self, '_m_descriptor_as_info') else None
|
|
765
|
+
|
|
766
|
+
@property
|
|
767
|
+
def descriptor_as_str(self):
|
|
768
|
+
if hasattr(self, '_m_descriptor_as_str'):
|
|
769
|
+
return self._m_descriptor_as_str if hasattr(self, '_m_descriptor_as_str') else None
|
|
770
|
+
|
|
771
|
+
self._m_descriptor_as_str = self.descriptor_as_info.value
|
|
772
|
+
return self._m_descriptor_as_str if hasattr(self, '_m_descriptor_as_str') else None
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
class Utf8CpInfo(KaitaiStruct):
|
|
776
|
+
"""
|
|
777
|
+
.. seealso::
|
|
778
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.7
|
|
779
|
+
"""
|
|
780
|
+
SEQ_FIELDS = ["str_len", "value"]
|
|
781
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
782
|
+
self._io = _io
|
|
783
|
+
self._parent = _parent
|
|
784
|
+
self._root = _root if _root else self
|
|
785
|
+
self._debug = collections.defaultdict(dict)
|
|
786
|
+
|
|
787
|
+
def _read(self):
|
|
788
|
+
self._debug['str_len']['start'] = self._io.pos()
|
|
789
|
+
self.str_len = self._io.read_u2be()
|
|
790
|
+
self._debug['str_len']['end'] = self._io.pos()
|
|
791
|
+
self._debug['value']['start'] = self._io.pos()
|
|
792
|
+
self.value = (self._io.read_bytes(self.str_len)).decode(u"UTF-8")
|
|
793
|
+
self._debug['value']['end'] = self._io.pos()
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
class StringCpInfo(KaitaiStruct):
|
|
797
|
+
"""
|
|
798
|
+
.. seealso::
|
|
799
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.3
|
|
800
|
+
"""
|
|
801
|
+
SEQ_FIELDS = ["string_index"]
|
|
802
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
803
|
+
self._io = _io
|
|
804
|
+
self._parent = _parent
|
|
805
|
+
self._root = _root if _root else self
|
|
806
|
+
self._debug = collections.defaultdict(dict)
|
|
807
|
+
|
|
808
|
+
def _read(self):
|
|
809
|
+
self._debug['string_index']['start'] = self._io.pos()
|
|
810
|
+
self.string_index = self._io.read_u2be()
|
|
811
|
+
self._debug['string_index']['end'] = self._io.pos()
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
class MethodTypeCpInfo(KaitaiStruct):
|
|
815
|
+
"""
|
|
816
|
+
.. seealso::
|
|
817
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.9
|
|
818
|
+
"""
|
|
819
|
+
SEQ_FIELDS = ["_unnamed0", "descriptor_index"]
|
|
820
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
821
|
+
self._io = _io
|
|
822
|
+
self._parent = _parent
|
|
823
|
+
self._root = _root if _root else self
|
|
824
|
+
self._debug = collections.defaultdict(dict)
|
|
825
|
+
|
|
826
|
+
def _read(self):
|
|
827
|
+
self._debug['_unnamed0']['start'] = self._io.pos()
|
|
828
|
+
self._unnamed0 = JavaClass.VersionGuard(51, self._io, self, self._root)
|
|
829
|
+
self._unnamed0._read()
|
|
830
|
+
self._debug['_unnamed0']['end'] = self._io.pos()
|
|
831
|
+
self._debug['descriptor_index']['start'] = self._io.pos()
|
|
832
|
+
self.descriptor_index = self._io.read_u2be()
|
|
833
|
+
self._debug['descriptor_index']['end'] = self._io.pos()
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
class InterfaceMethodRefCpInfo(KaitaiStruct):
|
|
837
|
+
"""
|
|
838
|
+
.. seealso::
|
|
839
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2
|
|
840
|
+
"""
|
|
841
|
+
SEQ_FIELDS = ["class_index", "name_and_type_index"]
|
|
842
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
843
|
+
self._io = _io
|
|
844
|
+
self._parent = _parent
|
|
845
|
+
self._root = _root if _root else self
|
|
846
|
+
self._debug = collections.defaultdict(dict)
|
|
847
|
+
|
|
848
|
+
def _read(self):
|
|
849
|
+
self._debug['class_index']['start'] = self._io.pos()
|
|
850
|
+
self.class_index = self._io.read_u2be()
|
|
851
|
+
self._debug['class_index']['end'] = self._io.pos()
|
|
852
|
+
self._debug['name_and_type_index']['start'] = self._io.pos()
|
|
853
|
+
self.name_and_type_index = self._io.read_u2be()
|
|
854
|
+
self._debug['name_and_type_index']['end'] = self._io.pos()
|
|
855
|
+
|
|
856
|
+
@property
|
|
857
|
+
def class_as_info(self):
|
|
858
|
+
if hasattr(self, '_m_class_as_info'):
|
|
859
|
+
return self._m_class_as_info if hasattr(self, '_m_class_as_info') else None
|
|
860
|
+
|
|
861
|
+
self._m_class_as_info = self._root.constant_pool[(self.class_index - 1)].cp_info
|
|
862
|
+
return self._m_class_as_info if hasattr(self, '_m_class_as_info') else None
|
|
863
|
+
|
|
864
|
+
@property
|
|
865
|
+
def name_and_type_as_info(self):
|
|
866
|
+
if hasattr(self, '_m_name_and_type_as_info'):
|
|
867
|
+
return self._m_name_and_type_as_info if hasattr(self, '_m_name_and_type_as_info') else None
|
|
868
|
+
|
|
869
|
+
self._m_name_and_type_as_info = self._root.constant_pool[(self.name_and_type_index - 1)].cp_info
|
|
870
|
+
return self._m_name_and_type_as_info if hasattr(self, '_m_name_and_type_as_info') else None
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
class ClassCpInfo(KaitaiStruct):
|
|
874
|
+
"""
|
|
875
|
+
.. seealso::
|
|
876
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.1
|
|
877
|
+
"""
|
|
878
|
+
SEQ_FIELDS = ["name_index"]
|
|
879
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
880
|
+
self._io = _io
|
|
881
|
+
self._parent = _parent
|
|
882
|
+
self._root = _root if _root else self
|
|
883
|
+
self._debug = collections.defaultdict(dict)
|
|
884
|
+
|
|
885
|
+
def _read(self):
|
|
886
|
+
self._debug['name_index']['start'] = self._io.pos()
|
|
887
|
+
self.name_index = self._io.read_u2be()
|
|
888
|
+
self._debug['name_index']['end'] = self._io.pos()
|
|
889
|
+
|
|
890
|
+
@property
|
|
891
|
+
def name_as_info(self):
|
|
892
|
+
if hasattr(self, '_m_name_as_info'):
|
|
893
|
+
return self._m_name_as_info if hasattr(self, '_m_name_as_info') else None
|
|
894
|
+
|
|
895
|
+
self._m_name_as_info = self._root.constant_pool[(self.name_index - 1)].cp_info
|
|
896
|
+
return self._m_name_as_info if hasattr(self, '_m_name_as_info') else None
|
|
897
|
+
|
|
898
|
+
@property
|
|
899
|
+
def name_as_str(self):
|
|
900
|
+
if hasattr(self, '_m_name_as_str'):
|
|
901
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
902
|
+
|
|
903
|
+
self._m_name_as_str = self.name_as_info.value
|
|
904
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
class ConstantPoolEntry(KaitaiStruct):
|
|
908
|
+
"""
|
|
909
|
+
.. seealso::
|
|
910
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4
|
|
911
|
+
"""
|
|
912
|
+
|
|
913
|
+
class TagEnum(Enum):
|
|
914
|
+
utf8 = 1
|
|
915
|
+
integer = 3
|
|
916
|
+
float = 4
|
|
917
|
+
long = 5
|
|
918
|
+
double = 6
|
|
919
|
+
class_type = 7
|
|
920
|
+
string = 8
|
|
921
|
+
field_ref = 9
|
|
922
|
+
method_ref = 10
|
|
923
|
+
interface_method_ref = 11
|
|
924
|
+
name_and_type = 12
|
|
925
|
+
method_handle = 15
|
|
926
|
+
method_type = 16
|
|
927
|
+
dynamic = 17
|
|
928
|
+
invoke_dynamic = 18
|
|
929
|
+
module = 19
|
|
930
|
+
package = 20
|
|
931
|
+
SEQ_FIELDS = ["tag", "cp_info"]
|
|
932
|
+
def __init__(self, is_prev_two_entries, _io, _parent=None, _root=None):
|
|
933
|
+
self._io = _io
|
|
934
|
+
self._parent = _parent
|
|
935
|
+
self._root = _root if _root else self
|
|
936
|
+
self.is_prev_two_entries = is_prev_two_entries
|
|
937
|
+
self._debug = collections.defaultdict(dict)
|
|
938
|
+
|
|
939
|
+
def _read(self):
|
|
940
|
+
if not (self.is_prev_two_entries):
|
|
941
|
+
self._debug['tag']['start'] = self._io.pos()
|
|
942
|
+
self.tag = KaitaiStream.resolve_enum(JavaClass.ConstantPoolEntry.TagEnum, self._io.read_u1())
|
|
943
|
+
self._debug['tag']['end'] = self._io.pos()
|
|
944
|
+
|
|
945
|
+
if not (self.is_prev_two_entries):
|
|
946
|
+
self._debug['cp_info']['start'] = self._io.pos()
|
|
947
|
+
_on = self.tag
|
|
948
|
+
if _on == JavaClass.ConstantPoolEntry.TagEnum.interface_method_ref:
|
|
949
|
+
self.cp_info = JavaClass.InterfaceMethodRefCpInfo(self._io, self, self._root)
|
|
950
|
+
self.cp_info._read()
|
|
951
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.class_type:
|
|
952
|
+
self.cp_info = JavaClass.ClassCpInfo(self._io, self, self._root)
|
|
953
|
+
self.cp_info._read()
|
|
954
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.dynamic:
|
|
955
|
+
self.cp_info = JavaClass.DynamicCpInfo(self._io, self, self._root)
|
|
956
|
+
self.cp_info._read()
|
|
957
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.utf8:
|
|
958
|
+
self.cp_info = JavaClass.Utf8CpInfo(self._io, self, self._root)
|
|
959
|
+
self.cp_info._read()
|
|
960
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.method_type:
|
|
961
|
+
self.cp_info = JavaClass.MethodTypeCpInfo(self._io, self, self._root)
|
|
962
|
+
self.cp_info._read()
|
|
963
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.integer:
|
|
964
|
+
self.cp_info = JavaClass.IntegerCpInfo(self._io, self, self._root)
|
|
965
|
+
self.cp_info._read()
|
|
966
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.string:
|
|
967
|
+
self.cp_info = JavaClass.StringCpInfo(self._io, self, self._root)
|
|
968
|
+
self.cp_info._read()
|
|
969
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.float:
|
|
970
|
+
self.cp_info = JavaClass.FloatCpInfo(self._io, self, self._root)
|
|
971
|
+
self.cp_info._read()
|
|
972
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.module:
|
|
973
|
+
self.cp_info = JavaClass.ModulePackageCpInfo(self._io, self, self._root)
|
|
974
|
+
self.cp_info._read()
|
|
975
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.long:
|
|
976
|
+
self.cp_info = JavaClass.LongCpInfo(self._io, self, self._root)
|
|
977
|
+
self.cp_info._read()
|
|
978
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.method_ref:
|
|
979
|
+
self.cp_info = JavaClass.MethodRefCpInfo(self._io, self, self._root)
|
|
980
|
+
self.cp_info._read()
|
|
981
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.double:
|
|
982
|
+
self.cp_info = JavaClass.DoubleCpInfo(self._io, self, self._root)
|
|
983
|
+
self.cp_info._read()
|
|
984
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.invoke_dynamic:
|
|
985
|
+
self.cp_info = JavaClass.InvokeDynamicCpInfo(self._io, self, self._root)
|
|
986
|
+
self.cp_info._read()
|
|
987
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.field_ref:
|
|
988
|
+
self.cp_info = JavaClass.FieldRefCpInfo(self._io, self, self._root)
|
|
989
|
+
self.cp_info._read()
|
|
990
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.method_handle:
|
|
991
|
+
self.cp_info = JavaClass.MethodHandleCpInfo(self._io, self, self._root)
|
|
992
|
+
self.cp_info._read()
|
|
993
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.package:
|
|
994
|
+
self.cp_info = JavaClass.ModulePackageCpInfo(self._io, self, self._root)
|
|
995
|
+
self.cp_info._read()
|
|
996
|
+
elif _on == JavaClass.ConstantPoolEntry.TagEnum.name_and_type:
|
|
997
|
+
self.cp_info = JavaClass.NameAndTypeCpInfo(self._io, self, self._root)
|
|
998
|
+
self.cp_info._read()
|
|
999
|
+
self._debug['cp_info']['end'] = self._io.pos()
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
@property
|
|
1003
|
+
def is_two_entries(self):
|
|
1004
|
+
if hasattr(self, '_m_is_two_entries'):
|
|
1005
|
+
return self._m_is_two_entries if hasattr(self, '_m_is_two_entries') else None
|
|
1006
|
+
|
|
1007
|
+
self._m_is_two_entries = (False if self.is_prev_two_entries else ((self.tag == JavaClass.ConstantPoolEntry.TagEnum.long) or (self.tag == JavaClass.ConstantPoolEntry.TagEnum.double)) )
|
|
1008
|
+
return self._m_is_two_entries if hasattr(self, '_m_is_two_entries') else None
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
class MethodInfo(KaitaiStruct):
|
|
1012
|
+
"""
|
|
1013
|
+
.. seealso::
|
|
1014
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6
|
|
1015
|
+
"""
|
|
1016
|
+
SEQ_FIELDS = ["access_flags", "name_index", "descriptor_index", "attributes_count", "attributes"]
|
|
1017
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
1018
|
+
self._io = _io
|
|
1019
|
+
self._parent = _parent
|
|
1020
|
+
self._root = _root if _root else self
|
|
1021
|
+
self._debug = collections.defaultdict(dict)
|
|
1022
|
+
|
|
1023
|
+
def _read(self):
|
|
1024
|
+
self._debug['access_flags']['start'] = self._io.pos()
|
|
1025
|
+
self.access_flags = self._io.read_u2be()
|
|
1026
|
+
self._debug['access_flags']['end'] = self._io.pos()
|
|
1027
|
+
self._debug['name_index']['start'] = self._io.pos()
|
|
1028
|
+
self.name_index = self._io.read_u2be()
|
|
1029
|
+
self._debug['name_index']['end'] = self._io.pos()
|
|
1030
|
+
self._debug['descriptor_index']['start'] = self._io.pos()
|
|
1031
|
+
self.descriptor_index = self._io.read_u2be()
|
|
1032
|
+
self._debug['descriptor_index']['end'] = self._io.pos()
|
|
1033
|
+
self._debug['attributes_count']['start'] = self._io.pos()
|
|
1034
|
+
self.attributes_count = self._io.read_u2be()
|
|
1035
|
+
self._debug['attributes_count']['end'] = self._io.pos()
|
|
1036
|
+
self._debug['attributes']['start'] = self._io.pos()
|
|
1037
|
+
self.attributes = [None] * (self.attributes_count)
|
|
1038
|
+
for i in range(self.attributes_count):
|
|
1039
|
+
if not 'arr' in self._debug['attributes']:
|
|
1040
|
+
self._debug['attributes']['arr'] = []
|
|
1041
|
+
self._debug['attributes']['arr'].append({'start': self._io.pos()})
|
|
1042
|
+
_t_attributes = JavaClass.AttributeInfo(self._io, self, self._root)
|
|
1043
|
+
_t_attributes._read()
|
|
1044
|
+
self.attributes[i] = _t_attributes
|
|
1045
|
+
self._debug['attributes']['arr'][i]['end'] = self._io.pos()
|
|
1046
|
+
|
|
1047
|
+
self._debug['attributes']['end'] = self._io.pos()
|
|
1048
|
+
|
|
1049
|
+
@property
|
|
1050
|
+
def name_as_str(self):
|
|
1051
|
+
if hasattr(self, '_m_name_as_str'):
|
|
1052
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
1053
|
+
|
|
1054
|
+
self._m_name_as_str = self._root.constant_pool[(self.name_index - 1)].cp_info.value
|
|
1055
|
+
return self._m_name_as_str if hasattr(self, '_m_name_as_str') else None
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
class IntegerCpInfo(KaitaiStruct):
|
|
1059
|
+
"""
|
|
1060
|
+
.. seealso::
|
|
1061
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.4
|
|
1062
|
+
"""
|
|
1063
|
+
SEQ_FIELDS = ["value"]
|
|
1064
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
1065
|
+
self._io = _io
|
|
1066
|
+
self._parent = _parent
|
|
1067
|
+
self._root = _root if _root else self
|
|
1068
|
+
self._debug = collections.defaultdict(dict)
|
|
1069
|
+
|
|
1070
|
+
def _read(self):
|
|
1071
|
+
self._debug['value']['start'] = self._io.pos()
|
|
1072
|
+
self.value = self._io.read_u4be()
|
|
1073
|
+
self._debug['value']['end'] = self._io.pos()
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
class FieldRefCpInfo(KaitaiStruct):
|
|
1077
|
+
"""
|
|
1078
|
+
.. seealso::
|
|
1079
|
+
Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.2
|
|
1080
|
+
"""
|
|
1081
|
+
SEQ_FIELDS = ["class_index", "name_and_type_index"]
|
|
1082
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
1083
|
+
self._io = _io
|
|
1084
|
+
self._parent = _parent
|
|
1085
|
+
self._root = _root if _root else self
|
|
1086
|
+
self._debug = collections.defaultdict(dict)
|
|
1087
|
+
|
|
1088
|
+
def _read(self):
|
|
1089
|
+
self._debug['class_index']['start'] = self._io.pos()
|
|
1090
|
+
self.class_index = self._io.read_u2be()
|
|
1091
|
+
self._debug['class_index']['end'] = self._io.pos()
|
|
1092
|
+
self._debug['name_and_type_index']['start'] = self._io.pos()
|
|
1093
|
+
self.name_and_type_index = self._io.read_u2be()
|
|
1094
|
+
self._debug['name_and_type_index']['end'] = self._io.pos()
|
|
1095
|
+
|
|
1096
|
+
@property
|
|
1097
|
+
def class_as_info(self):
|
|
1098
|
+
if hasattr(self, '_m_class_as_info'):
|
|
1099
|
+
return self._m_class_as_info if hasattr(self, '_m_class_as_info') else None
|
|
1100
|
+
|
|
1101
|
+
self._m_class_as_info = self._root.constant_pool[(self.class_index - 1)].cp_info
|
|
1102
|
+
return self._m_class_as_info if hasattr(self, '_m_class_as_info') else None
|
|
1103
|
+
|
|
1104
|
+
@property
|
|
1105
|
+
def name_and_type_as_info(self):
|
|
1106
|
+
if hasattr(self, '_m_name_and_type_as_info'):
|
|
1107
|
+
return self._m_name_and_type_as_info if hasattr(self, '_m_name_and_type_as_info') else None
|
|
1108
|
+
|
|
1109
|
+
self._m_name_and_type_as_info = self._root.constant_pool[(self.name_and_type_index - 1)].cp_info
|
|
1110
|
+
return self._m_name_and_type_as_info if hasattr(self, '_m_name_and_type_as_info') else None
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
|