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,1086 @@
|
|
|
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
|
+
from enum import Enum
|
|
7
|
+
import collections
|
|
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
|
+
from polyfile.kaitai.parsers import vlq_base128_le
|
|
14
|
+
class Dex(KaitaiStruct):
|
|
15
|
+
"""Android OS applications executables are typically stored in its own
|
|
16
|
+
format, optimized for more efficient execution in Dalvik virtual
|
|
17
|
+
machine.
|
|
18
|
+
|
|
19
|
+
This format is loosely similar to Java .class file format and
|
|
20
|
+
generally holds the similar set of data: i.e. classes, methods,
|
|
21
|
+
fields, annotations, etc.
|
|
22
|
+
|
|
23
|
+
.. seealso::
|
|
24
|
+
Source - https://source.android.com/docs/core/runtime/dex-format
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
class ClassAccessFlags(Enum):
|
|
28
|
+
public = 1
|
|
29
|
+
private = 2
|
|
30
|
+
protected = 4
|
|
31
|
+
static = 8
|
|
32
|
+
final = 16
|
|
33
|
+
interface = 512
|
|
34
|
+
abstract = 1024
|
|
35
|
+
synthetic = 4096
|
|
36
|
+
annotation = 8192
|
|
37
|
+
enum = 16384
|
|
38
|
+
SEQ_FIELDS = ["header"]
|
|
39
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
40
|
+
self._io = _io
|
|
41
|
+
self._parent = _parent
|
|
42
|
+
self._root = _root if _root else self
|
|
43
|
+
self._debug = collections.defaultdict(dict)
|
|
44
|
+
|
|
45
|
+
def _read(self):
|
|
46
|
+
self._debug['header']['start'] = self._io.pos()
|
|
47
|
+
self.header = Dex.HeaderItem(self._io, self, self._root)
|
|
48
|
+
self.header._read()
|
|
49
|
+
self._debug['header']['end'] = self._io.pos()
|
|
50
|
+
|
|
51
|
+
class HeaderItem(KaitaiStruct):
|
|
52
|
+
|
|
53
|
+
class EndianConstant(Enum):
|
|
54
|
+
endian_constant = 305419896
|
|
55
|
+
reverse_endian_constant = 2018915346
|
|
56
|
+
SEQ_FIELDS = ["magic", "version_str", "checksum", "signature", "file_size", "header_size", "endian_tag", "link_size", "link_off", "map_off", "string_ids_size", "string_ids_off", "type_ids_size", "type_ids_off", "proto_ids_size", "proto_ids_off", "field_ids_size", "field_ids_off", "method_ids_size", "method_ids_off", "class_defs_size", "class_defs_off", "data_size", "data_off"]
|
|
57
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
58
|
+
self._io = _io
|
|
59
|
+
self._parent = _parent
|
|
60
|
+
self._root = _root if _root else self
|
|
61
|
+
self._debug = collections.defaultdict(dict)
|
|
62
|
+
|
|
63
|
+
def _read(self):
|
|
64
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
65
|
+
self.magic = self._io.read_bytes(4)
|
|
66
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
67
|
+
if not self.magic == b"\x64\x65\x78\x0A":
|
|
68
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x64\x65\x78\x0A", self.magic, self._io, u"/types/header_item/seq/0")
|
|
69
|
+
self._debug['version_str']['start'] = self._io.pos()
|
|
70
|
+
self.version_str = (KaitaiStream.bytes_terminate(self._io.read_bytes(4), 0, False)).decode(u"ascii")
|
|
71
|
+
self._debug['version_str']['end'] = self._io.pos()
|
|
72
|
+
self._debug['checksum']['start'] = self._io.pos()
|
|
73
|
+
self.checksum = self._io.read_u4le()
|
|
74
|
+
self._debug['checksum']['end'] = self._io.pos()
|
|
75
|
+
self._debug['signature']['start'] = self._io.pos()
|
|
76
|
+
self.signature = self._io.read_bytes(20)
|
|
77
|
+
self._debug['signature']['end'] = self._io.pos()
|
|
78
|
+
self._debug['file_size']['start'] = self._io.pos()
|
|
79
|
+
self.file_size = self._io.read_u4le()
|
|
80
|
+
self._debug['file_size']['end'] = self._io.pos()
|
|
81
|
+
self._debug['header_size']['start'] = self._io.pos()
|
|
82
|
+
self.header_size = self._io.read_u4le()
|
|
83
|
+
self._debug['header_size']['end'] = self._io.pos()
|
|
84
|
+
self._debug['endian_tag']['start'] = self._io.pos()
|
|
85
|
+
self.endian_tag = KaitaiStream.resolve_enum(Dex.HeaderItem.EndianConstant, self._io.read_u4le())
|
|
86
|
+
self._debug['endian_tag']['end'] = self._io.pos()
|
|
87
|
+
self._debug['link_size']['start'] = self._io.pos()
|
|
88
|
+
self.link_size = self._io.read_u4le()
|
|
89
|
+
self._debug['link_size']['end'] = self._io.pos()
|
|
90
|
+
self._debug['link_off']['start'] = self._io.pos()
|
|
91
|
+
self.link_off = self._io.read_u4le()
|
|
92
|
+
self._debug['link_off']['end'] = self._io.pos()
|
|
93
|
+
self._debug['map_off']['start'] = self._io.pos()
|
|
94
|
+
self.map_off = self._io.read_u4le()
|
|
95
|
+
self._debug['map_off']['end'] = self._io.pos()
|
|
96
|
+
self._debug['string_ids_size']['start'] = self._io.pos()
|
|
97
|
+
self.string_ids_size = self._io.read_u4le()
|
|
98
|
+
self._debug['string_ids_size']['end'] = self._io.pos()
|
|
99
|
+
self._debug['string_ids_off']['start'] = self._io.pos()
|
|
100
|
+
self.string_ids_off = self._io.read_u4le()
|
|
101
|
+
self._debug['string_ids_off']['end'] = self._io.pos()
|
|
102
|
+
self._debug['type_ids_size']['start'] = self._io.pos()
|
|
103
|
+
self.type_ids_size = self._io.read_u4le()
|
|
104
|
+
self._debug['type_ids_size']['end'] = self._io.pos()
|
|
105
|
+
self._debug['type_ids_off']['start'] = self._io.pos()
|
|
106
|
+
self.type_ids_off = self._io.read_u4le()
|
|
107
|
+
self._debug['type_ids_off']['end'] = self._io.pos()
|
|
108
|
+
self._debug['proto_ids_size']['start'] = self._io.pos()
|
|
109
|
+
self.proto_ids_size = self._io.read_u4le()
|
|
110
|
+
self._debug['proto_ids_size']['end'] = self._io.pos()
|
|
111
|
+
self._debug['proto_ids_off']['start'] = self._io.pos()
|
|
112
|
+
self.proto_ids_off = self._io.read_u4le()
|
|
113
|
+
self._debug['proto_ids_off']['end'] = self._io.pos()
|
|
114
|
+
self._debug['field_ids_size']['start'] = self._io.pos()
|
|
115
|
+
self.field_ids_size = self._io.read_u4le()
|
|
116
|
+
self._debug['field_ids_size']['end'] = self._io.pos()
|
|
117
|
+
self._debug['field_ids_off']['start'] = self._io.pos()
|
|
118
|
+
self.field_ids_off = self._io.read_u4le()
|
|
119
|
+
self._debug['field_ids_off']['end'] = self._io.pos()
|
|
120
|
+
self._debug['method_ids_size']['start'] = self._io.pos()
|
|
121
|
+
self.method_ids_size = self._io.read_u4le()
|
|
122
|
+
self._debug['method_ids_size']['end'] = self._io.pos()
|
|
123
|
+
self._debug['method_ids_off']['start'] = self._io.pos()
|
|
124
|
+
self.method_ids_off = self._io.read_u4le()
|
|
125
|
+
self._debug['method_ids_off']['end'] = self._io.pos()
|
|
126
|
+
self._debug['class_defs_size']['start'] = self._io.pos()
|
|
127
|
+
self.class_defs_size = self._io.read_u4le()
|
|
128
|
+
self._debug['class_defs_size']['end'] = self._io.pos()
|
|
129
|
+
self._debug['class_defs_off']['start'] = self._io.pos()
|
|
130
|
+
self.class_defs_off = self._io.read_u4le()
|
|
131
|
+
self._debug['class_defs_off']['end'] = self._io.pos()
|
|
132
|
+
self._debug['data_size']['start'] = self._io.pos()
|
|
133
|
+
self.data_size = self._io.read_u4le()
|
|
134
|
+
self._debug['data_size']['end'] = self._io.pos()
|
|
135
|
+
self._debug['data_off']['start'] = self._io.pos()
|
|
136
|
+
self.data_off = self._io.read_u4le()
|
|
137
|
+
self._debug['data_off']['end'] = self._io.pos()
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class MapList(KaitaiStruct):
|
|
141
|
+
SEQ_FIELDS = ["size", "list"]
|
|
142
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
143
|
+
self._io = _io
|
|
144
|
+
self._parent = _parent
|
|
145
|
+
self._root = _root if _root else self
|
|
146
|
+
self._debug = collections.defaultdict(dict)
|
|
147
|
+
|
|
148
|
+
def _read(self):
|
|
149
|
+
self._debug['size']['start'] = self._io.pos()
|
|
150
|
+
self.size = self._io.read_u4le()
|
|
151
|
+
self._debug['size']['end'] = self._io.pos()
|
|
152
|
+
self._debug['list']['start'] = self._io.pos()
|
|
153
|
+
self.list = [None] * (self.size)
|
|
154
|
+
for i in range(self.size):
|
|
155
|
+
if not 'arr' in self._debug['list']:
|
|
156
|
+
self._debug['list']['arr'] = []
|
|
157
|
+
self._debug['list']['arr'].append({'start': self._io.pos()})
|
|
158
|
+
_t_list = Dex.MapItem(self._io, self, self._root)
|
|
159
|
+
_t_list._read()
|
|
160
|
+
self.list[i] = _t_list
|
|
161
|
+
self._debug['list']['arr'][i]['end'] = self._io.pos()
|
|
162
|
+
|
|
163
|
+
self._debug['list']['end'] = self._io.pos()
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class EncodedValue(KaitaiStruct):
|
|
167
|
+
|
|
168
|
+
class ValueTypeEnum(Enum):
|
|
169
|
+
byte = 0
|
|
170
|
+
short = 2
|
|
171
|
+
char = 3
|
|
172
|
+
int = 4
|
|
173
|
+
long = 6
|
|
174
|
+
float = 16
|
|
175
|
+
double = 17
|
|
176
|
+
method_type = 21
|
|
177
|
+
method_handle = 22
|
|
178
|
+
string = 23
|
|
179
|
+
type = 24
|
|
180
|
+
field = 25
|
|
181
|
+
method = 26
|
|
182
|
+
enum = 27
|
|
183
|
+
array = 28
|
|
184
|
+
annotation = 29
|
|
185
|
+
null = 30
|
|
186
|
+
boolean = 31
|
|
187
|
+
SEQ_FIELDS = ["value_arg", "value_type", "value"]
|
|
188
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
189
|
+
self._io = _io
|
|
190
|
+
self._parent = _parent
|
|
191
|
+
self._root = _root if _root else self
|
|
192
|
+
self._debug = collections.defaultdict(dict)
|
|
193
|
+
|
|
194
|
+
def _read(self):
|
|
195
|
+
self._debug['value_arg']['start'] = self._io.pos()
|
|
196
|
+
self.value_arg = self._io.read_bits_int_be(3)
|
|
197
|
+
self._debug['value_arg']['end'] = self._io.pos()
|
|
198
|
+
self._debug['value_type']['start'] = self._io.pos()
|
|
199
|
+
self.value_type = KaitaiStream.resolve_enum(Dex.EncodedValue.ValueTypeEnum, self._io.read_bits_int_be(5))
|
|
200
|
+
self._debug['value_type']['end'] = self._io.pos()
|
|
201
|
+
self._io.align_to_byte()
|
|
202
|
+
self._debug['value']['start'] = self._io.pos()
|
|
203
|
+
_on = self.value_type
|
|
204
|
+
if _on == Dex.EncodedValue.ValueTypeEnum.int:
|
|
205
|
+
self.value = self._io.read_s4le()
|
|
206
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.annotation:
|
|
207
|
+
self.value = Dex.EncodedAnnotation(self._io, self, self._root)
|
|
208
|
+
self.value._read()
|
|
209
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.long:
|
|
210
|
+
self.value = self._io.read_s8le()
|
|
211
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.method_handle:
|
|
212
|
+
self.value = self._io.read_u4le()
|
|
213
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.byte:
|
|
214
|
+
self.value = self._io.read_s1()
|
|
215
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.array:
|
|
216
|
+
self.value = Dex.EncodedArray(self._io, self, self._root)
|
|
217
|
+
self.value._read()
|
|
218
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.method_type:
|
|
219
|
+
self.value = self._io.read_u4le()
|
|
220
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.short:
|
|
221
|
+
self.value = self._io.read_s2le()
|
|
222
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.method:
|
|
223
|
+
self.value = self._io.read_u4le()
|
|
224
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.double:
|
|
225
|
+
self.value = self._io.read_f8le()
|
|
226
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.float:
|
|
227
|
+
self.value = self._io.read_f4le()
|
|
228
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.type:
|
|
229
|
+
self.value = self._io.read_u4le()
|
|
230
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.enum:
|
|
231
|
+
self.value = self._io.read_u4le()
|
|
232
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.field:
|
|
233
|
+
self.value = self._io.read_u4le()
|
|
234
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.string:
|
|
235
|
+
self.value = self._io.read_u4le()
|
|
236
|
+
elif _on == Dex.EncodedValue.ValueTypeEnum.char:
|
|
237
|
+
self.value = self._io.read_u2le()
|
|
238
|
+
self._debug['value']['end'] = self._io.pos()
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class CallSiteIdItem(KaitaiStruct):
|
|
242
|
+
SEQ_FIELDS = ["call_site_off"]
|
|
243
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
244
|
+
self._io = _io
|
|
245
|
+
self._parent = _parent
|
|
246
|
+
self._root = _root if _root else self
|
|
247
|
+
self._debug = collections.defaultdict(dict)
|
|
248
|
+
|
|
249
|
+
def _read(self):
|
|
250
|
+
self._debug['call_site_off']['start'] = self._io.pos()
|
|
251
|
+
self.call_site_off = self._io.read_u4le()
|
|
252
|
+
self._debug['call_site_off']['end'] = self._io.pos()
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class MethodIdItem(KaitaiStruct):
|
|
256
|
+
SEQ_FIELDS = ["class_idx", "proto_idx", "name_idx"]
|
|
257
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
258
|
+
self._io = _io
|
|
259
|
+
self._parent = _parent
|
|
260
|
+
self._root = _root if _root else self
|
|
261
|
+
self._debug = collections.defaultdict(dict)
|
|
262
|
+
|
|
263
|
+
def _read(self):
|
|
264
|
+
self._debug['class_idx']['start'] = self._io.pos()
|
|
265
|
+
self.class_idx = self._io.read_u2le()
|
|
266
|
+
self._debug['class_idx']['end'] = self._io.pos()
|
|
267
|
+
self._debug['proto_idx']['start'] = self._io.pos()
|
|
268
|
+
self.proto_idx = self._io.read_u2le()
|
|
269
|
+
self._debug['proto_idx']['end'] = self._io.pos()
|
|
270
|
+
self._debug['name_idx']['start'] = self._io.pos()
|
|
271
|
+
self.name_idx = self._io.read_u4le()
|
|
272
|
+
self._debug['name_idx']['end'] = self._io.pos()
|
|
273
|
+
|
|
274
|
+
@property
|
|
275
|
+
def class_name(self):
|
|
276
|
+
"""the definer of this method."""
|
|
277
|
+
if hasattr(self, '_m_class_name'):
|
|
278
|
+
return self._m_class_name if hasattr(self, '_m_class_name') else None
|
|
279
|
+
|
|
280
|
+
self._m_class_name = self._root.type_ids[self.class_idx].type_name
|
|
281
|
+
return self._m_class_name if hasattr(self, '_m_class_name') else None
|
|
282
|
+
|
|
283
|
+
@property
|
|
284
|
+
def proto_desc(self):
|
|
285
|
+
"""the short-form descriptor of the prototype of this method."""
|
|
286
|
+
if hasattr(self, '_m_proto_desc'):
|
|
287
|
+
return self._m_proto_desc if hasattr(self, '_m_proto_desc') else None
|
|
288
|
+
|
|
289
|
+
self._m_proto_desc = self._root.proto_ids[self.proto_idx].shorty_desc
|
|
290
|
+
return self._m_proto_desc if hasattr(self, '_m_proto_desc') else None
|
|
291
|
+
|
|
292
|
+
@property
|
|
293
|
+
def method_name(self):
|
|
294
|
+
"""the name of this method."""
|
|
295
|
+
if hasattr(self, '_m_method_name'):
|
|
296
|
+
return self._m_method_name if hasattr(self, '_m_method_name') else None
|
|
297
|
+
|
|
298
|
+
self._m_method_name = self._root.string_ids[self.name_idx].value.data
|
|
299
|
+
return self._m_method_name if hasattr(self, '_m_method_name') else None
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
class TypeItem(KaitaiStruct):
|
|
303
|
+
SEQ_FIELDS = ["type_idx"]
|
|
304
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
305
|
+
self._io = _io
|
|
306
|
+
self._parent = _parent
|
|
307
|
+
self._root = _root if _root else self
|
|
308
|
+
self._debug = collections.defaultdict(dict)
|
|
309
|
+
|
|
310
|
+
def _read(self):
|
|
311
|
+
self._debug['type_idx']['start'] = self._io.pos()
|
|
312
|
+
self.type_idx = self._io.read_u2le()
|
|
313
|
+
self._debug['type_idx']['end'] = self._io.pos()
|
|
314
|
+
|
|
315
|
+
@property
|
|
316
|
+
def value(self):
|
|
317
|
+
if hasattr(self, '_m_value'):
|
|
318
|
+
return self._m_value if hasattr(self, '_m_value') else None
|
|
319
|
+
|
|
320
|
+
self._m_value = self._root.type_ids[self.type_idx].type_name
|
|
321
|
+
return self._m_value if hasattr(self, '_m_value') else None
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
class TypeIdItem(KaitaiStruct):
|
|
325
|
+
SEQ_FIELDS = ["descriptor_idx"]
|
|
326
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
327
|
+
self._io = _io
|
|
328
|
+
self._parent = _parent
|
|
329
|
+
self._root = _root if _root else self
|
|
330
|
+
self._debug = collections.defaultdict(dict)
|
|
331
|
+
|
|
332
|
+
def _read(self):
|
|
333
|
+
self._debug['descriptor_idx']['start'] = self._io.pos()
|
|
334
|
+
self.descriptor_idx = self._io.read_u4le()
|
|
335
|
+
self._debug['descriptor_idx']['end'] = self._io.pos()
|
|
336
|
+
|
|
337
|
+
@property
|
|
338
|
+
def type_name(self):
|
|
339
|
+
if hasattr(self, '_m_type_name'):
|
|
340
|
+
return self._m_type_name if hasattr(self, '_m_type_name') else None
|
|
341
|
+
|
|
342
|
+
self._m_type_name = self._root.string_ids[self.descriptor_idx].value.data
|
|
343
|
+
return self._m_type_name if hasattr(self, '_m_type_name') else None
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
class AnnotationElement(KaitaiStruct):
|
|
347
|
+
SEQ_FIELDS = ["name_idx", "value"]
|
|
348
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
349
|
+
self._io = _io
|
|
350
|
+
self._parent = _parent
|
|
351
|
+
self._root = _root if _root else self
|
|
352
|
+
self._debug = collections.defaultdict(dict)
|
|
353
|
+
|
|
354
|
+
def _read(self):
|
|
355
|
+
self._debug['name_idx']['start'] = self._io.pos()
|
|
356
|
+
self.name_idx = vlq_base128_le.VlqBase128Le(self._io)
|
|
357
|
+
self.name_idx._read()
|
|
358
|
+
self._debug['name_idx']['end'] = self._io.pos()
|
|
359
|
+
self._debug['value']['start'] = self._io.pos()
|
|
360
|
+
self.value = Dex.EncodedValue(self._io, self, self._root)
|
|
361
|
+
self.value._read()
|
|
362
|
+
self._debug['value']['end'] = self._io.pos()
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
class EncodedField(KaitaiStruct):
|
|
366
|
+
SEQ_FIELDS = ["field_idx_diff", "access_flags"]
|
|
367
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
368
|
+
self._io = _io
|
|
369
|
+
self._parent = _parent
|
|
370
|
+
self._root = _root if _root else self
|
|
371
|
+
self._debug = collections.defaultdict(dict)
|
|
372
|
+
|
|
373
|
+
def _read(self):
|
|
374
|
+
self._debug['field_idx_diff']['start'] = self._io.pos()
|
|
375
|
+
self.field_idx_diff = vlq_base128_le.VlqBase128Le(self._io)
|
|
376
|
+
self.field_idx_diff._read()
|
|
377
|
+
self._debug['field_idx_diff']['end'] = self._io.pos()
|
|
378
|
+
self._debug['access_flags']['start'] = self._io.pos()
|
|
379
|
+
self.access_flags = vlq_base128_le.VlqBase128Le(self._io)
|
|
380
|
+
self.access_flags._read()
|
|
381
|
+
self._debug['access_flags']['end'] = self._io.pos()
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class EncodedArrayItem(KaitaiStruct):
|
|
385
|
+
SEQ_FIELDS = ["value"]
|
|
386
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
387
|
+
self._io = _io
|
|
388
|
+
self._parent = _parent
|
|
389
|
+
self._root = _root if _root else self
|
|
390
|
+
self._debug = collections.defaultdict(dict)
|
|
391
|
+
|
|
392
|
+
def _read(self):
|
|
393
|
+
self._debug['value']['start'] = self._io.pos()
|
|
394
|
+
self.value = Dex.EncodedArray(self._io, self, self._root)
|
|
395
|
+
self.value._read()
|
|
396
|
+
self._debug['value']['end'] = self._io.pos()
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
class ClassDataItem(KaitaiStruct):
|
|
400
|
+
SEQ_FIELDS = ["static_fields_size", "instance_fields_size", "direct_methods_size", "virtual_methods_size", "static_fields", "instance_fields", "direct_methods", "virtual_methods"]
|
|
401
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
402
|
+
self._io = _io
|
|
403
|
+
self._parent = _parent
|
|
404
|
+
self._root = _root if _root else self
|
|
405
|
+
self._debug = collections.defaultdict(dict)
|
|
406
|
+
|
|
407
|
+
def _read(self):
|
|
408
|
+
self._debug['static_fields_size']['start'] = self._io.pos()
|
|
409
|
+
self.static_fields_size = vlq_base128_le.VlqBase128Le(self._io)
|
|
410
|
+
self.static_fields_size._read()
|
|
411
|
+
self._debug['static_fields_size']['end'] = self._io.pos()
|
|
412
|
+
self._debug['instance_fields_size']['start'] = self._io.pos()
|
|
413
|
+
self.instance_fields_size = vlq_base128_le.VlqBase128Le(self._io)
|
|
414
|
+
self.instance_fields_size._read()
|
|
415
|
+
self._debug['instance_fields_size']['end'] = self._io.pos()
|
|
416
|
+
self._debug['direct_methods_size']['start'] = self._io.pos()
|
|
417
|
+
self.direct_methods_size = vlq_base128_le.VlqBase128Le(self._io)
|
|
418
|
+
self.direct_methods_size._read()
|
|
419
|
+
self._debug['direct_methods_size']['end'] = self._io.pos()
|
|
420
|
+
self._debug['virtual_methods_size']['start'] = self._io.pos()
|
|
421
|
+
self.virtual_methods_size = vlq_base128_le.VlqBase128Le(self._io)
|
|
422
|
+
self.virtual_methods_size._read()
|
|
423
|
+
self._debug['virtual_methods_size']['end'] = self._io.pos()
|
|
424
|
+
self._debug['static_fields']['start'] = self._io.pos()
|
|
425
|
+
self.static_fields = [None] * (self.static_fields_size.value)
|
|
426
|
+
for i in range(self.static_fields_size.value):
|
|
427
|
+
if not 'arr' in self._debug['static_fields']:
|
|
428
|
+
self._debug['static_fields']['arr'] = []
|
|
429
|
+
self._debug['static_fields']['arr'].append({'start': self._io.pos()})
|
|
430
|
+
_t_static_fields = Dex.EncodedField(self._io, self, self._root)
|
|
431
|
+
_t_static_fields._read()
|
|
432
|
+
self.static_fields[i] = _t_static_fields
|
|
433
|
+
self._debug['static_fields']['arr'][i]['end'] = self._io.pos()
|
|
434
|
+
|
|
435
|
+
self._debug['static_fields']['end'] = self._io.pos()
|
|
436
|
+
self._debug['instance_fields']['start'] = self._io.pos()
|
|
437
|
+
self.instance_fields = [None] * (self.instance_fields_size.value)
|
|
438
|
+
for i in range(self.instance_fields_size.value):
|
|
439
|
+
if not 'arr' in self._debug['instance_fields']:
|
|
440
|
+
self._debug['instance_fields']['arr'] = []
|
|
441
|
+
self._debug['instance_fields']['arr'].append({'start': self._io.pos()})
|
|
442
|
+
_t_instance_fields = Dex.EncodedField(self._io, self, self._root)
|
|
443
|
+
_t_instance_fields._read()
|
|
444
|
+
self.instance_fields[i] = _t_instance_fields
|
|
445
|
+
self._debug['instance_fields']['arr'][i]['end'] = self._io.pos()
|
|
446
|
+
|
|
447
|
+
self._debug['instance_fields']['end'] = self._io.pos()
|
|
448
|
+
self._debug['direct_methods']['start'] = self._io.pos()
|
|
449
|
+
self.direct_methods = [None] * (self.direct_methods_size.value)
|
|
450
|
+
for i in range(self.direct_methods_size.value):
|
|
451
|
+
if not 'arr' in self._debug['direct_methods']:
|
|
452
|
+
self._debug['direct_methods']['arr'] = []
|
|
453
|
+
self._debug['direct_methods']['arr'].append({'start': self._io.pos()})
|
|
454
|
+
_t_direct_methods = Dex.EncodedMethod(self._io, self, self._root)
|
|
455
|
+
_t_direct_methods._read()
|
|
456
|
+
self.direct_methods[i] = _t_direct_methods
|
|
457
|
+
self._debug['direct_methods']['arr'][i]['end'] = self._io.pos()
|
|
458
|
+
|
|
459
|
+
self._debug['direct_methods']['end'] = self._io.pos()
|
|
460
|
+
self._debug['virtual_methods']['start'] = self._io.pos()
|
|
461
|
+
self.virtual_methods = [None] * (self.virtual_methods_size.value)
|
|
462
|
+
for i in range(self.virtual_methods_size.value):
|
|
463
|
+
if not 'arr' in self._debug['virtual_methods']:
|
|
464
|
+
self._debug['virtual_methods']['arr'] = []
|
|
465
|
+
self._debug['virtual_methods']['arr'].append({'start': self._io.pos()})
|
|
466
|
+
_t_virtual_methods = Dex.EncodedMethod(self._io, self, self._root)
|
|
467
|
+
_t_virtual_methods._read()
|
|
468
|
+
self.virtual_methods[i] = _t_virtual_methods
|
|
469
|
+
self._debug['virtual_methods']['arr'][i]['end'] = self._io.pos()
|
|
470
|
+
|
|
471
|
+
self._debug['virtual_methods']['end'] = self._io.pos()
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
class FieldIdItem(KaitaiStruct):
|
|
475
|
+
SEQ_FIELDS = ["class_idx", "type_idx", "name_idx"]
|
|
476
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
477
|
+
self._io = _io
|
|
478
|
+
self._parent = _parent
|
|
479
|
+
self._root = _root if _root else self
|
|
480
|
+
self._debug = collections.defaultdict(dict)
|
|
481
|
+
|
|
482
|
+
def _read(self):
|
|
483
|
+
self._debug['class_idx']['start'] = self._io.pos()
|
|
484
|
+
self.class_idx = self._io.read_u2le()
|
|
485
|
+
self._debug['class_idx']['end'] = self._io.pos()
|
|
486
|
+
self._debug['type_idx']['start'] = self._io.pos()
|
|
487
|
+
self.type_idx = self._io.read_u2le()
|
|
488
|
+
self._debug['type_idx']['end'] = self._io.pos()
|
|
489
|
+
self._debug['name_idx']['start'] = self._io.pos()
|
|
490
|
+
self.name_idx = self._io.read_u4le()
|
|
491
|
+
self._debug['name_idx']['end'] = self._io.pos()
|
|
492
|
+
|
|
493
|
+
@property
|
|
494
|
+
def class_name(self):
|
|
495
|
+
"""the definer of this field."""
|
|
496
|
+
if hasattr(self, '_m_class_name'):
|
|
497
|
+
return self._m_class_name if hasattr(self, '_m_class_name') else None
|
|
498
|
+
|
|
499
|
+
self._m_class_name = self._root.type_ids[self.class_idx].type_name
|
|
500
|
+
return self._m_class_name if hasattr(self, '_m_class_name') else None
|
|
501
|
+
|
|
502
|
+
@property
|
|
503
|
+
def type_name(self):
|
|
504
|
+
"""the type of this field."""
|
|
505
|
+
if hasattr(self, '_m_type_name'):
|
|
506
|
+
return self._m_type_name if hasattr(self, '_m_type_name') else None
|
|
507
|
+
|
|
508
|
+
self._m_type_name = self._root.type_ids[self.type_idx].type_name
|
|
509
|
+
return self._m_type_name if hasattr(self, '_m_type_name') else None
|
|
510
|
+
|
|
511
|
+
@property
|
|
512
|
+
def field_name(self):
|
|
513
|
+
"""the name of this field."""
|
|
514
|
+
if hasattr(self, '_m_field_name'):
|
|
515
|
+
return self._m_field_name if hasattr(self, '_m_field_name') else None
|
|
516
|
+
|
|
517
|
+
self._m_field_name = self._root.string_ids[self.name_idx].value.data
|
|
518
|
+
return self._m_field_name if hasattr(self, '_m_field_name') else None
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
class EncodedAnnotation(KaitaiStruct):
|
|
522
|
+
SEQ_FIELDS = ["type_idx", "size", "elements"]
|
|
523
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
524
|
+
self._io = _io
|
|
525
|
+
self._parent = _parent
|
|
526
|
+
self._root = _root if _root else self
|
|
527
|
+
self._debug = collections.defaultdict(dict)
|
|
528
|
+
|
|
529
|
+
def _read(self):
|
|
530
|
+
self._debug['type_idx']['start'] = self._io.pos()
|
|
531
|
+
self.type_idx = vlq_base128_le.VlqBase128Le(self._io)
|
|
532
|
+
self.type_idx._read()
|
|
533
|
+
self._debug['type_idx']['end'] = self._io.pos()
|
|
534
|
+
self._debug['size']['start'] = self._io.pos()
|
|
535
|
+
self.size = vlq_base128_le.VlqBase128Le(self._io)
|
|
536
|
+
self.size._read()
|
|
537
|
+
self._debug['size']['end'] = self._io.pos()
|
|
538
|
+
self._debug['elements']['start'] = self._io.pos()
|
|
539
|
+
self.elements = [None] * (self.size.value)
|
|
540
|
+
for i in range(self.size.value):
|
|
541
|
+
if not 'arr' in self._debug['elements']:
|
|
542
|
+
self._debug['elements']['arr'] = []
|
|
543
|
+
self._debug['elements']['arr'].append({'start': self._io.pos()})
|
|
544
|
+
_t_elements = Dex.AnnotationElement(self._io, self, self._root)
|
|
545
|
+
_t_elements._read()
|
|
546
|
+
self.elements[i] = _t_elements
|
|
547
|
+
self._debug['elements']['arr'][i]['end'] = self._io.pos()
|
|
548
|
+
|
|
549
|
+
self._debug['elements']['end'] = self._io.pos()
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
class ClassDefItem(KaitaiStruct):
|
|
553
|
+
SEQ_FIELDS = ["class_idx", "access_flags", "superclass_idx", "interfaces_off", "source_file_idx", "annotations_off", "class_data_off", "static_values_off"]
|
|
554
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
555
|
+
self._io = _io
|
|
556
|
+
self._parent = _parent
|
|
557
|
+
self._root = _root if _root else self
|
|
558
|
+
self._debug = collections.defaultdict(dict)
|
|
559
|
+
|
|
560
|
+
def _read(self):
|
|
561
|
+
self._debug['class_idx']['start'] = self._io.pos()
|
|
562
|
+
self.class_idx = self._io.read_u4le()
|
|
563
|
+
self._debug['class_idx']['end'] = self._io.pos()
|
|
564
|
+
self._debug['access_flags']['start'] = self._io.pos()
|
|
565
|
+
self.access_flags = KaitaiStream.resolve_enum(Dex.ClassAccessFlags, self._io.read_u4le())
|
|
566
|
+
self._debug['access_flags']['end'] = self._io.pos()
|
|
567
|
+
self._debug['superclass_idx']['start'] = self._io.pos()
|
|
568
|
+
self.superclass_idx = self._io.read_u4le()
|
|
569
|
+
self._debug['superclass_idx']['end'] = self._io.pos()
|
|
570
|
+
self._debug['interfaces_off']['start'] = self._io.pos()
|
|
571
|
+
self.interfaces_off = self._io.read_u4le()
|
|
572
|
+
self._debug['interfaces_off']['end'] = self._io.pos()
|
|
573
|
+
self._debug['source_file_idx']['start'] = self._io.pos()
|
|
574
|
+
self.source_file_idx = self._io.read_u4le()
|
|
575
|
+
self._debug['source_file_idx']['end'] = self._io.pos()
|
|
576
|
+
self._debug['annotations_off']['start'] = self._io.pos()
|
|
577
|
+
self.annotations_off = self._io.read_u4le()
|
|
578
|
+
self._debug['annotations_off']['end'] = self._io.pos()
|
|
579
|
+
self._debug['class_data_off']['start'] = self._io.pos()
|
|
580
|
+
self.class_data_off = self._io.read_u4le()
|
|
581
|
+
self._debug['class_data_off']['end'] = self._io.pos()
|
|
582
|
+
self._debug['static_values_off']['start'] = self._io.pos()
|
|
583
|
+
self.static_values_off = self._io.read_u4le()
|
|
584
|
+
self._debug['static_values_off']['end'] = self._io.pos()
|
|
585
|
+
|
|
586
|
+
@property
|
|
587
|
+
def type_name(self):
|
|
588
|
+
if hasattr(self, '_m_type_name'):
|
|
589
|
+
return self._m_type_name if hasattr(self, '_m_type_name') else None
|
|
590
|
+
|
|
591
|
+
self._m_type_name = self._root.type_ids[self.class_idx].type_name
|
|
592
|
+
return self._m_type_name if hasattr(self, '_m_type_name') else None
|
|
593
|
+
|
|
594
|
+
@property
|
|
595
|
+
def class_data(self):
|
|
596
|
+
if hasattr(self, '_m_class_data'):
|
|
597
|
+
return self._m_class_data if hasattr(self, '_m_class_data') else None
|
|
598
|
+
|
|
599
|
+
if self.class_data_off != 0:
|
|
600
|
+
_pos = self._io.pos()
|
|
601
|
+
self._io.seek(self.class_data_off)
|
|
602
|
+
self._debug['_m_class_data']['start'] = self._io.pos()
|
|
603
|
+
self._m_class_data = Dex.ClassDataItem(self._io, self, self._root)
|
|
604
|
+
self._m_class_data._read()
|
|
605
|
+
self._debug['_m_class_data']['end'] = self._io.pos()
|
|
606
|
+
self._io.seek(_pos)
|
|
607
|
+
|
|
608
|
+
return self._m_class_data if hasattr(self, '_m_class_data') else None
|
|
609
|
+
|
|
610
|
+
@property
|
|
611
|
+
def static_values(self):
|
|
612
|
+
if hasattr(self, '_m_static_values'):
|
|
613
|
+
return self._m_static_values if hasattr(self, '_m_static_values') else None
|
|
614
|
+
|
|
615
|
+
if self.static_values_off != 0:
|
|
616
|
+
_pos = self._io.pos()
|
|
617
|
+
self._io.seek(self.static_values_off)
|
|
618
|
+
self._debug['_m_static_values']['start'] = self._io.pos()
|
|
619
|
+
self._m_static_values = Dex.EncodedArrayItem(self._io, self, self._root)
|
|
620
|
+
self._m_static_values._read()
|
|
621
|
+
self._debug['_m_static_values']['end'] = self._io.pos()
|
|
622
|
+
self._io.seek(_pos)
|
|
623
|
+
|
|
624
|
+
return self._m_static_values if hasattr(self, '_m_static_values') else None
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
class TypeList(KaitaiStruct):
|
|
628
|
+
SEQ_FIELDS = ["size", "list"]
|
|
629
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
630
|
+
self._io = _io
|
|
631
|
+
self._parent = _parent
|
|
632
|
+
self._root = _root if _root else self
|
|
633
|
+
self._debug = collections.defaultdict(dict)
|
|
634
|
+
|
|
635
|
+
def _read(self):
|
|
636
|
+
self._debug['size']['start'] = self._io.pos()
|
|
637
|
+
self.size = self._io.read_u4le()
|
|
638
|
+
self._debug['size']['end'] = self._io.pos()
|
|
639
|
+
self._debug['list']['start'] = self._io.pos()
|
|
640
|
+
self.list = [None] * (self.size)
|
|
641
|
+
for i in range(self.size):
|
|
642
|
+
if not 'arr' in self._debug['list']:
|
|
643
|
+
self._debug['list']['arr'] = []
|
|
644
|
+
self._debug['list']['arr'].append({'start': self._io.pos()})
|
|
645
|
+
_t_list = Dex.TypeItem(self._io, self, self._root)
|
|
646
|
+
_t_list._read()
|
|
647
|
+
self.list[i] = _t_list
|
|
648
|
+
self._debug['list']['arr'][i]['end'] = self._io.pos()
|
|
649
|
+
|
|
650
|
+
self._debug['list']['end'] = self._io.pos()
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
class StringIdItem(KaitaiStruct):
|
|
654
|
+
SEQ_FIELDS = ["string_data_off"]
|
|
655
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
656
|
+
self._io = _io
|
|
657
|
+
self._parent = _parent
|
|
658
|
+
self._root = _root if _root else self
|
|
659
|
+
self._debug = collections.defaultdict(dict)
|
|
660
|
+
|
|
661
|
+
def _read(self):
|
|
662
|
+
self._debug['string_data_off']['start'] = self._io.pos()
|
|
663
|
+
self.string_data_off = self._io.read_u4le()
|
|
664
|
+
self._debug['string_data_off']['end'] = self._io.pos()
|
|
665
|
+
|
|
666
|
+
class StringDataItem(KaitaiStruct):
|
|
667
|
+
SEQ_FIELDS = ["utf16_size", "data"]
|
|
668
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
669
|
+
self._io = _io
|
|
670
|
+
self._parent = _parent
|
|
671
|
+
self._root = _root if _root else self
|
|
672
|
+
self._debug = collections.defaultdict(dict)
|
|
673
|
+
|
|
674
|
+
def _read(self):
|
|
675
|
+
self._debug['utf16_size']['start'] = self._io.pos()
|
|
676
|
+
self.utf16_size = vlq_base128_le.VlqBase128Le(self._io)
|
|
677
|
+
self.utf16_size._read()
|
|
678
|
+
self._debug['utf16_size']['end'] = self._io.pos()
|
|
679
|
+
self._debug['data']['start'] = self._io.pos()
|
|
680
|
+
self.data = (self._io.read_bytes(self.utf16_size.value)).decode(u"ascii")
|
|
681
|
+
self._debug['data']['end'] = self._io.pos()
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
@property
|
|
685
|
+
def value(self):
|
|
686
|
+
if hasattr(self, '_m_value'):
|
|
687
|
+
return self._m_value if hasattr(self, '_m_value') else None
|
|
688
|
+
|
|
689
|
+
_pos = self._io.pos()
|
|
690
|
+
self._io.seek(self.string_data_off)
|
|
691
|
+
self._debug['_m_value']['start'] = self._io.pos()
|
|
692
|
+
self._m_value = Dex.StringIdItem.StringDataItem(self._io, self, self._root)
|
|
693
|
+
self._m_value._read()
|
|
694
|
+
self._debug['_m_value']['end'] = self._io.pos()
|
|
695
|
+
self._io.seek(_pos)
|
|
696
|
+
return self._m_value if hasattr(self, '_m_value') else None
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
class ProtoIdItem(KaitaiStruct):
|
|
700
|
+
SEQ_FIELDS = ["shorty_idx", "return_type_idx", "parameters_off"]
|
|
701
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
702
|
+
self._io = _io
|
|
703
|
+
self._parent = _parent
|
|
704
|
+
self._root = _root if _root else self
|
|
705
|
+
self._debug = collections.defaultdict(dict)
|
|
706
|
+
|
|
707
|
+
def _read(self):
|
|
708
|
+
self._debug['shorty_idx']['start'] = self._io.pos()
|
|
709
|
+
self.shorty_idx = self._io.read_u4le()
|
|
710
|
+
self._debug['shorty_idx']['end'] = self._io.pos()
|
|
711
|
+
self._debug['return_type_idx']['start'] = self._io.pos()
|
|
712
|
+
self.return_type_idx = self._io.read_u4le()
|
|
713
|
+
self._debug['return_type_idx']['end'] = self._io.pos()
|
|
714
|
+
self._debug['parameters_off']['start'] = self._io.pos()
|
|
715
|
+
self.parameters_off = self._io.read_u4le()
|
|
716
|
+
self._debug['parameters_off']['end'] = self._io.pos()
|
|
717
|
+
|
|
718
|
+
@property
|
|
719
|
+
def shorty_desc(self):
|
|
720
|
+
"""short-form descriptor string of this prototype, as pointed to by shorty_idx."""
|
|
721
|
+
if hasattr(self, '_m_shorty_desc'):
|
|
722
|
+
return self._m_shorty_desc if hasattr(self, '_m_shorty_desc') else None
|
|
723
|
+
|
|
724
|
+
self._m_shorty_desc = self._root.string_ids[self.shorty_idx].value.data
|
|
725
|
+
return self._m_shorty_desc if hasattr(self, '_m_shorty_desc') else None
|
|
726
|
+
|
|
727
|
+
@property
|
|
728
|
+
def params_types(self):
|
|
729
|
+
"""list of parameter types for this prototype."""
|
|
730
|
+
if hasattr(self, '_m_params_types'):
|
|
731
|
+
return self._m_params_types if hasattr(self, '_m_params_types') else None
|
|
732
|
+
|
|
733
|
+
if self.parameters_off != 0:
|
|
734
|
+
io = self._root._io
|
|
735
|
+
_pos = io.pos()
|
|
736
|
+
io.seek(self.parameters_off)
|
|
737
|
+
self._debug['_m_params_types']['start'] = io.pos()
|
|
738
|
+
self._m_params_types = Dex.TypeList(io, self, self._root)
|
|
739
|
+
self._m_params_types._read()
|
|
740
|
+
self._debug['_m_params_types']['end'] = io.pos()
|
|
741
|
+
io.seek(_pos)
|
|
742
|
+
|
|
743
|
+
return self._m_params_types if hasattr(self, '_m_params_types') else None
|
|
744
|
+
|
|
745
|
+
@property
|
|
746
|
+
def return_type(self):
|
|
747
|
+
"""return type of this prototype."""
|
|
748
|
+
if hasattr(self, '_m_return_type'):
|
|
749
|
+
return self._m_return_type if hasattr(self, '_m_return_type') else None
|
|
750
|
+
|
|
751
|
+
self._m_return_type = self._root.type_ids[self.return_type_idx].type_name
|
|
752
|
+
return self._m_return_type if hasattr(self, '_m_return_type') else None
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
class EncodedMethod(KaitaiStruct):
|
|
756
|
+
SEQ_FIELDS = ["method_idx_diff", "access_flags", "code_off"]
|
|
757
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
758
|
+
self._io = _io
|
|
759
|
+
self._parent = _parent
|
|
760
|
+
self._root = _root if _root else self
|
|
761
|
+
self._debug = collections.defaultdict(dict)
|
|
762
|
+
|
|
763
|
+
def _read(self):
|
|
764
|
+
self._debug['method_idx_diff']['start'] = self._io.pos()
|
|
765
|
+
self.method_idx_diff = vlq_base128_le.VlqBase128Le(self._io)
|
|
766
|
+
self.method_idx_diff._read()
|
|
767
|
+
self._debug['method_idx_diff']['end'] = self._io.pos()
|
|
768
|
+
self._debug['access_flags']['start'] = self._io.pos()
|
|
769
|
+
self.access_flags = vlq_base128_le.VlqBase128Le(self._io)
|
|
770
|
+
self.access_flags._read()
|
|
771
|
+
self._debug['access_flags']['end'] = self._io.pos()
|
|
772
|
+
self._debug['code_off']['start'] = self._io.pos()
|
|
773
|
+
self.code_off = vlq_base128_le.VlqBase128Le(self._io)
|
|
774
|
+
self.code_off._read()
|
|
775
|
+
self._debug['code_off']['end'] = self._io.pos()
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
class MapItem(KaitaiStruct):
|
|
779
|
+
|
|
780
|
+
class MapItemType(Enum):
|
|
781
|
+
header_item = 0
|
|
782
|
+
string_id_item = 1
|
|
783
|
+
type_id_item = 2
|
|
784
|
+
proto_id_item = 3
|
|
785
|
+
field_id_item = 4
|
|
786
|
+
method_id_item = 5
|
|
787
|
+
class_def_item = 6
|
|
788
|
+
call_site_id_item = 7
|
|
789
|
+
method_handle_item = 8
|
|
790
|
+
map_list = 4096
|
|
791
|
+
type_list = 4097
|
|
792
|
+
annotation_set_ref_list = 4098
|
|
793
|
+
annotation_set_item = 4099
|
|
794
|
+
class_data_item = 8192
|
|
795
|
+
code_item = 8193
|
|
796
|
+
string_data_item = 8194
|
|
797
|
+
debug_info_item = 8195
|
|
798
|
+
annotation_item = 8196
|
|
799
|
+
encoded_array_item = 8197
|
|
800
|
+
annotations_directory_item = 8198
|
|
801
|
+
SEQ_FIELDS = ["type", "unused", "size", "offset"]
|
|
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['type']['start'] = self._io.pos()
|
|
810
|
+
self.type = KaitaiStream.resolve_enum(Dex.MapItem.MapItemType, self._io.read_u2le())
|
|
811
|
+
self._debug['type']['end'] = self._io.pos()
|
|
812
|
+
self._debug['unused']['start'] = self._io.pos()
|
|
813
|
+
self.unused = self._io.read_u2le()
|
|
814
|
+
self._debug['unused']['end'] = self._io.pos()
|
|
815
|
+
self._debug['size']['start'] = self._io.pos()
|
|
816
|
+
self.size = self._io.read_u4le()
|
|
817
|
+
self._debug['size']['end'] = self._io.pos()
|
|
818
|
+
self._debug['offset']['start'] = self._io.pos()
|
|
819
|
+
self.offset = self._io.read_u4le()
|
|
820
|
+
self._debug['offset']['end'] = self._io.pos()
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
class EncodedArray(KaitaiStruct):
|
|
824
|
+
SEQ_FIELDS = ["size", "values"]
|
|
825
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
826
|
+
self._io = _io
|
|
827
|
+
self._parent = _parent
|
|
828
|
+
self._root = _root if _root else self
|
|
829
|
+
self._debug = collections.defaultdict(dict)
|
|
830
|
+
|
|
831
|
+
def _read(self):
|
|
832
|
+
self._debug['size']['start'] = self._io.pos()
|
|
833
|
+
self.size = vlq_base128_le.VlqBase128Le(self._io)
|
|
834
|
+
self.size._read()
|
|
835
|
+
self._debug['size']['end'] = self._io.pos()
|
|
836
|
+
self._debug['values']['start'] = self._io.pos()
|
|
837
|
+
self.values = [None] * (self.size.value)
|
|
838
|
+
for i in range(self.size.value):
|
|
839
|
+
if not 'arr' in self._debug['values']:
|
|
840
|
+
self._debug['values']['arr'] = []
|
|
841
|
+
self._debug['values']['arr'].append({'start': self._io.pos()})
|
|
842
|
+
_t_values = Dex.EncodedValue(self._io, self, self._root)
|
|
843
|
+
_t_values._read()
|
|
844
|
+
self.values[i] = _t_values
|
|
845
|
+
self._debug['values']['arr'][i]['end'] = self._io.pos()
|
|
846
|
+
|
|
847
|
+
self._debug['values']['end'] = self._io.pos()
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
@property
|
|
851
|
+
def string_ids(self):
|
|
852
|
+
"""string identifiers list.
|
|
853
|
+
|
|
854
|
+
These are identifiers for all the strings used by this file, either for
|
|
855
|
+
internal naming (e.g., type descriptors) or as constant objects referred to by code.
|
|
856
|
+
|
|
857
|
+
This list must be sorted by string contents, using UTF-16 code point values
|
|
858
|
+
(not in a locale-sensitive manner), and it must not contain any duplicate entries.
|
|
859
|
+
"""
|
|
860
|
+
if hasattr(self, '_m_string_ids'):
|
|
861
|
+
return self._m_string_ids if hasattr(self, '_m_string_ids') else None
|
|
862
|
+
|
|
863
|
+
_pos = self._io.pos()
|
|
864
|
+
self._io.seek(self.header.string_ids_off)
|
|
865
|
+
self._debug['_m_string_ids']['start'] = self._io.pos()
|
|
866
|
+
self._m_string_ids = [None] * (self.header.string_ids_size)
|
|
867
|
+
for i in range(self.header.string_ids_size):
|
|
868
|
+
if not 'arr' in self._debug['_m_string_ids']:
|
|
869
|
+
self._debug['_m_string_ids']['arr'] = []
|
|
870
|
+
self._debug['_m_string_ids']['arr'].append({'start': self._io.pos()})
|
|
871
|
+
_t__m_string_ids = Dex.StringIdItem(self._io, self, self._root)
|
|
872
|
+
_t__m_string_ids._read()
|
|
873
|
+
self._m_string_ids[i] = _t__m_string_ids
|
|
874
|
+
self._debug['_m_string_ids']['arr'][i]['end'] = self._io.pos()
|
|
875
|
+
|
|
876
|
+
self._debug['_m_string_ids']['end'] = self._io.pos()
|
|
877
|
+
self._io.seek(_pos)
|
|
878
|
+
return self._m_string_ids if hasattr(self, '_m_string_ids') else None
|
|
879
|
+
|
|
880
|
+
@property
|
|
881
|
+
def method_ids(self):
|
|
882
|
+
"""method identifiers list.
|
|
883
|
+
|
|
884
|
+
These are identifiers for all methods referred to by this file,
|
|
885
|
+
whether defined in the file or not.
|
|
886
|
+
|
|
887
|
+
This list must be sorted, where the defining type (by type_id index
|
|
888
|
+
is the major order, method name (by string_id index) is the intermediate
|
|
889
|
+
order, and method prototype (by proto_id index) is the minor order.
|
|
890
|
+
|
|
891
|
+
The list must not contain any duplicate entries.
|
|
892
|
+
"""
|
|
893
|
+
if hasattr(self, '_m_method_ids'):
|
|
894
|
+
return self._m_method_ids if hasattr(self, '_m_method_ids') else None
|
|
895
|
+
|
|
896
|
+
_pos = self._io.pos()
|
|
897
|
+
self._io.seek(self.header.method_ids_off)
|
|
898
|
+
self._debug['_m_method_ids']['start'] = self._io.pos()
|
|
899
|
+
self._m_method_ids = [None] * (self.header.method_ids_size)
|
|
900
|
+
for i in range(self.header.method_ids_size):
|
|
901
|
+
if not 'arr' in self._debug['_m_method_ids']:
|
|
902
|
+
self._debug['_m_method_ids']['arr'] = []
|
|
903
|
+
self._debug['_m_method_ids']['arr'].append({'start': self._io.pos()})
|
|
904
|
+
_t__m_method_ids = Dex.MethodIdItem(self._io, self, self._root)
|
|
905
|
+
_t__m_method_ids._read()
|
|
906
|
+
self._m_method_ids[i] = _t__m_method_ids
|
|
907
|
+
self._debug['_m_method_ids']['arr'][i]['end'] = self._io.pos()
|
|
908
|
+
|
|
909
|
+
self._debug['_m_method_ids']['end'] = self._io.pos()
|
|
910
|
+
self._io.seek(_pos)
|
|
911
|
+
return self._m_method_ids if hasattr(self, '_m_method_ids') else None
|
|
912
|
+
|
|
913
|
+
@property
|
|
914
|
+
def link_data(self):
|
|
915
|
+
"""data used in statically linked files.
|
|
916
|
+
|
|
917
|
+
The format of the data in this section is left unspecified by this document.
|
|
918
|
+
|
|
919
|
+
This section is empty in unlinked files, and runtime implementations may
|
|
920
|
+
use it as they see fit.
|
|
921
|
+
"""
|
|
922
|
+
if hasattr(self, '_m_link_data'):
|
|
923
|
+
return self._m_link_data if hasattr(self, '_m_link_data') else None
|
|
924
|
+
|
|
925
|
+
_pos = self._io.pos()
|
|
926
|
+
self._io.seek(self.header.link_off)
|
|
927
|
+
self._debug['_m_link_data']['start'] = self._io.pos()
|
|
928
|
+
self._m_link_data = self._io.read_bytes(self.header.link_size)
|
|
929
|
+
self._debug['_m_link_data']['end'] = self._io.pos()
|
|
930
|
+
self._io.seek(_pos)
|
|
931
|
+
return self._m_link_data if hasattr(self, '_m_link_data') else None
|
|
932
|
+
|
|
933
|
+
@property
|
|
934
|
+
def map(self):
|
|
935
|
+
if hasattr(self, '_m_map'):
|
|
936
|
+
return self._m_map if hasattr(self, '_m_map') else None
|
|
937
|
+
|
|
938
|
+
_pos = self._io.pos()
|
|
939
|
+
self._io.seek(self.header.map_off)
|
|
940
|
+
self._debug['_m_map']['start'] = self._io.pos()
|
|
941
|
+
self._m_map = Dex.MapList(self._io, self, self._root)
|
|
942
|
+
self._m_map._read()
|
|
943
|
+
self._debug['_m_map']['end'] = self._io.pos()
|
|
944
|
+
self._io.seek(_pos)
|
|
945
|
+
return self._m_map if hasattr(self, '_m_map') else None
|
|
946
|
+
|
|
947
|
+
@property
|
|
948
|
+
def class_defs(self):
|
|
949
|
+
"""class definitions list.
|
|
950
|
+
|
|
951
|
+
The classes must be ordered such that a given class's superclass and
|
|
952
|
+
implemented interfaces appear in the list earlier than the referring class.
|
|
953
|
+
|
|
954
|
+
Furthermore, it is invalid for a definition for the same-named class to
|
|
955
|
+
appear more than once in the list.
|
|
956
|
+
"""
|
|
957
|
+
if hasattr(self, '_m_class_defs'):
|
|
958
|
+
return self._m_class_defs if hasattr(self, '_m_class_defs') else None
|
|
959
|
+
|
|
960
|
+
_pos = self._io.pos()
|
|
961
|
+
self._io.seek(self.header.class_defs_off)
|
|
962
|
+
self._debug['_m_class_defs']['start'] = self._io.pos()
|
|
963
|
+
self._m_class_defs = [None] * (self.header.class_defs_size)
|
|
964
|
+
for i in range(self.header.class_defs_size):
|
|
965
|
+
if not 'arr' in self._debug['_m_class_defs']:
|
|
966
|
+
self._debug['_m_class_defs']['arr'] = []
|
|
967
|
+
self._debug['_m_class_defs']['arr'].append({'start': self._io.pos()})
|
|
968
|
+
_t__m_class_defs = Dex.ClassDefItem(self._io, self, self._root)
|
|
969
|
+
_t__m_class_defs._read()
|
|
970
|
+
self._m_class_defs[i] = _t__m_class_defs
|
|
971
|
+
self._debug['_m_class_defs']['arr'][i]['end'] = self._io.pos()
|
|
972
|
+
|
|
973
|
+
self._debug['_m_class_defs']['end'] = self._io.pos()
|
|
974
|
+
self._io.seek(_pos)
|
|
975
|
+
return self._m_class_defs if hasattr(self, '_m_class_defs') else None
|
|
976
|
+
|
|
977
|
+
@property
|
|
978
|
+
def data(self):
|
|
979
|
+
"""data area, containing all the support data for the tables listed above.
|
|
980
|
+
|
|
981
|
+
Different items have different alignment requirements, and padding bytes
|
|
982
|
+
are inserted before each item if necessary to achieve proper alignment.
|
|
983
|
+
"""
|
|
984
|
+
if hasattr(self, '_m_data'):
|
|
985
|
+
return self._m_data if hasattr(self, '_m_data') else None
|
|
986
|
+
|
|
987
|
+
_pos = self._io.pos()
|
|
988
|
+
self._io.seek(self.header.data_off)
|
|
989
|
+
self._debug['_m_data']['start'] = self._io.pos()
|
|
990
|
+
self._m_data = self._io.read_bytes(self.header.data_size)
|
|
991
|
+
self._debug['_m_data']['end'] = self._io.pos()
|
|
992
|
+
self._io.seek(_pos)
|
|
993
|
+
return self._m_data if hasattr(self, '_m_data') else None
|
|
994
|
+
|
|
995
|
+
@property
|
|
996
|
+
def type_ids(self):
|
|
997
|
+
"""type identifiers list.
|
|
998
|
+
|
|
999
|
+
These are identifiers for all types (classes, arrays, or primitive types)
|
|
1000
|
+
referred to by this file, whether defined in the file or not.
|
|
1001
|
+
|
|
1002
|
+
This list must be sorted by string_id index, and it must not contain any duplicate entries.
|
|
1003
|
+
"""
|
|
1004
|
+
if hasattr(self, '_m_type_ids'):
|
|
1005
|
+
return self._m_type_ids if hasattr(self, '_m_type_ids') else None
|
|
1006
|
+
|
|
1007
|
+
_pos = self._io.pos()
|
|
1008
|
+
self._io.seek(self.header.type_ids_off)
|
|
1009
|
+
self._debug['_m_type_ids']['start'] = self._io.pos()
|
|
1010
|
+
self._m_type_ids = [None] * (self.header.type_ids_size)
|
|
1011
|
+
for i in range(self.header.type_ids_size):
|
|
1012
|
+
if not 'arr' in self._debug['_m_type_ids']:
|
|
1013
|
+
self._debug['_m_type_ids']['arr'] = []
|
|
1014
|
+
self._debug['_m_type_ids']['arr'].append({'start': self._io.pos()})
|
|
1015
|
+
_t__m_type_ids = Dex.TypeIdItem(self._io, self, self._root)
|
|
1016
|
+
_t__m_type_ids._read()
|
|
1017
|
+
self._m_type_ids[i] = _t__m_type_ids
|
|
1018
|
+
self._debug['_m_type_ids']['arr'][i]['end'] = self._io.pos()
|
|
1019
|
+
|
|
1020
|
+
self._debug['_m_type_ids']['end'] = self._io.pos()
|
|
1021
|
+
self._io.seek(_pos)
|
|
1022
|
+
return self._m_type_ids if hasattr(self, '_m_type_ids') else None
|
|
1023
|
+
|
|
1024
|
+
@property
|
|
1025
|
+
def proto_ids(self):
|
|
1026
|
+
"""method prototype identifiers list.
|
|
1027
|
+
|
|
1028
|
+
These are identifiers for all prototypes referred to by this file.
|
|
1029
|
+
|
|
1030
|
+
This list must be sorted in return-type (by type_id index) major order,
|
|
1031
|
+
and then by argument list (lexicographic ordering, individual arguments
|
|
1032
|
+
ordered by type_id index). The list must not contain any duplicate entries.
|
|
1033
|
+
"""
|
|
1034
|
+
if hasattr(self, '_m_proto_ids'):
|
|
1035
|
+
return self._m_proto_ids if hasattr(self, '_m_proto_ids') else None
|
|
1036
|
+
|
|
1037
|
+
_pos = self._io.pos()
|
|
1038
|
+
self._io.seek(self.header.proto_ids_off)
|
|
1039
|
+
self._debug['_m_proto_ids']['start'] = self._io.pos()
|
|
1040
|
+
self._m_proto_ids = [None] * (self.header.proto_ids_size)
|
|
1041
|
+
for i in range(self.header.proto_ids_size):
|
|
1042
|
+
if not 'arr' in self._debug['_m_proto_ids']:
|
|
1043
|
+
self._debug['_m_proto_ids']['arr'] = []
|
|
1044
|
+
self._debug['_m_proto_ids']['arr'].append({'start': self._io.pos()})
|
|
1045
|
+
_t__m_proto_ids = Dex.ProtoIdItem(self._io, self, self._root)
|
|
1046
|
+
_t__m_proto_ids._read()
|
|
1047
|
+
self._m_proto_ids[i] = _t__m_proto_ids
|
|
1048
|
+
self._debug['_m_proto_ids']['arr'][i]['end'] = self._io.pos()
|
|
1049
|
+
|
|
1050
|
+
self._debug['_m_proto_ids']['end'] = self._io.pos()
|
|
1051
|
+
self._io.seek(_pos)
|
|
1052
|
+
return self._m_proto_ids if hasattr(self, '_m_proto_ids') else None
|
|
1053
|
+
|
|
1054
|
+
@property
|
|
1055
|
+
def field_ids(self):
|
|
1056
|
+
"""field identifiers list.
|
|
1057
|
+
|
|
1058
|
+
These are identifiers for all fields referred to by this file, whether defined in the file or not.
|
|
1059
|
+
|
|
1060
|
+
This list must be sorted, where the defining type (by type_id index)
|
|
1061
|
+
is the major order, field name (by string_id index) is the intermediate
|
|
1062
|
+
order, and type (by type_id index) is the minor order.
|
|
1063
|
+
|
|
1064
|
+
The list must not contain any duplicate entries.
|
|
1065
|
+
"""
|
|
1066
|
+
if hasattr(self, '_m_field_ids'):
|
|
1067
|
+
return self._m_field_ids if hasattr(self, '_m_field_ids') else None
|
|
1068
|
+
|
|
1069
|
+
_pos = self._io.pos()
|
|
1070
|
+
self._io.seek(self.header.field_ids_off)
|
|
1071
|
+
self._debug['_m_field_ids']['start'] = self._io.pos()
|
|
1072
|
+
self._m_field_ids = [None] * (self.header.field_ids_size)
|
|
1073
|
+
for i in range(self.header.field_ids_size):
|
|
1074
|
+
if not 'arr' in self._debug['_m_field_ids']:
|
|
1075
|
+
self._debug['_m_field_ids']['arr'] = []
|
|
1076
|
+
self._debug['_m_field_ids']['arr'].append({'start': self._io.pos()})
|
|
1077
|
+
_t__m_field_ids = Dex.FieldIdItem(self._io, self, self._root)
|
|
1078
|
+
_t__m_field_ids._read()
|
|
1079
|
+
self._m_field_ids[i] = _t__m_field_ids
|
|
1080
|
+
self._debug['_m_field_ids']['arr'][i]['end'] = self._io.pos()
|
|
1081
|
+
|
|
1082
|
+
self._debug['_m_field_ids']['end'] = self._io.pos()
|
|
1083
|
+
self._io.seek(_pos)
|
|
1084
|
+
return self._m_field_ids if hasattr(self, '_m_field_ids') else None
|
|
1085
|
+
|
|
1086
|
+
|