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,196 @@
|
|
|
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
|
+
class ApmPartitionTable(KaitaiStruct):
|
|
13
|
+
"""
|
|
14
|
+
.. seealso::
|
|
15
|
+
Source - https://en.wikipedia.org/wiki/Apple_Partition_Map
|
|
16
|
+
"""
|
|
17
|
+
SEQ_FIELDS = []
|
|
18
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
19
|
+
self._io = _io
|
|
20
|
+
self._parent = _parent
|
|
21
|
+
self._root = _root if _root else self
|
|
22
|
+
self._debug = collections.defaultdict(dict)
|
|
23
|
+
|
|
24
|
+
def _read(self):
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
class PartitionEntry(KaitaiStruct):
|
|
28
|
+
SEQ_FIELDS = ["magic", "reserved_1", "number_of_partitions", "partition_start", "partition_size", "partition_name", "partition_type", "data_start", "data_size", "partition_status", "boot_code_start", "boot_code_size", "boot_loader_address", "reserved_2", "boot_code_entry", "reserved_3", "boot_code_cksum", "processor_type"]
|
|
29
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
30
|
+
self._io = _io
|
|
31
|
+
self._parent = _parent
|
|
32
|
+
self._root = _root if _root else self
|
|
33
|
+
self._debug = collections.defaultdict(dict)
|
|
34
|
+
|
|
35
|
+
def _read(self):
|
|
36
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
37
|
+
self.magic = self._io.read_bytes(2)
|
|
38
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
39
|
+
if not self.magic == b"\x50\x4D":
|
|
40
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x50\x4D", self.magic, self._io, u"/types/partition_entry/seq/0")
|
|
41
|
+
self._debug['reserved_1']['start'] = self._io.pos()
|
|
42
|
+
self.reserved_1 = self._io.read_bytes(2)
|
|
43
|
+
self._debug['reserved_1']['end'] = self._io.pos()
|
|
44
|
+
self._debug['number_of_partitions']['start'] = self._io.pos()
|
|
45
|
+
self.number_of_partitions = self._io.read_u4be()
|
|
46
|
+
self._debug['number_of_partitions']['end'] = self._io.pos()
|
|
47
|
+
self._debug['partition_start']['start'] = self._io.pos()
|
|
48
|
+
self.partition_start = self._io.read_u4be()
|
|
49
|
+
self._debug['partition_start']['end'] = self._io.pos()
|
|
50
|
+
self._debug['partition_size']['start'] = self._io.pos()
|
|
51
|
+
self.partition_size = self._io.read_u4be()
|
|
52
|
+
self._debug['partition_size']['end'] = self._io.pos()
|
|
53
|
+
self._debug['partition_name']['start'] = self._io.pos()
|
|
54
|
+
self.partition_name = (KaitaiStream.bytes_terminate(self._io.read_bytes(32), 0, False)).decode(u"ascii")
|
|
55
|
+
self._debug['partition_name']['end'] = self._io.pos()
|
|
56
|
+
self._debug['partition_type']['start'] = self._io.pos()
|
|
57
|
+
self.partition_type = (KaitaiStream.bytes_terminate(self._io.read_bytes(32), 0, False)).decode(u"ascii")
|
|
58
|
+
self._debug['partition_type']['end'] = self._io.pos()
|
|
59
|
+
self._debug['data_start']['start'] = self._io.pos()
|
|
60
|
+
self.data_start = self._io.read_u4be()
|
|
61
|
+
self._debug['data_start']['end'] = self._io.pos()
|
|
62
|
+
self._debug['data_size']['start'] = self._io.pos()
|
|
63
|
+
self.data_size = self._io.read_u4be()
|
|
64
|
+
self._debug['data_size']['end'] = self._io.pos()
|
|
65
|
+
self._debug['partition_status']['start'] = self._io.pos()
|
|
66
|
+
self.partition_status = self._io.read_u4be()
|
|
67
|
+
self._debug['partition_status']['end'] = self._io.pos()
|
|
68
|
+
self._debug['boot_code_start']['start'] = self._io.pos()
|
|
69
|
+
self.boot_code_start = self._io.read_u4be()
|
|
70
|
+
self._debug['boot_code_start']['end'] = self._io.pos()
|
|
71
|
+
self._debug['boot_code_size']['start'] = self._io.pos()
|
|
72
|
+
self.boot_code_size = self._io.read_u4be()
|
|
73
|
+
self._debug['boot_code_size']['end'] = self._io.pos()
|
|
74
|
+
self._debug['boot_loader_address']['start'] = self._io.pos()
|
|
75
|
+
self.boot_loader_address = self._io.read_u4be()
|
|
76
|
+
self._debug['boot_loader_address']['end'] = self._io.pos()
|
|
77
|
+
self._debug['reserved_2']['start'] = self._io.pos()
|
|
78
|
+
self.reserved_2 = self._io.read_bytes(4)
|
|
79
|
+
self._debug['reserved_2']['end'] = self._io.pos()
|
|
80
|
+
self._debug['boot_code_entry']['start'] = self._io.pos()
|
|
81
|
+
self.boot_code_entry = self._io.read_u4be()
|
|
82
|
+
self._debug['boot_code_entry']['end'] = self._io.pos()
|
|
83
|
+
self._debug['reserved_3']['start'] = self._io.pos()
|
|
84
|
+
self.reserved_3 = self._io.read_bytes(4)
|
|
85
|
+
self._debug['reserved_3']['end'] = self._io.pos()
|
|
86
|
+
self._debug['boot_code_cksum']['start'] = self._io.pos()
|
|
87
|
+
self.boot_code_cksum = self._io.read_u4be()
|
|
88
|
+
self._debug['boot_code_cksum']['end'] = self._io.pos()
|
|
89
|
+
self._debug['processor_type']['start'] = self._io.pos()
|
|
90
|
+
self.processor_type = (KaitaiStream.bytes_terminate(self._io.read_bytes(16), 0, False)).decode(u"ascii")
|
|
91
|
+
self._debug['processor_type']['end'] = self._io.pos()
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def partition(self):
|
|
95
|
+
if hasattr(self, '_m_partition'):
|
|
96
|
+
return self._m_partition if hasattr(self, '_m_partition') else None
|
|
97
|
+
|
|
98
|
+
if (self.partition_status & 1) != 0:
|
|
99
|
+
io = self._root._io
|
|
100
|
+
_pos = io.pos()
|
|
101
|
+
io.seek((self.partition_start * self._root.sector_size))
|
|
102
|
+
self._debug['_m_partition']['start'] = io.pos()
|
|
103
|
+
self._m_partition = io.read_bytes((self.partition_size * self._root.sector_size))
|
|
104
|
+
self._debug['_m_partition']['end'] = io.pos()
|
|
105
|
+
io.seek(_pos)
|
|
106
|
+
|
|
107
|
+
return self._m_partition if hasattr(self, '_m_partition') else None
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def data(self):
|
|
111
|
+
if hasattr(self, '_m_data'):
|
|
112
|
+
return self._m_data if hasattr(self, '_m_data') else None
|
|
113
|
+
|
|
114
|
+
io = self._root._io
|
|
115
|
+
_pos = io.pos()
|
|
116
|
+
io.seek((self.data_start * self._root.sector_size))
|
|
117
|
+
self._debug['_m_data']['start'] = io.pos()
|
|
118
|
+
self._m_data = io.read_bytes((self.data_size * self._root.sector_size))
|
|
119
|
+
self._debug['_m_data']['end'] = io.pos()
|
|
120
|
+
io.seek(_pos)
|
|
121
|
+
return self._m_data if hasattr(self, '_m_data') else None
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def boot_code(self):
|
|
125
|
+
if hasattr(self, '_m_boot_code'):
|
|
126
|
+
return self._m_boot_code if hasattr(self, '_m_boot_code') else None
|
|
127
|
+
|
|
128
|
+
io = self._root._io
|
|
129
|
+
_pos = io.pos()
|
|
130
|
+
io.seek((self.boot_code_start * self._root.sector_size))
|
|
131
|
+
self._debug['_m_boot_code']['start'] = io.pos()
|
|
132
|
+
self._m_boot_code = io.read_bytes(self.boot_code_size)
|
|
133
|
+
self._debug['_m_boot_code']['end'] = io.pos()
|
|
134
|
+
io.seek(_pos)
|
|
135
|
+
return self._m_boot_code if hasattr(self, '_m_boot_code') else None
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@property
|
|
139
|
+
def sector_size(self):
|
|
140
|
+
"""0x200 (512) bytes for disks, 0x1000 (4096) bytes is not supported by APM
|
|
141
|
+
0x800 (2048) bytes for CDROM
|
|
142
|
+
"""
|
|
143
|
+
if hasattr(self, '_m_sector_size'):
|
|
144
|
+
return self._m_sector_size if hasattr(self, '_m_sector_size') else None
|
|
145
|
+
|
|
146
|
+
self._m_sector_size = 512
|
|
147
|
+
return self._m_sector_size if hasattr(self, '_m_sector_size') else None
|
|
148
|
+
|
|
149
|
+
@property
|
|
150
|
+
def partition_lookup(self):
|
|
151
|
+
"""Every partition entry contains the number of partition entries.
|
|
152
|
+
We parse the first entry, to know how many to parse, including the first one.
|
|
153
|
+
No logic is given what to do if other entries have a different number.
|
|
154
|
+
"""
|
|
155
|
+
if hasattr(self, '_m_partition_lookup'):
|
|
156
|
+
return self._m_partition_lookup if hasattr(self, '_m_partition_lookup') else None
|
|
157
|
+
|
|
158
|
+
io = self._root._io
|
|
159
|
+
_pos = io.pos()
|
|
160
|
+
io.seek(self._root.sector_size)
|
|
161
|
+
self._debug['_m_partition_lookup']['start'] = io.pos()
|
|
162
|
+
self._raw__m_partition_lookup = io.read_bytes(self.sector_size)
|
|
163
|
+
_io__raw__m_partition_lookup = KaitaiStream(BytesIO(self._raw__m_partition_lookup))
|
|
164
|
+
self._m_partition_lookup = ApmPartitionTable.PartitionEntry(_io__raw__m_partition_lookup, self, self._root)
|
|
165
|
+
self._m_partition_lookup._read()
|
|
166
|
+
self._debug['_m_partition_lookup']['end'] = io.pos()
|
|
167
|
+
io.seek(_pos)
|
|
168
|
+
return self._m_partition_lookup if hasattr(self, '_m_partition_lookup') else None
|
|
169
|
+
|
|
170
|
+
@property
|
|
171
|
+
def partition_entries(self):
|
|
172
|
+
if hasattr(self, '_m_partition_entries'):
|
|
173
|
+
return self._m_partition_entries if hasattr(self, '_m_partition_entries') else None
|
|
174
|
+
|
|
175
|
+
io = self._root._io
|
|
176
|
+
_pos = io.pos()
|
|
177
|
+
io.seek(self._root.sector_size)
|
|
178
|
+
self._debug['_m_partition_entries']['start'] = io.pos()
|
|
179
|
+
self._raw__m_partition_entries = [None] * (self._root.partition_lookup.number_of_partitions)
|
|
180
|
+
self._m_partition_entries = [None] * (self._root.partition_lookup.number_of_partitions)
|
|
181
|
+
for i in range(self._root.partition_lookup.number_of_partitions):
|
|
182
|
+
if not 'arr' in self._debug['_m_partition_entries']:
|
|
183
|
+
self._debug['_m_partition_entries']['arr'] = []
|
|
184
|
+
self._debug['_m_partition_entries']['arr'].append({'start': io.pos()})
|
|
185
|
+
self._raw__m_partition_entries[i] = io.read_bytes(self.sector_size)
|
|
186
|
+
_io__raw__m_partition_entries = KaitaiStream(BytesIO(self._raw__m_partition_entries[i]))
|
|
187
|
+
_t__m_partition_entries = ApmPartitionTable.PartitionEntry(_io__raw__m_partition_entries, self, self._root)
|
|
188
|
+
_t__m_partition_entries._read()
|
|
189
|
+
self._m_partition_entries[i] = _t__m_partition_entries
|
|
190
|
+
self._debug['_m_partition_entries']['arr'][i]['end'] = io.pos()
|
|
191
|
+
|
|
192
|
+
self._debug['_m_partition_entries']['end'] = io.pos()
|
|
193
|
+
io.seek(_pos)
|
|
194
|
+
return self._m_partition_entries if hasattr(self, '_m_partition_entries') else None
|
|
195
|
+
|
|
196
|
+
|
|
@@ -0,0 +1,180 @@
|
|
|
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 AppleSingleDouble(KaitaiStruct):
|
|
14
|
+
"""AppleSingle and AppleDouble files are used by certain Mac
|
|
15
|
+
applications (e.g. Finder) to store Mac-specific file attributes on
|
|
16
|
+
filesystems that do not support that.
|
|
17
|
+
|
|
18
|
+
Syntactically, both formats are the same, the only difference is how
|
|
19
|
+
they are being used:
|
|
20
|
+
|
|
21
|
+
* AppleSingle means that only one file will be created on external
|
|
22
|
+
filesystem that will hold both the data (AKA "data fork" in Apple
|
|
23
|
+
terminology), and the attributes (AKA "resource fork").
|
|
24
|
+
* AppleDouble means that two files will be created: a normal file
|
|
25
|
+
that keeps the data ("data fork") is kept separately from an
|
|
26
|
+
auxiliary file that contains attributes ("resource fork"), which
|
|
27
|
+
is kept with the same name, but starting with an extra dot and
|
|
28
|
+
underscore `._` to keep it hidden.
|
|
29
|
+
|
|
30
|
+
In modern practice (Mac OS X), Finder only uses AppleDouble to keep
|
|
31
|
+
compatibility with other OSes, as virtually nobody outside of Mac
|
|
32
|
+
understands how to access data in AppleSingle container.
|
|
33
|
+
|
|
34
|
+
.. seealso::
|
|
35
|
+
Source - http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
class FileType(Enum):
|
|
39
|
+
apple_single = 333312
|
|
40
|
+
apple_double = 333319
|
|
41
|
+
SEQ_FIELDS = ["magic", "version", "reserved", "num_entries", "entries"]
|
|
42
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
43
|
+
self._io = _io
|
|
44
|
+
self._parent = _parent
|
|
45
|
+
self._root = _root if _root else self
|
|
46
|
+
self._debug = collections.defaultdict(dict)
|
|
47
|
+
|
|
48
|
+
def _read(self):
|
|
49
|
+
self._debug['magic']['start'] = self._io.pos()
|
|
50
|
+
self.magic = KaitaiStream.resolve_enum(AppleSingleDouble.FileType, self._io.read_u4be())
|
|
51
|
+
self._debug['magic']['end'] = self._io.pos()
|
|
52
|
+
self._debug['version']['start'] = self._io.pos()
|
|
53
|
+
self.version = self._io.read_u4be()
|
|
54
|
+
self._debug['version']['end'] = self._io.pos()
|
|
55
|
+
self._debug['reserved']['start'] = self._io.pos()
|
|
56
|
+
self.reserved = self._io.read_bytes(16)
|
|
57
|
+
self._debug['reserved']['end'] = self._io.pos()
|
|
58
|
+
self._debug['num_entries']['start'] = self._io.pos()
|
|
59
|
+
self.num_entries = self._io.read_u2be()
|
|
60
|
+
self._debug['num_entries']['end'] = self._io.pos()
|
|
61
|
+
self._debug['entries']['start'] = self._io.pos()
|
|
62
|
+
self.entries = [None] * (self.num_entries)
|
|
63
|
+
for i in range(self.num_entries):
|
|
64
|
+
if not 'arr' in self._debug['entries']:
|
|
65
|
+
self._debug['entries']['arr'] = []
|
|
66
|
+
self._debug['entries']['arr'].append({'start': self._io.pos()})
|
|
67
|
+
_t_entries = AppleSingleDouble.Entry(self._io, self, self._root)
|
|
68
|
+
_t_entries._read()
|
|
69
|
+
self.entries[i] = _t_entries
|
|
70
|
+
self._debug['entries']['arr'][i]['end'] = self._io.pos()
|
|
71
|
+
|
|
72
|
+
self._debug['entries']['end'] = self._io.pos()
|
|
73
|
+
|
|
74
|
+
class Entry(KaitaiStruct):
|
|
75
|
+
|
|
76
|
+
class Types(Enum):
|
|
77
|
+
data_fork = 1
|
|
78
|
+
resource_fork = 2
|
|
79
|
+
real_name = 3
|
|
80
|
+
comment = 4
|
|
81
|
+
icon_bw = 5
|
|
82
|
+
icon_color = 6
|
|
83
|
+
file_dates_info = 8
|
|
84
|
+
finder_info = 9
|
|
85
|
+
macintosh_file_info = 10
|
|
86
|
+
prodos_file_info = 11
|
|
87
|
+
msdos_file_info = 12
|
|
88
|
+
afp_short_name = 13
|
|
89
|
+
afp_file_info = 14
|
|
90
|
+
afp_directory_id = 15
|
|
91
|
+
SEQ_FIELDS = ["type", "ofs_body", "len_body"]
|
|
92
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
93
|
+
self._io = _io
|
|
94
|
+
self._parent = _parent
|
|
95
|
+
self._root = _root if _root else self
|
|
96
|
+
self._debug = collections.defaultdict(dict)
|
|
97
|
+
|
|
98
|
+
def _read(self):
|
|
99
|
+
self._debug['type']['start'] = self._io.pos()
|
|
100
|
+
self.type = KaitaiStream.resolve_enum(AppleSingleDouble.Entry.Types, self._io.read_u4be())
|
|
101
|
+
self._debug['type']['end'] = self._io.pos()
|
|
102
|
+
self._debug['ofs_body']['start'] = self._io.pos()
|
|
103
|
+
self.ofs_body = self._io.read_u4be()
|
|
104
|
+
self._debug['ofs_body']['end'] = self._io.pos()
|
|
105
|
+
self._debug['len_body']['start'] = self._io.pos()
|
|
106
|
+
self.len_body = self._io.read_u4be()
|
|
107
|
+
self._debug['len_body']['end'] = self._io.pos()
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def body(self):
|
|
111
|
+
if hasattr(self, '_m_body'):
|
|
112
|
+
return self._m_body if hasattr(self, '_m_body') else None
|
|
113
|
+
|
|
114
|
+
_pos = self._io.pos()
|
|
115
|
+
self._io.seek(self.ofs_body)
|
|
116
|
+
self._debug['_m_body']['start'] = self._io.pos()
|
|
117
|
+
_on = self.type
|
|
118
|
+
if _on == AppleSingleDouble.Entry.Types.finder_info:
|
|
119
|
+
self._raw__m_body = self._io.read_bytes(self.len_body)
|
|
120
|
+
_io__raw__m_body = KaitaiStream(BytesIO(self._raw__m_body))
|
|
121
|
+
self._m_body = AppleSingleDouble.FinderInfo(_io__raw__m_body, self, self._root)
|
|
122
|
+
self._m_body._read()
|
|
123
|
+
else:
|
|
124
|
+
self._m_body = self._io.read_bytes(self.len_body)
|
|
125
|
+
self._debug['_m_body']['end'] = self._io.pos()
|
|
126
|
+
self._io.seek(_pos)
|
|
127
|
+
return self._m_body if hasattr(self, '_m_body') else None
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class FinderInfo(KaitaiStruct):
|
|
131
|
+
"""Information specific to Finder.
|
|
132
|
+
|
|
133
|
+
.. seealso::
|
|
134
|
+
older Inside Macintosh, Volume II page 84 or Volume IV page 104.
|
|
135
|
+
"""
|
|
136
|
+
SEQ_FIELDS = ["file_type", "file_creator", "flags", "location", "folder_id"]
|
|
137
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
138
|
+
self._io = _io
|
|
139
|
+
self._parent = _parent
|
|
140
|
+
self._root = _root if _root else self
|
|
141
|
+
self._debug = collections.defaultdict(dict)
|
|
142
|
+
|
|
143
|
+
def _read(self):
|
|
144
|
+
self._debug['file_type']['start'] = self._io.pos()
|
|
145
|
+
self.file_type = self._io.read_bytes(4)
|
|
146
|
+
self._debug['file_type']['end'] = self._io.pos()
|
|
147
|
+
self._debug['file_creator']['start'] = self._io.pos()
|
|
148
|
+
self.file_creator = self._io.read_bytes(4)
|
|
149
|
+
self._debug['file_creator']['end'] = self._io.pos()
|
|
150
|
+
self._debug['flags']['start'] = self._io.pos()
|
|
151
|
+
self.flags = self._io.read_u2be()
|
|
152
|
+
self._debug['flags']['end'] = self._io.pos()
|
|
153
|
+
self._debug['location']['start'] = self._io.pos()
|
|
154
|
+
self.location = AppleSingleDouble.Point(self._io, self, self._root)
|
|
155
|
+
self.location._read()
|
|
156
|
+
self._debug['location']['end'] = self._io.pos()
|
|
157
|
+
self._debug['folder_id']['start'] = self._io.pos()
|
|
158
|
+
self.folder_id = self._io.read_u2be()
|
|
159
|
+
self._debug['folder_id']['end'] = self._io.pos()
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class Point(KaitaiStruct):
|
|
163
|
+
"""Specifies 2D coordinate in QuickDraw grid."""
|
|
164
|
+
SEQ_FIELDS = ["x", "y"]
|
|
165
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
166
|
+
self._io = _io
|
|
167
|
+
self._parent = _parent
|
|
168
|
+
self._root = _root if _root else self
|
|
169
|
+
self._debug = collections.defaultdict(dict)
|
|
170
|
+
|
|
171
|
+
def _read(self):
|
|
172
|
+
self._debug['x']['start'] = self._io.pos()
|
|
173
|
+
self.x = self._io.read_u2be()
|
|
174
|
+
self._debug['x']['end'] = self._io.pos()
|
|
175
|
+
self._debug['y']['start'] = self._io.pos()
|
|
176
|
+
self.y = self._io.read_u2be()
|
|
177
|
+
self._debug['y']['end'] = self._io.pos()
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
@@ -0,0 +1,235 @@
|
|
|
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 Asn1Der(KaitaiStruct):
|
|
14
|
+
"""ASN.1 (Abstract Syntax Notation One) DER (Distinguished Encoding
|
|
15
|
+
Rules) is a standard-backed serialization scheme used in many
|
|
16
|
+
different use-cases. Particularly popular usage scenarios are X.509
|
|
17
|
+
certificates and some telecommunication / networking protocols.
|
|
18
|
+
|
|
19
|
+
DER is self-describing encoding scheme which allows representation
|
|
20
|
+
of simple, atomic data elements, such as strings and numbers, and
|
|
21
|
+
complex objects, such as sequences of other elements.
|
|
22
|
+
|
|
23
|
+
DER is a subset of BER (Basic Encoding Rules), with an emphasis on
|
|
24
|
+
being non-ambiguous: there's always exactly one canonical way to
|
|
25
|
+
encode a data structure defined in terms of ASN.1 using DER.
|
|
26
|
+
|
|
27
|
+
This spec allows full parsing of format syntax, but to understand
|
|
28
|
+
the semantics, one would typically require a dictionary of Object
|
|
29
|
+
Identifiers (OIDs), to match OID bodies against some human-readable
|
|
30
|
+
list of constants. OIDs are covered by many different standards,
|
|
31
|
+
so typically it's simpler to use a pre-compiled list of them, such
|
|
32
|
+
as:
|
|
33
|
+
|
|
34
|
+
* <https://www.cs.auckland.ac.nz/~pgut001/dumpasn1.cfg>
|
|
35
|
+
* <http://oid-info.com/>
|
|
36
|
+
* <https://www.alvestrand.no/objectid/top.html>
|
|
37
|
+
|
|
38
|
+
.. seealso::
|
|
39
|
+
Source - https://www.itu.int/itu-t/recommendations/rec.aspx?rec=12483&lang=en
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
class TypeTag(Enum):
|
|
43
|
+
end_of_content = 0
|
|
44
|
+
boolean = 1
|
|
45
|
+
integer = 2
|
|
46
|
+
bit_string = 3
|
|
47
|
+
octet_string = 4
|
|
48
|
+
null_value = 5
|
|
49
|
+
object_id = 6
|
|
50
|
+
object_descriptor = 7
|
|
51
|
+
external = 8
|
|
52
|
+
real = 9
|
|
53
|
+
enumerated = 10
|
|
54
|
+
embedded_pdv = 11
|
|
55
|
+
utf8string = 12
|
|
56
|
+
relative_oid = 13
|
|
57
|
+
sequence_10 = 16
|
|
58
|
+
printable_string = 19
|
|
59
|
+
ia5string = 22
|
|
60
|
+
sequence_30 = 48
|
|
61
|
+
set = 49
|
|
62
|
+
SEQ_FIELDS = ["type_tag", "len", "body"]
|
|
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['type_tag']['start'] = self._io.pos()
|
|
71
|
+
self.type_tag = KaitaiStream.resolve_enum(Asn1Der.TypeTag, self._io.read_u1())
|
|
72
|
+
self._debug['type_tag']['end'] = self._io.pos()
|
|
73
|
+
self._debug['len']['start'] = self._io.pos()
|
|
74
|
+
self.len = Asn1Der.LenEncoded(self._io, self, self._root)
|
|
75
|
+
self.len._read()
|
|
76
|
+
self._debug['len']['end'] = self._io.pos()
|
|
77
|
+
self._debug['body']['start'] = self._io.pos()
|
|
78
|
+
_on = self.type_tag
|
|
79
|
+
if _on == Asn1Der.TypeTag.printable_string:
|
|
80
|
+
self._raw_body = self._io.read_bytes(self.len.result)
|
|
81
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
82
|
+
self.body = Asn1Der.BodyPrintableString(_io__raw_body, self, self._root)
|
|
83
|
+
self.body._read()
|
|
84
|
+
elif _on == Asn1Der.TypeTag.sequence_10:
|
|
85
|
+
self._raw_body = self._io.read_bytes(self.len.result)
|
|
86
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
87
|
+
self.body = Asn1Der.BodySequence(_io__raw_body, self, self._root)
|
|
88
|
+
self.body._read()
|
|
89
|
+
elif _on == Asn1Der.TypeTag.set:
|
|
90
|
+
self._raw_body = self._io.read_bytes(self.len.result)
|
|
91
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
92
|
+
self.body = Asn1Der.BodySequence(_io__raw_body, self, self._root)
|
|
93
|
+
self.body._read()
|
|
94
|
+
elif _on == Asn1Der.TypeTag.sequence_30:
|
|
95
|
+
self._raw_body = self._io.read_bytes(self.len.result)
|
|
96
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
97
|
+
self.body = Asn1Der.BodySequence(_io__raw_body, self, self._root)
|
|
98
|
+
self.body._read()
|
|
99
|
+
elif _on == Asn1Der.TypeTag.utf8string:
|
|
100
|
+
self._raw_body = self._io.read_bytes(self.len.result)
|
|
101
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
102
|
+
self.body = Asn1Der.BodyUtf8string(_io__raw_body, self, self._root)
|
|
103
|
+
self.body._read()
|
|
104
|
+
elif _on == Asn1Der.TypeTag.object_id:
|
|
105
|
+
self._raw_body = self._io.read_bytes(self.len.result)
|
|
106
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
107
|
+
self.body = Asn1Der.BodyObjectId(_io__raw_body, self, self._root)
|
|
108
|
+
self.body._read()
|
|
109
|
+
else:
|
|
110
|
+
self.body = self._io.read_bytes(self.len.result)
|
|
111
|
+
self._debug['body']['end'] = self._io.pos()
|
|
112
|
+
|
|
113
|
+
class BodySequence(KaitaiStruct):
|
|
114
|
+
SEQ_FIELDS = ["entries"]
|
|
115
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
116
|
+
self._io = _io
|
|
117
|
+
self._parent = _parent
|
|
118
|
+
self._root = _root if _root else self
|
|
119
|
+
self._debug = collections.defaultdict(dict)
|
|
120
|
+
|
|
121
|
+
def _read(self):
|
|
122
|
+
self._debug['entries']['start'] = self._io.pos()
|
|
123
|
+
self.entries = []
|
|
124
|
+
i = 0
|
|
125
|
+
while not self._io.is_eof():
|
|
126
|
+
if not 'arr' in self._debug['entries']:
|
|
127
|
+
self._debug['entries']['arr'] = []
|
|
128
|
+
self._debug['entries']['arr'].append({'start': self._io.pos()})
|
|
129
|
+
_t_entries = Asn1Der(self._io)
|
|
130
|
+
_t_entries._read()
|
|
131
|
+
self.entries.append(_t_entries)
|
|
132
|
+
self._debug['entries']['arr'][len(self.entries) - 1]['end'] = self._io.pos()
|
|
133
|
+
i += 1
|
|
134
|
+
|
|
135
|
+
self._debug['entries']['end'] = self._io.pos()
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class BodyUtf8string(KaitaiStruct):
|
|
139
|
+
SEQ_FIELDS = ["str"]
|
|
140
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
141
|
+
self._io = _io
|
|
142
|
+
self._parent = _parent
|
|
143
|
+
self._root = _root if _root else self
|
|
144
|
+
self._debug = collections.defaultdict(dict)
|
|
145
|
+
|
|
146
|
+
def _read(self):
|
|
147
|
+
self._debug['str']['start'] = self._io.pos()
|
|
148
|
+
self.str = (self._io.read_bytes_full()).decode(u"UTF-8")
|
|
149
|
+
self._debug['str']['end'] = self._io.pos()
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class BodyObjectId(KaitaiStruct):
|
|
153
|
+
"""
|
|
154
|
+
.. seealso::
|
|
155
|
+
Source - https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-object-identifier
|
|
156
|
+
"""
|
|
157
|
+
SEQ_FIELDS = ["first_and_second", "rest"]
|
|
158
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
159
|
+
self._io = _io
|
|
160
|
+
self._parent = _parent
|
|
161
|
+
self._root = _root if _root else self
|
|
162
|
+
self._debug = collections.defaultdict(dict)
|
|
163
|
+
|
|
164
|
+
def _read(self):
|
|
165
|
+
self._debug['first_and_second']['start'] = self._io.pos()
|
|
166
|
+
self.first_and_second = self._io.read_u1()
|
|
167
|
+
self._debug['first_and_second']['end'] = self._io.pos()
|
|
168
|
+
self._debug['rest']['start'] = self._io.pos()
|
|
169
|
+
self.rest = self._io.read_bytes_full()
|
|
170
|
+
self._debug['rest']['end'] = self._io.pos()
|
|
171
|
+
|
|
172
|
+
@property
|
|
173
|
+
def first(self):
|
|
174
|
+
if hasattr(self, '_m_first'):
|
|
175
|
+
return self._m_first if hasattr(self, '_m_first') else None
|
|
176
|
+
|
|
177
|
+
self._m_first = self.first_and_second // 40
|
|
178
|
+
return self._m_first if hasattr(self, '_m_first') else None
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
def second(self):
|
|
182
|
+
if hasattr(self, '_m_second'):
|
|
183
|
+
return self._m_second if hasattr(self, '_m_second') else None
|
|
184
|
+
|
|
185
|
+
self._m_second = (self.first_and_second % 40)
|
|
186
|
+
return self._m_second if hasattr(self, '_m_second') else None
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class LenEncoded(KaitaiStruct):
|
|
190
|
+
SEQ_FIELDS = ["b1", "int2", "int1"]
|
|
191
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
192
|
+
self._io = _io
|
|
193
|
+
self._parent = _parent
|
|
194
|
+
self._root = _root if _root else self
|
|
195
|
+
self._debug = collections.defaultdict(dict)
|
|
196
|
+
|
|
197
|
+
def _read(self):
|
|
198
|
+
self._debug['b1']['start'] = self._io.pos()
|
|
199
|
+
self.b1 = self._io.read_u1()
|
|
200
|
+
self._debug['b1']['end'] = self._io.pos()
|
|
201
|
+
if self.b1 == 130:
|
|
202
|
+
self._debug['int2']['start'] = self._io.pos()
|
|
203
|
+
self.int2 = self._io.read_u2be()
|
|
204
|
+
self._debug['int2']['end'] = self._io.pos()
|
|
205
|
+
|
|
206
|
+
if self.b1 == 129:
|
|
207
|
+
self._debug['int1']['start'] = self._io.pos()
|
|
208
|
+
self.int1 = self._io.read_u1()
|
|
209
|
+
self._debug['int1']['end'] = self._io.pos()
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
@property
|
|
213
|
+
def result(self):
|
|
214
|
+
if hasattr(self, '_m_result'):
|
|
215
|
+
return self._m_result if hasattr(self, '_m_result') else None
|
|
216
|
+
|
|
217
|
+
self._m_result = (self.int1 if self.b1 == 129 else (self.int2 if self.b1 == 130 else self.b1))
|
|
218
|
+
return self._m_result if hasattr(self, '_m_result') else None
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class BodyPrintableString(KaitaiStruct):
|
|
222
|
+
SEQ_FIELDS = ["str"]
|
|
223
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
224
|
+
self._io = _io
|
|
225
|
+
self._parent = _parent
|
|
226
|
+
self._root = _root if _root else self
|
|
227
|
+
self._debug = collections.defaultdict(dict)
|
|
228
|
+
|
|
229
|
+
def _read(self):
|
|
230
|
+
self._debug['str']['start'] = self._io.pos()
|
|
231
|
+
self.str = (self._io.read_bytes_full()).decode(u"ASCII")
|
|
232
|
+
self._debug['str']['end'] = self._io.pos()
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|