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,195 @@
|
|
|
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
|
+
class Pcx(KaitaiStruct):
|
|
14
|
+
"""PCX is a bitmap image format originally used by PC Paintbrush from
|
|
15
|
+
ZSoft Corporation. Originally, it was a relatively simple 128-byte
|
|
16
|
+
header + uncompressed bitmap format, but latest versions introduced
|
|
17
|
+
more complicated palette support and RLE compression.
|
|
18
|
+
|
|
19
|
+
There's an option to encode 32-bit or 16-bit RGBA pixels, and thus
|
|
20
|
+
it can potentially include transparency. Theoretically, it's
|
|
21
|
+
possible to encode resolution or pixel density in the some of the
|
|
22
|
+
header fields too, but in reality there's no uniform standard for
|
|
23
|
+
these, so different implementations treat these differently.
|
|
24
|
+
|
|
25
|
+
PCX format was never made a formal standard. "ZSoft Corporation
|
|
26
|
+
Technical Reference Manual" for "Image File (.PCX) Format", last
|
|
27
|
+
updated in 1991, is likely the closest authoritative source.
|
|
28
|
+
|
|
29
|
+
.. seealso::
|
|
30
|
+
Source - https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
class Versions(Enum):
|
|
34
|
+
v2_5 = 0
|
|
35
|
+
v2_8_with_palette = 2
|
|
36
|
+
v2_8_without_palette = 3
|
|
37
|
+
paintbrush_for_windows = 4
|
|
38
|
+
v3_0 = 5
|
|
39
|
+
|
|
40
|
+
class Encodings(Enum):
|
|
41
|
+
rle = 1
|
|
42
|
+
SEQ_FIELDS = ["hdr"]
|
|
43
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
44
|
+
self._io = _io
|
|
45
|
+
self._parent = _parent
|
|
46
|
+
self._root = _root if _root else self
|
|
47
|
+
self._debug = collections.defaultdict(dict)
|
|
48
|
+
|
|
49
|
+
def _read(self):
|
|
50
|
+
self._debug['hdr']['start'] = self._io.pos()
|
|
51
|
+
self._raw_hdr = self._io.read_bytes(128)
|
|
52
|
+
_io__raw_hdr = KaitaiStream(BytesIO(self._raw_hdr))
|
|
53
|
+
self.hdr = Pcx.Header(_io__raw_hdr, self, self._root)
|
|
54
|
+
self.hdr._read()
|
|
55
|
+
self._debug['hdr']['end'] = self._io.pos()
|
|
56
|
+
|
|
57
|
+
class Header(KaitaiStruct):
|
|
58
|
+
"""
|
|
59
|
+
.. seealso::
|
|
60
|
+
- "ZSoft .PCX FILE HEADER FORMAT" - https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
|
|
61
|
+
"""
|
|
62
|
+
SEQ_FIELDS = ["magic", "version", "encoding", "bits_per_pixel", "img_x_min", "img_y_min", "img_x_max", "img_y_max", "hdpi", "vdpi", "palette_16", "reserved", "num_planes", "bytes_per_line", "palette_info", "h_screen_size", "v_screen_size"]
|
|
63
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
64
|
+
self._io = _io
|
|
65
|
+
self._parent = _parent
|
|
66
|
+
self._root = _root if _root else self
|
|
67
|
+
self._debug = collections.defaultdict(dict)
|
|
68
|
+
|
|
69
|
+
def _read(self):
|
|
70
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
71
|
+
self.magic = self._io.read_bytes(1)
|
|
72
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
73
|
+
if not self.magic == b"\x0A":
|
|
74
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x0A", self.magic, self._io, u"/types/header/seq/0")
|
|
75
|
+
self._debug['version']['start'] = self._io.pos()
|
|
76
|
+
self.version = KaitaiStream.resolve_enum(Pcx.Versions, self._io.read_u1())
|
|
77
|
+
self._debug['version']['end'] = self._io.pos()
|
|
78
|
+
self._debug['encoding']['start'] = self._io.pos()
|
|
79
|
+
self.encoding = KaitaiStream.resolve_enum(Pcx.Encodings, self._io.read_u1())
|
|
80
|
+
self._debug['encoding']['end'] = self._io.pos()
|
|
81
|
+
self._debug['bits_per_pixel']['start'] = self._io.pos()
|
|
82
|
+
self.bits_per_pixel = self._io.read_u1()
|
|
83
|
+
self._debug['bits_per_pixel']['end'] = self._io.pos()
|
|
84
|
+
self._debug['img_x_min']['start'] = self._io.pos()
|
|
85
|
+
self.img_x_min = self._io.read_u2le()
|
|
86
|
+
self._debug['img_x_min']['end'] = self._io.pos()
|
|
87
|
+
self._debug['img_y_min']['start'] = self._io.pos()
|
|
88
|
+
self.img_y_min = self._io.read_u2le()
|
|
89
|
+
self._debug['img_y_min']['end'] = self._io.pos()
|
|
90
|
+
self._debug['img_x_max']['start'] = self._io.pos()
|
|
91
|
+
self.img_x_max = self._io.read_u2le()
|
|
92
|
+
self._debug['img_x_max']['end'] = self._io.pos()
|
|
93
|
+
self._debug['img_y_max']['start'] = self._io.pos()
|
|
94
|
+
self.img_y_max = self._io.read_u2le()
|
|
95
|
+
self._debug['img_y_max']['end'] = self._io.pos()
|
|
96
|
+
self._debug['hdpi']['start'] = self._io.pos()
|
|
97
|
+
self.hdpi = self._io.read_u2le()
|
|
98
|
+
self._debug['hdpi']['end'] = self._io.pos()
|
|
99
|
+
self._debug['vdpi']['start'] = self._io.pos()
|
|
100
|
+
self.vdpi = self._io.read_u2le()
|
|
101
|
+
self._debug['vdpi']['end'] = self._io.pos()
|
|
102
|
+
self._debug['palette_16']['start'] = self._io.pos()
|
|
103
|
+
self.palette_16 = self._io.read_bytes(48)
|
|
104
|
+
self._debug['palette_16']['end'] = self._io.pos()
|
|
105
|
+
self._debug['reserved']['start'] = self._io.pos()
|
|
106
|
+
self.reserved = self._io.read_bytes(1)
|
|
107
|
+
self._debug['reserved']['end'] = self._io.pos()
|
|
108
|
+
if not self.reserved == b"\x00":
|
|
109
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x00", self.reserved, self._io, u"/types/header/seq/11")
|
|
110
|
+
self._debug['num_planes']['start'] = self._io.pos()
|
|
111
|
+
self.num_planes = self._io.read_u1()
|
|
112
|
+
self._debug['num_planes']['end'] = self._io.pos()
|
|
113
|
+
self._debug['bytes_per_line']['start'] = self._io.pos()
|
|
114
|
+
self.bytes_per_line = self._io.read_u2le()
|
|
115
|
+
self._debug['bytes_per_line']['end'] = self._io.pos()
|
|
116
|
+
self._debug['palette_info']['start'] = self._io.pos()
|
|
117
|
+
self.palette_info = self._io.read_u2le()
|
|
118
|
+
self._debug['palette_info']['end'] = self._io.pos()
|
|
119
|
+
self._debug['h_screen_size']['start'] = self._io.pos()
|
|
120
|
+
self.h_screen_size = self._io.read_u2le()
|
|
121
|
+
self._debug['h_screen_size']['end'] = self._io.pos()
|
|
122
|
+
self._debug['v_screen_size']['start'] = self._io.pos()
|
|
123
|
+
self.v_screen_size = self._io.read_u2le()
|
|
124
|
+
self._debug['v_screen_size']['end'] = self._io.pos()
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class TPalette256(KaitaiStruct):
|
|
128
|
+
SEQ_FIELDS = ["magic", "colors"]
|
|
129
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
130
|
+
self._io = _io
|
|
131
|
+
self._parent = _parent
|
|
132
|
+
self._root = _root if _root else self
|
|
133
|
+
self._debug = collections.defaultdict(dict)
|
|
134
|
+
|
|
135
|
+
def _read(self):
|
|
136
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
137
|
+
self.magic = self._io.read_bytes(1)
|
|
138
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
139
|
+
if not self.magic == b"\x0C":
|
|
140
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x0C", self.magic, self._io, u"/types/t_palette_256/seq/0")
|
|
141
|
+
self._debug['colors']['start'] = self._io.pos()
|
|
142
|
+
self.colors = [None] * (256)
|
|
143
|
+
for i in range(256):
|
|
144
|
+
if not 'arr' in self._debug['colors']:
|
|
145
|
+
self._debug['colors']['arr'] = []
|
|
146
|
+
self._debug['colors']['arr'].append({'start': self._io.pos()})
|
|
147
|
+
_t_colors = Pcx.Rgb(self._io, self, self._root)
|
|
148
|
+
_t_colors._read()
|
|
149
|
+
self.colors[i] = _t_colors
|
|
150
|
+
self._debug['colors']['arr'][i]['end'] = self._io.pos()
|
|
151
|
+
|
|
152
|
+
self._debug['colors']['end'] = self._io.pos()
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class Rgb(KaitaiStruct):
|
|
156
|
+
SEQ_FIELDS = ["r", "g", "b"]
|
|
157
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
158
|
+
self._io = _io
|
|
159
|
+
self._parent = _parent
|
|
160
|
+
self._root = _root if _root else self
|
|
161
|
+
self._debug = collections.defaultdict(dict)
|
|
162
|
+
|
|
163
|
+
def _read(self):
|
|
164
|
+
self._debug['r']['start'] = self._io.pos()
|
|
165
|
+
self.r = self._io.read_u1()
|
|
166
|
+
self._debug['r']['end'] = self._io.pos()
|
|
167
|
+
self._debug['g']['start'] = self._io.pos()
|
|
168
|
+
self.g = self._io.read_u1()
|
|
169
|
+
self._debug['g']['end'] = self._io.pos()
|
|
170
|
+
self._debug['b']['start'] = self._io.pos()
|
|
171
|
+
self.b = self._io.read_u1()
|
|
172
|
+
self._debug['b']['end'] = self._io.pos()
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@property
|
|
176
|
+
def palette_256(self):
|
|
177
|
+
"""
|
|
178
|
+
.. seealso::
|
|
179
|
+
- "VGA 256 Color Palette Information" - https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
|
|
180
|
+
"""
|
|
181
|
+
if hasattr(self, '_m_palette_256'):
|
|
182
|
+
return self._m_palette_256 if hasattr(self, '_m_palette_256') else None
|
|
183
|
+
|
|
184
|
+
if ((self.hdr.version == Pcx.Versions.v3_0) and (self.hdr.bits_per_pixel == 8) and (self.hdr.num_planes == 1)) :
|
|
185
|
+
_pos = self._io.pos()
|
|
186
|
+
self._io.seek((self._io.size() - 769))
|
|
187
|
+
self._debug['_m_palette_256']['start'] = self._io.pos()
|
|
188
|
+
self._m_palette_256 = Pcx.TPalette256(self._io, self, self._root)
|
|
189
|
+
self._m_palette_256._read()
|
|
190
|
+
self._debug['_m_palette_256']['end'] = self._io.pos()
|
|
191
|
+
self._io.seek(_pos)
|
|
192
|
+
|
|
193
|
+
return self._m_palette_256 if hasattr(self, '_m_palette_256') else None
|
|
194
|
+
|
|
195
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
|
|
8
|
+
|
|
9
|
+
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
|
|
10
|
+
raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__))
|
|
11
|
+
|
|
12
|
+
from polyfile.kaitai.parsers import pcx
|
|
13
|
+
class PcxDcx(KaitaiStruct):
|
|
14
|
+
"""DCX is a simple extension of PCX image format allowing to bundle
|
|
15
|
+
many PCX images (typically, pages of a document) in one file. It saw
|
|
16
|
+
some limited use in DOS-era fax software, but was largely
|
|
17
|
+
superseded with multi-page TIFFs and PDFs since then.
|
|
18
|
+
"""
|
|
19
|
+
SEQ_FIELDS = ["magic", "files"]
|
|
20
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
21
|
+
self._io = _io
|
|
22
|
+
self._parent = _parent
|
|
23
|
+
self._root = _root if _root else self
|
|
24
|
+
self._debug = collections.defaultdict(dict)
|
|
25
|
+
|
|
26
|
+
def _read(self):
|
|
27
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
28
|
+
self.magic = self._io.read_bytes(4)
|
|
29
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
30
|
+
if not self.magic == b"\xB1\x68\xDE\x3A":
|
|
31
|
+
raise kaitaistruct.ValidationNotEqualError(b"\xB1\x68\xDE\x3A", self.magic, self._io, u"/seq/0")
|
|
32
|
+
self._debug['files']['start'] = self._io.pos()
|
|
33
|
+
self.files = []
|
|
34
|
+
i = 0
|
|
35
|
+
while True:
|
|
36
|
+
if not 'arr' in self._debug['files']:
|
|
37
|
+
self._debug['files']['arr'] = []
|
|
38
|
+
self._debug['files']['arr'].append({'start': self._io.pos()})
|
|
39
|
+
_t_files = PcxDcx.PcxOffset(self._io, self, self._root)
|
|
40
|
+
_t_files._read()
|
|
41
|
+
_ = _t_files
|
|
42
|
+
self.files.append(_)
|
|
43
|
+
self._debug['files']['arr'][len(self.files) - 1]['end'] = self._io.pos()
|
|
44
|
+
if _.ofs_body == 0:
|
|
45
|
+
break
|
|
46
|
+
i += 1
|
|
47
|
+
self._debug['files']['end'] = self._io.pos()
|
|
48
|
+
|
|
49
|
+
class PcxOffset(KaitaiStruct):
|
|
50
|
+
SEQ_FIELDS = ["ofs_body"]
|
|
51
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
52
|
+
self._io = _io
|
|
53
|
+
self._parent = _parent
|
|
54
|
+
self._root = _root if _root else self
|
|
55
|
+
self._debug = collections.defaultdict(dict)
|
|
56
|
+
|
|
57
|
+
def _read(self):
|
|
58
|
+
self._debug['ofs_body']['start'] = self._io.pos()
|
|
59
|
+
self.ofs_body = self._io.read_u4le()
|
|
60
|
+
self._debug['ofs_body']['end'] = self._io.pos()
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def body(self):
|
|
64
|
+
if hasattr(self, '_m_body'):
|
|
65
|
+
return self._m_body if hasattr(self, '_m_body') else None
|
|
66
|
+
|
|
67
|
+
if self.ofs_body != 0:
|
|
68
|
+
_pos = self._io.pos()
|
|
69
|
+
self._io.seek(self.ofs_body)
|
|
70
|
+
self._debug['_m_body']['start'] = self._io.pos()
|
|
71
|
+
self._m_body = pcx.Pcx(self._io)
|
|
72
|
+
self._m_body._read()
|
|
73
|
+
self._debug['_m_body']['end'] = self._io.pos()
|
|
74
|
+
self._io.seek(_pos)
|
|
75
|
+
|
|
76
|
+
return self._m_body if hasattr(self, '_m_body') else None
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
@@ -0,0 +1,399 @@
|
|
|
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 php_serialized_value
|
|
14
|
+
class PharWithoutStub(KaitaiStruct):
|
|
15
|
+
"""A phar (PHP archive) file. The phar format is a custom archive format
|
|
16
|
+
from the PHP ecosystem that is used to package a complete PHP library
|
|
17
|
+
or application into a single self-contained archive.
|
|
18
|
+
All phar archives start with an executable PHP stub, which can be used to
|
|
19
|
+
allow executing or including phar files as if they were regular PHP scripts.
|
|
20
|
+
PHP 5.3 and later include the phar extension, which adds native support for
|
|
21
|
+
reading and manipulating phar files.
|
|
22
|
+
|
|
23
|
+
The phar format was originally developed as part of the PEAR library
|
|
24
|
+
PHP_Archive, first released in 2005. Later, a native PHP extension
|
|
25
|
+
named "phar" was developed, which was first released on PECL in 2007,
|
|
26
|
+
and is included with PHP 5.3 and later. The phar extension has effectively
|
|
27
|
+
superseded the PHP_Archive library, which has not been updated since 2010.
|
|
28
|
+
The phar extension is also no longer released independently on PECL;
|
|
29
|
+
it is now developed and released as part of PHP itself.
|
|
30
|
+
|
|
31
|
+
Because of current limitations in Kaitai Struct
|
|
32
|
+
(seekaitai-io/kaitai_struct#158 and kaitai-io/kaitai_struct#538),
|
|
33
|
+
the executable PHP stub that precedes the rest of the archive is not handled
|
|
34
|
+
by this spec. Before parsing a phar using this spec, the stub must be
|
|
35
|
+
removed manually.
|
|
36
|
+
|
|
37
|
+
A phar's stub is terminated by the special token `__HALT_COMPILER();`
|
|
38
|
+
(which may be followed by at most one space, the PHP tag end `?>`,
|
|
39
|
+
and an optional line terminator). The stub termination sequence is
|
|
40
|
+
immediately followed by the remaining parts of the phar format,
|
|
41
|
+
as described in this spec.
|
|
42
|
+
|
|
43
|
+
The phar stub usually contains code that loads the phar and runs
|
|
44
|
+
a contained PHP file, but this is not required. A minimal valid phar stub
|
|
45
|
+
is `<?php __HALT_COMPILER();` - such a stub makes it impossible to execute
|
|
46
|
+
the phar directly, but still allows loading or manipulating it using the
|
|
47
|
+
phar extension.
|
|
48
|
+
|
|
49
|
+
Note: The phar format does not specify any encoding for text fields
|
|
50
|
+
(stub, alias name, and all file names), so these fields may contain arbitrary
|
|
51
|
+
binary data. The actual text encoding used in a specific phar file usually
|
|
52
|
+
depends on the application that created the phar, and on the
|
|
53
|
+
standard encoding of the system on which the phar was created.
|
|
54
|
+
|
|
55
|
+
.. seealso::
|
|
56
|
+
Source - https://www.php.net/manual/en/phar.fileformat.php
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
.. seealso::
|
|
60
|
+
Source - https://github.com/php/php-src/tree/master/ext/phar
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
.. seealso::
|
|
64
|
+
Source - https://svn.php.net/viewvc/pecl/phar/
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
.. seealso::
|
|
68
|
+
Source - https://svn.php.net/viewvc/pear/packages/PHP_Archive/
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
class SignatureType(Enum):
|
|
72
|
+
md5 = 1
|
|
73
|
+
sha1 = 2
|
|
74
|
+
sha256 = 4
|
|
75
|
+
sha512 = 8
|
|
76
|
+
openssl = 16
|
|
77
|
+
SEQ_FIELDS = ["manifest", "files", "signature"]
|
|
78
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
79
|
+
self._io = _io
|
|
80
|
+
self._parent = _parent
|
|
81
|
+
self._root = _root if _root else self
|
|
82
|
+
self._debug = collections.defaultdict(dict)
|
|
83
|
+
|
|
84
|
+
def _read(self):
|
|
85
|
+
self._debug['manifest']['start'] = self._io.pos()
|
|
86
|
+
self.manifest = PharWithoutStub.Manifest(self._io, self, self._root)
|
|
87
|
+
self.manifest._read()
|
|
88
|
+
self._debug['manifest']['end'] = self._io.pos()
|
|
89
|
+
self._debug['files']['start'] = self._io.pos()
|
|
90
|
+
self.files = [None] * (self.manifest.num_files)
|
|
91
|
+
for i in range(self.manifest.num_files):
|
|
92
|
+
if not 'arr' in self._debug['files']:
|
|
93
|
+
self._debug['files']['arr'] = []
|
|
94
|
+
self._debug['files']['arr'].append({'start': self._io.pos()})
|
|
95
|
+
self.files[i] = self._io.read_bytes(self.manifest.file_entries[i].len_data_compressed)
|
|
96
|
+
self._debug['files']['arr'][i]['end'] = self._io.pos()
|
|
97
|
+
|
|
98
|
+
self._debug['files']['end'] = self._io.pos()
|
|
99
|
+
if self.manifest.flags.has_signature:
|
|
100
|
+
self._debug['signature']['start'] = self._io.pos()
|
|
101
|
+
self._raw_signature = self._io.read_bytes_full()
|
|
102
|
+
_io__raw_signature = KaitaiStream(BytesIO(self._raw_signature))
|
|
103
|
+
self.signature = PharWithoutStub.Signature(_io__raw_signature, self, self._root)
|
|
104
|
+
self.signature._read()
|
|
105
|
+
self._debug['signature']['end'] = self._io.pos()
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class SerializedValue(KaitaiStruct):
|
|
109
|
+
SEQ_FIELDS = ["raw"]
|
|
110
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
111
|
+
self._io = _io
|
|
112
|
+
self._parent = _parent
|
|
113
|
+
self._root = _root if _root else self
|
|
114
|
+
self._debug = collections.defaultdict(dict)
|
|
115
|
+
|
|
116
|
+
def _read(self):
|
|
117
|
+
self._debug['raw']['start'] = self._io.pos()
|
|
118
|
+
self.raw = self._io.read_bytes_full()
|
|
119
|
+
self._debug['raw']['end'] = self._io.pos()
|
|
120
|
+
|
|
121
|
+
@property
|
|
122
|
+
def parsed(self):
|
|
123
|
+
"""The serialized value, parsed as a structure."""
|
|
124
|
+
if hasattr(self, '_m_parsed'):
|
|
125
|
+
return self._m_parsed if hasattr(self, '_m_parsed') else None
|
|
126
|
+
|
|
127
|
+
_pos = self._io.pos()
|
|
128
|
+
self._io.seek(0)
|
|
129
|
+
self._debug['_m_parsed']['start'] = self._io.pos()
|
|
130
|
+
self._m_parsed = php_serialized_value.PhpSerializedValue(self._io)
|
|
131
|
+
self._m_parsed._read()
|
|
132
|
+
self._debug['_m_parsed']['end'] = self._io.pos()
|
|
133
|
+
self._io.seek(_pos)
|
|
134
|
+
return self._m_parsed if hasattr(self, '_m_parsed') else None
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class Signature(KaitaiStruct):
|
|
138
|
+
SEQ_FIELDS = ["data", "type", "magic"]
|
|
139
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
140
|
+
self._io = _io
|
|
141
|
+
self._parent = _parent
|
|
142
|
+
self._root = _root if _root else self
|
|
143
|
+
self._debug = collections.defaultdict(dict)
|
|
144
|
+
|
|
145
|
+
def _read(self):
|
|
146
|
+
self._debug['data']['start'] = self._io.pos()
|
|
147
|
+
self.data = self._io.read_bytes(((self._io.size() - self._io.pos()) - 8))
|
|
148
|
+
self._debug['data']['end'] = self._io.pos()
|
|
149
|
+
self._debug['type']['start'] = self._io.pos()
|
|
150
|
+
self.type = KaitaiStream.resolve_enum(PharWithoutStub.SignatureType, self._io.read_u4le())
|
|
151
|
+
self._debug['type']['end'] = self._io.pos()
|
|
152
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
153
|
+
self.magic = self._io.read_bytes(4)
|
|
154
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
155
|
+
if not self.magic == b"\x47\x42\x4D\x42":
|
|
156
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x47\x42\x4D\x42", self.magic, self._io, u"/types/signature/seq/2")
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class FileFlags(KaitaiStruct):
|
|
160
|
+
SEQ_FIELDS = ["value"]
|
|
161
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
162
|
+
self._io = _io
|
|
163
|
+
self._parent = _parent
|
|
164
|
+
self._root = _root if _root else self
|
|
165
|
+
self._debug = collections.defaultdict(dict)
|
|
166
|
+
|
|
167
|
+
def _read(self):
|
|
168
|
+
self._debug['value']['start'] = self._io.pos()
|
|
169
|
+
self.value = self._io.read_u4le()
|
|
170
|
+
self._debug['value']['end'] = self._io.pos()
|
|
171
|
+
|
|
172
|
+
@property
|
|
173
|
+
def permissions(self):
|
|
174
|
+
"""The file's permission bits."""
|
|
175
|
+
if hasattr(self, '_m_permissions'):
|
|
176
|
+
return self._m_permissions if hasattr(self, '_m_permissions') else None
|
|
177
|
+
|
|
178
|
+
self._m_permissions = (self.value & 511)
|
|
179
|
+
return self._m_permissions if hasattr(self, '_m_permissions') else None
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def zlib_compressed(self):
|
|
183
|
+
"""Whether this file's data is stored using zlib compression."""
|
|
184
|
+
if hasattr(self, '_m_zlib_compressed'):
|
|
185
|
+
return self._m_zlib_compressed if hasattr(self, '_m_zlib_compressed') else None
|
|
186
|
+
|
|
187
|
+
self._m_zlib_compressed = (self.value & 4096) != 0
|
|
188
|
+
return self._m_zlib_compressed if hasattr(self, '_m_zlib_compressed') else None
|
|
189
|
+
|
|
190
|
+
@property
|
|
191
|
+
def bzip2_compressed(self):
|
|
192
|
+
"""Whether this file's data is stored using bzip2 compression."""
|
|
193
|
+
if hasattr(self, '_m_bzip2_compressed'):
|
|
194
|
+
return self._m_bzip2_compressed if hasattr(self, '_m_bzip2_compressed') else None
|
|
195
|
+
|
|
196
|
+
self._m_bzip2_compressed = (self.value & 8192) != 0
|
|
197
|
+
return self._m_bzip2_compressed if hasattr(self, '_m_bzip2_compressed') else None
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class ApiVersion(KaitaiStruct):
|
|
201
|
+
"""A phar API version number. This version number is meant to indicate
|
|
202
|
+
which features are used in a specific phar, so that tools reading
|
|
203
|
+
the phar can easily check that they support all necessary features.
|
|
204
|
+
|
|
205
|
+
The following API versions exist so far:
|
|
206
|
+
|
|
207
|
+
* 0.5, 0.6, 0.7, 0.7.1: The first official API versions. At this point,
|
|
208
|
+
the phar format was only used by the PHP_Archive library, and the
|
|
209
|
+
API version numbers were identical to the PHP_Archive versions that
|
|
210
|
+
supported them. Development of the native phar extension started around
|
|
211
|
+
API version 0.7. These API versions could only be queried using the
|
|
212
|
+
`PHP_Archive::APIversion()` method, but were not stored physically
|
|
213
|
+
in archives. These API versions are not supported by this spec.
|
|
214
|
+
* 0.8.0: Used by PHP_Archive 0.8.0 (released 2006-07-18) and
|
|
215
|
+
later development versions of the phar extension. This is the first
|
|
216
|
+
version number to be physically stored in archives. This API version
|
|
217
|
+
is not supported by this spec.
|
|
218
|
+
* 0.9.0: Used by later development/early beta versions of the
|
|
219
|
+
phar extension. Also temporarily used by PHP_Archive 0.9.0
|
|
220
|
+
(released 2006-12-15), but reverted back to API version 0.8.0 in
|
|
221
|
+
PHP_Archive 0.9.1 (released 2007-01-05).
|
|
222
|
+
* 1.0.0: Supported since PHP_Archive 0.10.0 (released 2007-05-29)
|
|
223
|
+
and phar extension 1.0.0 (released 2007-03-28). This is the first
|
|
224
|
+
stable, forwards-compatible and documented version of the format.
|
|
225
|
+
* 1.1.0: Supported since PHP_Archive 0.12.0 (released 2015-07-06)
|
|
226
|
+
and phar extension 1.1.0 (released 2007-04-12). Adds SHA-256 and
|
|
227
|
+
SHA-512 signature types.
|
|
228
|
+
* 1.1.1: Supported since phar extension 2.0.0 (released 2009-07-29 and
|
|
229
|
+
included with PHP 5.3 and later). (PHP_Archive 0.12.0 also supports
|
|
230
|
+
all features from API verison 1.1.1, but it reports API version 1.1.0.)
|
|
231
|
+
Adds the OpenSSL signature type and support for storing
|
|
232
|
+
empty directories.
|
|
233
|
+
"""
|
|
234
|
+
SEQ_FIELDS = ["release", "major", "minor", "unused"]
|
|
235
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
236
|
+
self._io = _io
|
|
237
|
+
self._parent = _parent
|
|
238
|
+
self._root = _root if _root else self
|
|
239
|
+
self._debug = collections.defaultdict(dict)
|
|
240
|
+
|
|
241
|
+
def _read(self):
|
|
242
|
+
self._debug['release']['start'] = self._io.pos()
|
|
243
|
+
self.release = self._io.read_bits_int_be(4)
|
|
244
|
+
self._debug['release']['end'] = self._io.pos()
|
|
245
|
+
self._debug['major']['start'] = self._io.pos()
|
|
246
|
+
self.major = self._io.read_bits_int_be(4)
|
|
247
|
+
self._debug['major']['end'] = self._io.pos()
|
|
248
|
+
self._debug['minor']['start'] = self._io.pos()
|
|
249
|
+
self.minor = self._io.read_bits_int_be(4)
|
|
250
|
+
self._debug['minor']['end'] = self._io.pos()
|
|
251
|
+
self._debug['unused']['start'] = self._io.pos()
|
|
252
|
+
self.unused = self._io.read_bits_int_be(4)
|
|
253
|
+
self._debug['unused']['end'] = self._io.pos()
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class GlobalFlags(KaitaiStruct):
|
|
257
|
+
SEQ_FIELDS = ["value"]
|
|
258
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
259
|
+
self._io = _io
|
|
260
|
+
self._parent = _parent
|
|
261
|
+
self._root = _root if _root else self
|
|
262
|
+
self._debug = collections.defaultdict(dict)
|
|
263
|
+
|
|
264
|
+
def _read(self):
|
|
265
|
+
self._debug['value']['start'] = self._io.pos()
|
|
266
|
+
self.value = self._io.read_u4le()
|
|
267
|
+
self._debug['value']['end'] = self._io.pos()
|
|
268
|
+
|
|
269
|
+
@property
|
|
270
|
+
def any_zlib_compressed(self):
|
|
271
|
+
"""Whether any of the files in this phar are stored using
|
|
272
|
+
zlib compression.
|
|
273
|
+
"""
|
|
274
|
+
if hasattr(self, '_m_any_zlib_compressed'):
|
|
275
|
+
return self._m_any_zlib_compressed if hasattr(self, '_m_any_zlib_compressed') else None
|
|
276
|
+
|
|
277
|
+
self._m_any_zlib_compressed = (self.value & 4096) != 0
|
|
278
|
+
return self._m_any_zlib_compressed if hasattr(self, '_m_any_zlib_compressed') else None
|
|
279
|
+
|
|
280
|
+
@property
|
|
281
|
+
def any_bzip2_compressed(self):
|
|
282
|
+
"""Whether any of the files in this phar are stored using
|
|
283
|
+
bzip2 compression.
|
|
284
|
+
"""
|
|
285
|
+
if hasattr(self, '_m_any_bzip2_compressed'):
|
|
286
|
+
return self._m_any_bzip2_compressed if hasattr(self, '_m_any_bzip2_compressed') else None
|
|
287
|
+
|
|
288
|
+
self._m_any_bzip2_compressed = (self.value & 8192) != 0
|
|
289
|
+
return self._m_any_bzip2_compressed if hasattr(self, '_m_any_bzip2_compressed') else None
|
|
290
|
+
|
|
291
|
+
@property
|
|
292
|
+
def has_signature(self):
|
|
293
|
+
"""Whether this phar contains a signature."""
|
|
294
|
+
if hasattr(self, '_m_has_signature'):
|
|
295
|
+
return self._m_has_signature if hasattr(self, '_m_has_signature') else None
|
|
296
|
+
|
|
297
|
+
self._m_has_signature = (self.value & 65536) != 0
|
|
298
|
+
return self._m_has_signature if hasattr(self, '_m_has_signature') else None
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
class Manifest(KaitaiStruct):
|
|
302
|
+
SEQ_FIELDS = ["len_manifest", "num_files", "api_version", "flags", "len_alias", "alias", "len_metadata", "metadata", "file_entries"]
|
|
303
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
304
|
+
self._io = _io
|
|
305
|
+
self._parent = _parent
|
|
306
|
+
self._root = _root if _root else self
|
|
307
|
+
self._debug = collections.defaultdict(dict)
|
|
308
|
+
|
|
309
|
+
def _read(self):
|
|
310
|
+
self._debug['len_manifest']['start'] = self._io.pos()
|
|
311
|
+
self.len_manifest = self._io.read_u4le()
|
|
312
|
+
self._debug['len_manifest']['end'] = self._io.pos()
|
|
313
|
+
self._debug['num_files']['start'] = self._io.pos()
|
|
314
|
+
self.num_files = self._io.read_u4le()
|
|
315
|
+
self._debug['num_files']['end'] = self._io.pos()
|
|
316
|
+
self._debug['api_version']['start'] = self._io.pos()
|
|
317
|
+
self.api_version = PharWithoutStub.ApiVersion(self._io, self, self._root)
|
|
318
|
+
self.api_version._read()
|
|
319
|
+
self._debug['api_version']['end'] = self._io.pos()
|
|
320
|
+
self._debug['flags']['start'] = self._io.pos()
|
|
321
|
+
self.flags = PharWithoutStub.GlobalFlags(self._io, self, self._root)
|
|
322
|
+
self.flags._read()
|
|
323
|
+
self._debug['flags']['end'] = self._io.pos()
|
|
324
|
+
self._debug['len_alias']['start'] = self._io.pos()
|
|
325
|
+
self.len_alias = self._io.read_u4le()
|
|
326
|
+
self._debug['len_alias']['end'] = self._io.pos()
|
|
327
|
+
self._debug['alias']['start'] = self._io.pos()
|
|
328
|
+
self.alias = self._io.read_bytes(self.len_alias)
|
|
329
|
+
self._debug['alias']['end'] = self._io.pos()
|
|
330
|
+
self._debug['len_metadata']['start'] = self._io.pos()
|
|
331
|
+
self.len_metadata = self._io.read_u4le()
|
|
332
|
+
self._debug['len_metadata']['end'] = self._io.pos()
|
|
333
|
+
if self.len_metadata != 0:
|
|
334
|
+
self._debug['metadata']['start'] = self._io.pos()
|
|
335
|
+
self._raw_metadata = self._io.read_bytes(self.len_metadata)
|
|
336
|
+
_io__raw_metadata = KaitaiStream(BytesIO(self._raw_metadata))
|
|
337
|
+
self.metadata = PharWithoutStub.SerializedValue(_io__raw_metadata, self, self._root)
|
|
338
|
+
self.metadata._read()
|
|
339
|
+
self._debug['metadata']['end'] = self._io.pos()
|
|
340
|
+
|
|
341
|
+
self._debug['file_entries']['start'] = self._io.pos()
|
|
342
|
+
self.file_entries = [None] * (self.num_files)
|
|
343
|
+
for i in range(self.num_files):
|
|
344
|
+
if not 'arr' in self._debug['file_entries']:
|
|
345
|
+
self._debug['file_entries']['arr'] = []
|
|
346
|
+
self._debug['file_entries']['arr'].append({'start': self._io.pos()})
|
|
347
|
+
_t_file_entries = PharWithoutStub.FileEntry(self._io, self, self._root)
|
|
348
|
+
_t_file_entries._read()
|
|
349
|
+
self.file_entries[i] = _t_file_entries
|
|
350
|
+
self._debug['file_entries']['arr'][i]['end'] = self._io.pos()
|
|
351
|
+
|
|
352
|
+
self._debug['file_entries']['end'] = self._io.pos()
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
class FileEntry(KaitaiStruct):
|
|
356
|
+
SEQ_FIELDS = ["len_filename", "filename", "len_data_uncompressed", "timestamp", "len_data_compressed", "crc32", "flags", "len_metadata", "metadata"]
|
|
357
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
358
|
+
self._io = _io
|
|
359
|
+
self._parent = _parent
|
|
360
|
+
self._root = _root if _root else self
|
|
361
|
+
self._debug = collections.defaultdict(dict)
|
|
362
|
+
|
|
363
|
+
def _read(self):
|
|
364
|
+
self._debug['len_filename']['start'] = self._io.pos()
|
|
365
|
+
self.len_filename = self._io.read_u4le()
|
|
366
|
+
self._debug['len_filename']['end'] = self._io.pos()
|
|
367
|
+
self._debug['filename']['start'] = self._io.pos()
|
|
368
|
+
self.filename = self._io.read_bytes(self.len_filename)
|
|
369
|
+
self._debug['filename']['end'] = self._io.pos()
|
|
370
|
+
self._debug['len_data_uncompressed']['start'] = self._io.pos()
|
|
371
|
+
self.len_data_uncompressed = self._io.read_u4le()
|
|
372
|
+
self._debug['len_data_uncompressed']['end'] = self._io.pos()
|
|
373
|
+
self._debug['timestamp']['start'] = self._io.pos()
|
|
374
|
+
self.timestamp = self._io.read_u4le()
|
|
375
|
+
self._debug['timestamp']['end'] = self._io.pos()
|
|
376
|
+
self._debug['len_data_compressed']['start'] = self._io.pos()
|
|
377
|
+
self.len_data_compressed = self._io.read_u4le()
|
|
378
|
+
self._debug['len_data_compressed']['end'] = self._io.pos()
|
|
379
|
+
self._debug['crc32']['start'] = self._io.pos()
|
|
380
|
+
self.crc32 = self._io.read_u4le()
|
|
381
|
+
self._debug['crc32']['end'] = self._io.pos()
|
|
382
|
+
self._debug['flags']['start'] = self._io.pos()
|
|
383
|
+
self.flags = PharWithoutStub.FileFlags(self._io, self, self._root)
|
|
384
|
+
self.flags._read()
|
|
385
|
+
self._debug['flags']['end'] = self._io.pos()
|
|
386
|
+
self._debug['len_metadata']['start'] = self._io.pos()
|
|
387
|
+
self.len_metadata = self._io.read_u4le()
|
|
388
|
+
self._debug['len_metadata']['end'] = self._io.pos()
|
|
389
|
+
if self.len_metadata != 0:
|
|
390
|
+
self._debug['metadata']['start'] = self._io.pos()
|
|
391
|
+
self._raw_metadata = self._io.read_bytes(self.len_metadata)
|
|
392
|
+
_io__raw_metadata = KaitaiStream(BytesIO(self._raw_metadata))
|
|
393
|
+
self.metadata = PharWithoutStub.SerializedValue(_io__raw_metadata, self, self._root)
|
|
394
|
+
self.metadata._read()
|
|
395
|
+
self._debug['metadata']['end'] = self._io.pos()
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|