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,993 @@
|
|
|
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 OpenpgpMessage(KaitaiStruct):
|
|
14
|
+
"""The OpenPGP Message Format is a format to store encryption and signature keys for emails.
|
|
15
|
+
|
|
16
|
+
.. seealso::
|
|
17
|
+
Source - https://www.rfc-editor.org/rfc/rfc4880
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
class PublicKeyAlgorithms(Enum):
|
|
21
|
+
rsa_encrypt_or_sign_hac = 1
|
|
22
|
+
rsa_encrypt_only_hac = 2
|
|
23
|
+
rsa_sign_only_hac = 3
|
|
24
|
+
elgamal_encrypt_only_elgamal_hac = 16
|
|
25
|
+
dsa_digital_signature_algorithm_fips_hac = 17
|
|
26
|
+
reserved_for_elliptic_curve = 18
|
|
27
|
+
reserved_for_ecdsa = 19
|
|
28
|
+
reserved_formerly_elgamal_encrypt_or_sign_ = 20
|
|
29
|
+
reserved_for_diffie_hellman_x_as_defined_for_ietf_s_mime = 21
|
|
30
|
+
private_experimental_algorithm_00 = 100
|
|
31
|
+
private_experimental_algorithm_01 = 101
|
|
32
|
+
private_experimental_algorithm_02 = 102
|
|
33
|
+
private_experimental_algorithm_03 = 103
|
|
34
|
+
private_experimental_algorithm_04 = 104
|
|
35
|
+
private_experimental_algorithm_05 = 105
|
|
36
|
+
private_experimental_algorithm_06 = 106
|
|
37
|
+
private_experimental_algorithm_07 = 107
|
|
38
|
+
private_experimental_algorithm_08 = 108
|
|
39
|
+
private_experimental_algorithm_09 = 109
|
|
40
|
+
private_experimental_algorithm_10 = 110
|
|
41
|
+
|
|
42
|
+
class ServerFlags(Enum):
|
|
43
|
+
no_modify = 128
|
|
44
|
+
|
|
45
|
+
class KeyFlags(Enum):
|
|
46
|
+
this_key_may_be_used_to_certify_other_keys = 1
|
|
47
|
+
this_key_may_be_used_to_sign_data = 2
|
|
48
|
+
this_key_may_be_used_to_encrypt_communications = 4
|
|
49
|
+
this_key_may_be_used_to_encrypt_storage = 8
|
|
50
|
+
the_private_component_of_this_key_may_have_been_split_by_a_secret_sharing_mechanism = 16
|
|
51
|
+
this_key_may_be_used_for_authentication = 32
|
|
52
|
+
the_private_component_of_this_key_may_be_in_the_possession_of_more_than_one_person = 128
|
|
53
|
+
|
|
54
|
+
class CompressionAlgorithms(Enum):
|
|
55
|
+
uncompressed = 0
|
|
56
|
+
zib = 1
|
|
57
|
+
zlib = 2
|
|
58
|
+
bzip = 3
|
|
59
|
+
private_experimental_algorithm_00 = 100
|
|
60
|
+
private_experimental_algorithm_01 = 101
|
|
61
|
+
private_experimental_algorithm_02 = 102
|
|
62
|
+
private_experimental_algorithm_03 = 103
|
|
63
|
+
private_experimental_algorithm_04 = 104
|
|
64
|
+
private_experimental_algorithm_05 = 105
|
|
65
|
+
private_experimental_algorithm_06 = 106
|
|
66
|
+
private_experimental_algorithm_07 = 107
|
|
67
|
+
private_experimental_algorithm_08 = 108
|
|
68
|
+
private_experimental_algorithm_09 = 109
|
|
69
|
+
private_experimental_algorithm_10 = 110
|
|
70
|
+
|
|
71
|
+
class PacketTags(Enum):
|
|
72
|
+
reserved_a_packet_tag_must_not_have_this_value = 0
|
|
73
|
+
public_key_encrypted_session_key_packet = 1
|
|
74
|
+
signature_packet = 2
|
|
75
|
+
symmetric_key_encrypted_session_key_packet = 3
|
|
76
|
+
one_pass_signature_packet = 4
|
|
77
|
+
secret_key_packet = 5
|
|
78
|
+
public_key_packet = 6
|
|
79
|
+
secret_subkey_packet = 7
|
|
80
|
+
compressed_data_packet = 8
|
|
81
|
+
symmetrically_encrypted_data_packet = 9
|
|
82
|
+
marker_packet = 10
|
|
83
|
+
literal_data_packet = 11
|
|
84
|
+
trust_packet = 12
|
|
85
|
+
user_id_packet = 13
|
|
86
|
+
public_subkey_packet = 14
|
|
87
|
+
user_attribute_packet = 17
|
|
88
|
+
sym_encrypted_and_integrity_protected_data_packet = 18
|
|
89
|
+
modification_detection_code_packet = 19
|
|
90
|
+
private_or_experimental_values_0 = 60
|
|
91
|
+
private_or_experimental_values_1 = 61
|
|
92
|
+
private_or_experimental_values_2 = 62
|
|
93
|
+
private_or_experimental_values_3 = 63
|
|
94
|
+
|
|
95
|
+
class RevocationCodes(Enum):
|
|
96
|
+
no_reason_specified_key_revocations_or_cert_revocations = 0
|
|
97
|
+
key_is_superseded_key_revocations = 1
|
|
98
|
+
key_material_has_been_compromised_key_revocations = 2
|
|
99
|
+
key_is_retired_and_no_longer_used_key_revocations = 3
|
|
100
|
+
user_id_information_is_no_longer_valid_cert_revocations = 32
|
|
101
|
+
private_use_1 = 100
|
|
102
|
+
private_use_2 = 101
|
|
103
|
+
private_use_3 = 102
|
|
104
|
+
private_use_4 = 103
|
|
105
|
+
private_use_11 = 110
|
|
106
|
+
|
|
107
|
+
class HashAlgorithms(Enum):
|
|
108
|
+
md5 = 1
|
|
109
|
+
sha1 = 2
|
|
110
|
+
ripemd160 = 3
|
|
111
|
+
reserved4 = 4
|
|
112
|
+
reserved5 = 5
|
|
113
|
+
reserved6 = 6
|
|
114
|
+
reserved7 = 7
|
|
115
|
+
sha256 = 8
|
|
116
|
+
sha384 = 9
|
|
117
|
+
sha512 = 10
|
|
118
|
+
sha224 = 11
|
|
119
|
+
private_experimental_algorithm_00 = 100
|
|
120
|
+
private_experimental_algorithm_01 = 101
|
|
121
|
+
private_experimental_algorithm_02 = 102
|
|
122
|
+
private_experimental_algorithm_03 = 103
|
|
123
|
+
private_experimental_algorithm_04 = 104
|
|
124
|
+
private_experimental_algorithm_05 = 105
|
|
125
|
+
private_experimental_algorithm_06 = 106
|
|
126
|
+
private_experimental_algorithm_07 = 107
|
|
127
|
+
private_experimental_algorithm_08 = 108
|
|
128
|
+
private_experimental_algorithm_09 = 109
|
|
129
|
+
private_experimental_algorithm_10 = 110
|
|
130
|
+
|
|
131
|
+
class SymmetricKeyAlgorithm(Enum):
|
|
132
|
+
plain = 0
|
|
133
|
+
idea = 1
|
|
134
|
+
triple_des = 2
|
|
135
|
+
cast5 = 3
|
|
136
|
+
blowfisch = 4
|
|
137
|
+
reserved5 = 5
|
|
138
|
+
reserved6 = 6
|
|
139
|
+
aes_128 = 7
|
|
140
|
+
aes_192 = 8
|
|
141
|
+
aes_256 = 9
|
|
142
|
+
twofish_256 = 10
|
|
143
|
+
private_experimental_algorithm_00 = 100
|
|
144
|
+
private_experimental_algorithm_01 = 101
|
|
145
|
+
private_experimental_algorithm_02 = 102
|
|
146
|
+
private_experimental_algorithm_03 = 103
|
|
147
|
+
private_experimental_algorithm_04 = 104
|
|
148
|
+
private_experimental_algorithm_05 = 105
|
|
149
|
+
private_experimental_algorithm_06 = 106
|
|
150
|
+
private_experimental_algorithm_07 = 107
|
|
151
|
+
private_experimental_algorithm_08 = 108
|
|
152
|
+
private_experimental_algorithm_09 = 109
|
|
153
|
+
private_experimental_algorithm_10 = 110
|
|
154
|
+
|
|
155
|
+
class SubpacketTypes(Enum):
|
|
156
|
+
reserved0 = 0
|
|
157
|
+
reserved1 = 1
|
|
158
|
+
signature_creation_time = 2
|
|
159
|
+
signature_expiration_time = 3
|
|
160
|
+
exportable_certification = 4
|
|
161
|
+
trust_signature = 5
|
|
162
|
+
regular_expression = 6
|
|
163
|
+
revocable = 7
|
|
164
|
+
reserved8 = 8
|
|
165
|
+
key_expiration_time = 9
|
|
166
|
+
placeholder_for_backward_compatibility = 10
|
|
167
|
+
preferred_symmetric_algorithms = 11
|
|
168
|
+
revocation_key = 12
|
|
169
|
+
reserved13 = 13
|
|
170
|
+
reserved14 = 14
|
|
171
|
+
reserved15 = 15
|
|
172
|
+
issuer = 16
|
|
173
|
+
reserved17 = 17
|
|
174
|
+
reserved18 = 18
|
|
175
|
+
reserved19 = 19
|
|
176
|
+
notation_data = 20
|
|
177
|
+
preferred_hash_algorithms = 21
|
|
178
|
+
preferred_compression_algorithms = 22
|
|
179
|
+
key_server_preferences = 23
|
|
180
|
+
preferred_key_server = 24
|
|
181
|
+
primary_user_id = 25
|
|
182
|
+
policy_uri = 26
|
|
183
|
+
key_flags = 27
|
|
184
|
+
signers_user_id = 28
|
|
185
|
+
reason_for_revocation = 29
|
|
186
|
+
features = 30
|
|
187
|
+
signature_target = 31
|
|
188
|
+
embedded_signature = 32
|
|
189
|
+
SEQ_FIELDS = ["packets"]
|
|
190
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
191
|
+
self._io = _io
|
|
192
|
+
self._parent = _parent
|
|
193
|
+
self._root = _root if _root else self
|
|
194
|
+
self._debug = collections.defaultdict(dict)
|
|
195
|
+
|
|
196
|
+
def _read(self):
|
|
197
|
+
self._debug['packets']['start'] = self._io.pos()
|
|
198
|
+
self.packets = []
|
|
199
|
+
i = 0
|
|
200
|
+
while not self._io.is_eof():
|
|
201
|
+
if not 'arr' in self._debug['packets']:
|
|
202
|
+
self._debug['packets']['arr'] = []
|
|
203
|
+
self._debug['packets']['arr'].append({'start': self._io.pos()})
|
|
204
|
+
_t_packets = OpenpgpMessage.Packet(self._io, self, self._root)
|
|
205
|
+
_t_packets._read()
|
|
206
|
+
self.packets.append(_t_packets)
|
|
207
|
+
self._debug['packets']['arr'][len(self.packets) - 1]['end'] = self._io.pos()
|
|
208
|
+
i += 1
|
|
209
|
+
|
|
210
|
+
self._debug['packets']['end'] = self._io.pos()
|
|
211
|
+
|
|
212
|
+
class PreferredHashAlgorithms(KaitaiStruct):
|
|
213
|
+
SEQ_FIELDS = ["algorithm"]
|
|
214
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
215
|
+
self._io = _io
|
|
216
|
+
self._parent = _parent
|
|
217
|
+
self._root = _root if _root else self
|
|
218
|
+
self._debug = collections.defaultdict(dict)
|
|
219
|
+
|
|
220
|
+
def _read(self):
|
|
221
|
+
self._debug['algorithm']['start'] = self._io.pos()
|
|
222
|
+
self.algorithm = []
|
|
223
|
+
i = 0
|
|
224
|
+
while not self._io.is_eof():
|
|
225
|
+
if not 'arr' in self._debug['algorithm']:
|
|
226
|
+
self._debug['algorithm']['arr'] = []
|
|
227
|
+
self._debug['algorithm']['arr'].append({'start': self._io.pos()})
|
|
228
|
+
self.algorithm.append(KaitaiStream.resolve_enum(OpenpgpMessage.HashAlgorithms, self._io.read_u1()))
|
|
229
|
+
self._debug['algorithm']['arr'][len(self.algorithm) - 1]['end'] = self._io.pos()
|
|
230
|
+
i += 1
|
|
231
|
+
|
|
232
|
+
self._debug['algorithm']['end'] = self._io.pos()
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
class PreferredCompressionAlgorithms(KaitaiStruct):
|
|
236
|
+
SEQ_FIELDS = ["algorithm"]
|
|
237
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
238
|
+
self._io = _io
|
|
239
|
+
self._parent = _parent
|
|
240
|
+
self._root = _root if _root else self
|
|
241
|
+
self._debug = collections.defaultdict(dict)
|
|
242
|
+
|
|
243
|
+
def _read(self):
|
|
244
|
+
self._debug['algorithm']['start'] = self._io.pos()
|
|
245
|
+
self.algorithm = []
|
|
246
|
+
i = 0
|
|
247
|
+
while not self._io.is_eof():
|
|
248
|
+
if not 'arr' in self._debug['algorithm']:
|
|
249
|
+
self._debug['algorithm']['arr'] = []
|
|
250
|
+
self._debug['algorithm']['arr'].append({'start': self._io.pos()})
|
|
251
|
+
self.algorithm.append(KaitaiStream.resolve_enum(OpenpgpMessage.CompressionAlgorithms, self._io.read_u1()))
|
|
252
|
+
self._debug['algorithm']['arr'][len(self.algorithm) - 1]['end'] = self._io.pos()
|
|
253
|
+
i += 1
|
|
254
|
+
|
|
255
|
+
self._debug['algorithm']['end'] = self._io.pos()
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
class SignersUserId(KaitaiStruct):
|
|
259
|
+
SEQ_FIELDS = ["user_id"]
|
|
260
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
261
|
+
self._io = _io
|
|
262
|
+
self._parent = _parent
|
|
263
|
+
self._root = _root if _root else self
|
|
264
|
+
self._debug = collections.defaultdict(dict)
|
|
265
|
+
|
|
266
|
+
def _read(self):
|
|
267
|
+
self._debug['user_id']['start'] = self._io.pos()
|
|
268
|
+
self.user_id = (self._io.read_bytes_full()).decode(u"UTF-8")
|
|
269
|
+
self._debug['user_id']['end'] = self._io.pos()
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class SecretKeyPacket(KaitaiStruct):
|
|
273
|
+
SEQ_FIELDS = ["public_key", "string_to_key", "symmetric_encryption_algorithm", "secret_key"]
|
|
274
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
275
|
+
self._io = _io
|
|
276
|
+
self._parent = _parent
|
|
277
|
+
self._root = _root if _root else self
|
|
278
|
+
self._debug = collections.defaultdict(dict)
|
|
279
|
+
|
|
280
|
+
def _read(self):
|
|
281
|
+
self._debug['public_key']['start'] = self._io.pos()
|
|
282
|
+
self.public_key = OpenpgpMessage.PublicKeyPacket(self._io, self, self._root)
|
|
283
|
+
self.public_key._read()
|
|
284
|
+
self._debug['public_key']['end'] = self._io.pos()
|
|
285
|
+
self._debug['string_to_key']['start'] = self._io.pos()
|
|
286
|
+
self.string_to_key = self._io.read_u1()
|
|
287
|
+
self._debug['string_to_key']['end'] = self._io.pos()
|
|
288
|
+
if self.string_to_key >= 254:
|
|
289
|
+
self._debug['symmetric_encryption_algorithm']['start'] = self._io.pos()
|
|
290
|
+
self.symmetric_encryption_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.SymmetricKeyAlgorithm, self._io.read_u1())
|
|
291
|
+
self._debug['symmetric_encryption_algorithm']['end'] = self._io.pos()
|
|
292
|
+
|
|
293
|
+
self._debug['secret_key']['start'] = self._io.pos()
|
|
294
|
+
self.secret_key = self._io.read_bytes_full()
|
|
295
|
+
self._debug['secret_key']['end'] = self._io.pos()
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
class KeyServerPreferences(KaitaiStruct):
|
|
299
|
+
SEQ_FIELDS = ["flag"]
|
|
300
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
301
|
+
self._io = _io
|
|
302
|
+
self._parent = _parent
|
|
303
|
+
self._root = _root if _root else self
|
|
304
|
+
self._debug = collections.defaultdict(dict)
|
|
305
|
+
|
|
306
|
+
def _read(self):
|
|
307
|
+
self._debug['flag']['start'] = self._io.pos()
|
|
308
|
+
self.flag = []
|
|
309
|
+
i = 0
|
|
310
|
+
while not self._io.is_eof():
|
|
311
|
+
if not 'arr' in self._debug['flag']:
|
|
312
|
+
self._debug['flag']['arr'] = []
|
|
313
|
+
self._debug['flag']['arr'].append({'start': self._io.pos()})
|
|
314
|
+
self.flag.append(KaitaiStream.resolve_enum(OpenpgpMessage.ServerFlags, self._io.read_u1()))
|
|
315
|
+
self._debug['flag']['arr'][len(self.flag) - 1]['end'] = self._io.pos()
|
|
316
|
+
i += 1
|
|
317
|
+
|
|
318
|
+
self._debug['flag']['end'] = self._io.pos()
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
class RegularExpression(KaitaiStruct):
|
|
322
|
+
SEQ_FIELDS = ["regex"]
|
|
323
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
324
|
+
self._io = _io
|
|
325
|
+
self._parent = _parent
|
|
326
|
+
self._root = _root if _root else self
|
|
327
|
+
self._debug = collections.defaultdict(dict)
|
|
328
|
+
|
|
329
|
+
def _read(self):
|
|
330
|
+
self._debug['regex']['start'] = self._io.pos()
|
|
331
|
+
self.regex = (self._io.read_bytes_term(0, False, True, True)).decode(u"UTF-8")
|
|
332
|
+
self._debug['regex']['end'] = self._io.pos()
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
class Subpackets(KaitaiStruct):
|
|
336
|
+
SEQ_FIELDS = ["subpacketss"]
|
|
337
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
338
|
+
self._io = _io
|
|
339
|
+
self._parent = _parent
|
|
340
|
+
self._root = _root if _root else self
|
|
341
|
+
self._debug = collections.defaultdict(dict)
|
|
342
|
+
|
|
343
|
+
def _read(self):
|
|
344
|
+
self._debug['subpacketss']['start'] = self._io.pos()
|
|
345
|
+
self.subpacketss = []
|
|
346
|
+
i = 0
|
|
347
|
+
while not self._io.is_eof():
|
|
348
|
+
if not 'arr' in self._debug['subpacketss']:
|
|
349
|
+
self._debug['subpacketss']['arr'] = []
|
|
350
|
+
self._debug['subpacketss']['arr'].append({'start': self._io.pos()})
|
|
351
|
+
_t_subpacketss = OpenpgpMessage.Subpacket(self._io, self, self._root)
|
|
352
|
+
_t_subpacketss._read()
|
|
353
|
+
self.subpacketss.append(_t_subpacketss)
|
|
354
|
+
self._debug['subpacketss']['arr'][len(self.subpacketss) - 1]['end'] = self._io.pos()
|
|
355
|
+
i += 1
|
|
356
|
+
|
|
357
|
+
self._debug['subpacketss']['end'] = self._io.pos()
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
class RevocationKey(KaitaiStruct):
|
|
361
|
+
SEQ_FIELDS = ["class", "public_key_algorithm", "fingerprint"]
|
|
362
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
363
|
+
self._io = _io
|
|
364
|
+
self._parent = _parent
|
|
365
|
+
self._root = _root if _root else self
|
|
366
|
+
self._debug = collections.defaultdict(dict)
|
|
367
|
+
|
|
368
|
+
def _read(self):
|
|
369
|
+
self._debug['class']['start'] = self._io.pos()
|
|
370
|
+
self.class = self._io.read_u1()
|
|
371
|
+
self._debug['class']['end'] = self._io.pos()
|
|
372
|
+
self._debug['public_key_algorithm']['start'] = self._io.pos()
|
|
373
|
+
self.public_key_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.PublicKeyAlgorithms, self._io.read_u1())
|
|
374
|
+
self._debug['public_key_algorithm']['end'] = self._io.pos()
|
|
375
|
+
self._debug['fingerprint']['start'] = self._io.pos()
|
|
376
|
+
self.fingerprint = self._io.read_bytes(20)
|
|
377
|
+
self._debug['fingerprint']['end'] = self._io.pos()
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
class UserIdPacket(KaitaiStruct):
|
|
381
|
+
SEQ_FIELDS = ["user_id"]
|
|
382
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
383
|
+
self._io = _io
|
|
384
|
+
self._parent = _parent
|
|
385
|
+
self._root = _root if _root else self
|
|
386
|
+
self._debug = collections.defaultdict(dict)
|
|
387
|
+
|
|
388
|
+
def _read(self):
|
|
389
|
+
self._debug['user_id']['start'] = self._io.pos()
|
|
390
|
+
self.user_id = (self._io.read_bytes_full()).decode(u"UTF-8")
|
|
391
|
+
self._debug['user_id']['end'] = self._io.pos()
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
class PolicyUri(KaitaiStruct):
|
|
395
|
+
SEQ_FIELDS = ["uri"]
|
|
396
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
397
|
+
self._io = _io
|
|
398
|
+
self._parent = _parent
|
|
399
|
+
self._root = _root if _root else self
|
|
400
|
+
self._debug = collections.defaultdict(dict)
|
|
401
|
+
|
|
402
|
+
def _read(self):
|
|
403
|
+
self._debug['uri']['start'] = self._io.pos()
|
|
404
|
+
self.uri = (self._io.read_bytes_full()).decode(u"UTF-8")
|
|
405
|
+
self._debug['uri']['end'] = self._io.pos()
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
class SignatureTarget(KaitaiStruct):
|
|
409
|
+
SEQ_FIELDS = ["public_key_algorithm", "hash_algorithm", "hash"]
|
|
410
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
411
|
+
self._io = _io
|
|
412
|
+
self._parent = _parent
|
|
413
|
+
self._root = _root if _root else self
|
|
414
|
+
self._debug = collections.defaultdict(dict)
|
|
415
|
+
|
|
416
|
+
def _read(self):
|
|
417
|
+
self._debug['public_key_algorithm']['start'] = self._io.pos()
|
|
418
|
+
self.public_key_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.PublicKeyAlgorithms, self._io.read_u1())
|
|
419
|
+
self._debug['public_key_algorithm']['end'] = self._io.pos()
|
|
420
|
+
self._debug['hash_algorithm']['start'] = self._io.pos()
|
|
421
|
+
self.hash_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.HashAlgorithms, self._io.read_u1())
|
|
422
|
+
self._debug['hash_algorithm']['end'] = self._io.pos()
|
|
423
|
+
self._debug['hash']['start'] = self._io.pos()
|
|
424
|
+
self.hash = self._io.read_bytes_full()
|
|
425
|
+
self._debug['hash']['end'] = self._io.pos()
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
class KeyFlags(KaitaiStruct):
|
|
429
|
+
SEQ_FIELDS = ["flag"]
|
|
430
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
431
|
+
self._io = _io
|
|
432
|
+
self._parent = _parent
|
|
433
|
+
self._root = _root if _root else self
|
|
434
|
+
self._debug = collections.defaultdict(dict)
|
|
435
|
+
|
|
436
|
+
def _read(self):
|
|
437
|
+
self._debug['flag']['start'] = self._io.pos()
|
|
438
|
+
self.flag = []
|
|
439
|
+
i = 0
|
|
440
|
+
while not self._io.is_eof():
|
|
441
|
+
if not 'arr' in self._debug['flag']:
|
|
442
|
+
self._debug['flag']['arr'] = []
|
|
443
|
+
self._debug['flag']['arr'].append({'start': self._io.pos()})
|
|
444
|
+
self.flag.append(KaitaiStream.resolve_enum(OpenpgpMessage.KeyFlags, self._io.read_u1()))
|
|
445
|
+
self._debug['flag']['arr'][len(self.flag) - 1]['end'] = self._io.pos()
|
|
446
|
+
i += 1
|
|
447
|
+
|
|
448
|
+
self._debug['flag']['end'] = self._io.pos()
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
class Features(KaitaiStruct):
|
|
452
|
+
SEQ_FIELDS = ["flags"]
|
|
453
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
454
|
+
self._io = _io
|
|
455
|
+
self._parent = _parent
|
|
456
|
+
self._root = _root if _root else self
|
|
457
|
+
self._debug = collections.defaultdict(dict)
|
|
458
|
+
|
|
459
|
+
def _read(self):
|
|
460
|
+
self._debug['flags']['start'] = self._io.pos()
|
|
461
|
+
self.flags = self._io.read_bytes_full()
|
|
462
|
+
self._debug['flags']['end'] = self._io.pos()
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
class PrimaryUserId(KaitaiStruct):
|
|
466
|
+
SEQ_FIELDS = ["user_id"]
|
|
467
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
468
|
+
self._io = _io
|
|
469
|
+
self._parent = _parent
|
|
470
|
+
self._root = _root if _root else self
|
|
471
|
+
self._debug = collections.defaultdict(dict)
|
|
472
|
+
|
|
473
|
+
def _read(self):
|
|
474
|
+
self._debug['user_id']['start'] = self._io.pos()
|
|
475
|
+
self.user_id = self._io.read_u1()
|
|
476
|
+
self._debug['user_id']['end'] = self._io.pos()
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
class Subpacket(KaitaiStruct):
|
|
480
|
+
SEQ_FIELDS = ["len", "subpacket_type", "content"]
|
|
481
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
482
|
+
self._io = _io
|
|
483
|
+
self._parent = _parent
|
|
484
|
+
self._root = _root if _root else self
|
|
485
|
+
self._debug = collections.defaultdict(dict)
|
|
486
|
+
|
|
487
|
+
def _read(self):
|
|
488
|
+
self._debug['len']['start'] = self._io.pos()
|
|
489
|
+
self.len = OpenpgpMessage.LenSubpacket(self._io, self, self._root)
|
|
490
|
+
self.len._read()
|
|
491
|
+
self._debug['len']['end'] = self._io.pos()
|
|
492
|
+
self._debug['subpacket_type']['start'] = self._io.pos()
|
|
493
|
+
self.subpacket_type = KaitaiStream.resolve_enum(OpenpgpMessage.SubpacketTypes, self._io.read_u1())
|
|
494
|
+
self._debug['subpacket_type']['end'] = self._io.pos()
|
|
495
|
+
self._debug['content']['start'] = self._io.pos()
|
|
496
|
+
_on = self.subpacket_type
|
|
497
|
+
if _on == OpenpgpMessage.SubpacketTypes.preferred_key_server:
|
|
498
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
499
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
500
|
+
self.content = OpenpgpMessage.PreferredKeyServer(_io__raw_content, self, self._root)
|
|
501
|
+
self.content._read()
|
|
502
|
+
elif _on == OpenpgpMessage.SubpacketTypes.issuer:
|
|
503
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
504
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
505
|
+
self.content = OpenpgpMessage.Issuer(_io__raw_content, self, self._root)
|
|
506
|
+
self.content._read()
|
|
507
|
+
elif _on == OpenpgpMessage.SubpacketTypes.revocable:
|
|
508
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
509
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
510
|
+
self.content = OpenpgpMessage.Revocable(_io__raw_content, self, self._root)
|
|
511
|
+
self.content._read()
|
|
512
|
+
elif _on == OpenpgpMessage.SubpacketTypes.signature_target:
|
|
513
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
514
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
515
|
+
self.content = OpenpgpMessage.SignatureTarget(_io__raw_content, self, self._root)
|
|
516
|
+
self.content._read()
|
|
517
|
+
elif _on == OpenpgpMessage.SubpacketTypes.regular_expression:
|
|
518
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
519
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
520
|
+
self.content = OpenpgpMessage.RegularExpression(_io__raw_content, self, self._root)
|
|
521
|
+
self.content._read()
|
|
522
|
+
elif _on == OpenpgpMessage.SubpacketTypes.exportable_certification:
|
|
523
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
524
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
525
|
+
self.content = OpenpgpMessage.ExportableCertification(_io__raw_content, self, self._root)
|
|
526
|
+
self.content._read()
|
|
527
|
+
elif _on == OpenpgpMessage.SubpacketTypes.reason_for_revocation:
|
|
528
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
529
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
530
|
+
self.content = OpenpgpMessage.ReasonForRevocation(_io__raw_content, self, self._root)
|
|
531
|
+
self.content._read()
|
|
532
|
+
elif _on == OpenpgpMessage.SubpacketTypes.key_server_preferences:
|
|
533
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
534
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
535
|
+
self.content = OpenpgpMessage.KeyServerPreferences(_io__raw_content, self, self._root)
|
|
536
|
+
self.content._read()
|
|
537
|
+
elif _on == OpenpgpMessage.SubpacketTypes.signature_creation_time:
|
|
538
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
539
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
540
|
+
self.content = OpenpgpMessage.SignatureCreationTime(_io__raw_content, self, self._root)
|
|
541
|
+
self.content._read()
|
|
542
|
+
elif _on == OpenpgpMessage.SubpacketTypes.preferred_hash_algorithms:
|
|
543
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
544
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
545
|
+
self.content = OpenpgpMessage.PreferredHashAlgorithms(_io__raw_content, self, self._root)
|
|
546
|
+
self.content._read()
|
|
547
|
+
elif _on == OpenpgpMessage.SubpacketTypes.trust_signature:
|
|
548
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
549
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
550
|
+
self.content = OpenpgpMessage.TrustSignature(_io__raw_content, self, self._root)
|
|
551
|
+
self.content._read()
|
|
552
|
+
elif _on == OpenpgpMessage.SubpacketTypes.key_expiration_time:
|
|
553
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
554
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
555
|
+
self.content = OpenpgpMessage.KeyExpirationTime(_io__raw_content, self, self._root)
|
|
556
|
+
self.content._read()
|
|
557
|
+
elif _on == OpenpgpMessage.SubpacketTypes.key_flags:
|
|
558
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
559
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
560
|
+
self.content = OpenpgpMessage.KeyFlags(_io__raw_content, self, self._root)
|
|
561
|
+
self.content._read()
|
|
562
|
+
elif _on == OpenpgpMessage.SubpacketTypes.signature_expiration_time:
|
|
563
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
564
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
565
|
+
self.content = OpenpgpMessage.SignatureExpirationTime(_io__raw_content, self, self._root)
|
|
566
|
+
self.content._read()
|
|
567
|
+
elif _on == OpenpgpMessage.SubpacketTypes.features:
|
|
568
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
569
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
570
|
+
self.content = OpenpgpMessage.Features(_io__raw_content, self, self._root)
|
|
571
|
+
self.content._read()
|
|
572
|
+
elif _on == OpenpgpMessage.SubpacketTypes.signers_user_id:
|
|
573
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
574
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
575
|
+
self.content = OpenpgpMessage.SignersUserId(_io__raw_content, self, self._root)
|
|
576
|
+
self.content._read()
|
|
577
|
+
elif _on == OpenpgpMessage.SubpacketTypes.notation_data:
|
|
578
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
579
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
580
|
+
self.content = OpenpgpMessage.NotationData(_io__raw_content, self, self._root)
|
|
581
|
+
self.content._read()
|
|
582
|
+
elif _on == OpenpgpMessage.SubpacketTypes.revocation_key:
|
|
583
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
584
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
585
|
+
self.content = OpenpgpMessage.RevocationKey(_io__raw_content, self, self._root)
|
|
586
|
+
self.content._read()
|
|
587
|
+
elif _on == OpenpgpMessage.SubpacketTypes.preferred_compression_algorithms:
|
|
588
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
589
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
590
|
+
self.content = OpenpgpMessage.PreferredCompressionAlgorithms(_io__raw_content, self, self._root)
|
|
591
|
+
self.content._read()
|
|
592
|
+
elif _on == OpenpgpMessage.SubpacketTypes.policy_uri:
|
|
593
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
594
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
595
|
+
self.content = OpenpgpMessage.PolicyUri(_io__raw_content, self, self._root)
|
|
596
|
+
self.content._read()
|
|
597
|
+
elif _on == OpenpgpMessage.SubpacketTypes.primary_user_id:
|
|
598
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
599
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
600
|
+
self.content = OpenpgpMessage.PrimaryUserId(_io__raw_content, self, self._root)
|
|
601
|
+
self.content._read()
|
|
602
|
+
elif _on == OpenpgpMessage.SubpacketTypes.embedded_signature:
|
|
603
|
+
self._raw_content = self._io.read_bytes((self.len.len - 1))
|
|
604
|
+
_io__raw_content = KaitaiStream(BytesIO(self._raw_content))
|
|
605
|
+
self.content = OpenpgpMessage.EmbeddedSignature(_io__raw_content, self, self._root)
|
|
606
|
+
self.content._read()
|
|
607
|
+
else:
|
|
608
|
+
self.content = self._io.read_bytes((self.len.len - 1))
|
|
609
|
+
self._debug['content']['end'] = self._io.pos()
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
class OldPacket(KaitaiStruct):
|
|
613
|
+
SEQ_FIELDS = ["len", "body"]
|
|
614
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
615
|
+
self._io = _io
|
|
616
|
+
self._parent = _parent
|
|
617
|
+
self._root = _root if _root else self
|
|
618
|
+
self._debug = collections.defaultdict(dict)
|
|
619
|
+
|
|
620
|
+
def _read(self):
|
|
621
|
+
self._debug['len']['start'] = self._io.pos()
|
|
622
|
+
_on = self._parent.len_type
|
|
623
|
+
if _on == 0:
|
|
624
|
+
self.len = self._io.read_u1()
|
|
625
|
+
elif _on == 1:
|
|
626
|
+
self.len = self._io.read_u2be()
|
|
627
|
+
elif _on == 2:
|
|
628
|
+
self.len = self._io.read_u4be()
|
|
629
|
+
self._debug['len']['end'] = self._io.pos()
|
|
630
|
+
self._debug['body']['start'] = self._io.pos()
|
|
631
|
+
_on = self._parent.packet_type_old
|
|
632
|
+
if _on == OpenpgpMessage.PacketTags.public_key_packet:
|
|
633
|
+
self._raw_body = self._io.read_bytes(self.len)
|
|
634
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
635
|
+
self.body = OpenpgpMessage.PublicKeyPacket(_io__raw_body, self, self._root)
|
|
636
|
+
self.body._read()
|
|
637
|
+
elif _on == OpenpgpMessage.PacketTags.public_subkey_packet:
|
|
638
|
+
self._raw_body = self._io.read_bytes(self.len)
|
|
639
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
640
|
+
self.body = OpenpgpMessage.PublicKeyPacket(_io__raw_body, self, self._root)
|
|
641
|
+
self.body._read()
|
|
642
|
+
elif _on == OpenpgpMessage.PacketTags.user_id_packet:
|
|
643
|
+
self._raw_body = self._io.read_bytes(self.len)
|
|
644
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
645
|
+
self.body = OpenpgpMessage.UserIdPacket(_io__raw_body, self, self._root)
|
|
646
|
+
self.body._read()
|
|
647
|
+
elif _on == OpenpgpMessage.PacketTags.signature_packet:
|
|
648
|
+
self._raw_body = self._io.read_bytes(self.len)
|
|
649
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
650
|
+
self.body = OpenpgpMessage.SignaturePacket(_io__raw_body, self, self._root)
|
|
651
|
+
self.body._read()
|
|
652
|
+
elif _on == OpenpgpMessage.PacketTags.secret_subkey_packet:
|
|
653
|
+
self._raw_body = self._io.read_bytes(self.len)
|
|
654
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
655
|
+
self.body = OpenpgpMessage.PublicKeyPacket(_io__raw_body, self, self._root)
|
|
656
|
+
self.body._read()
|
|
657
|
+
elif _on == OpenpgpMessage.PacketTags.secret_key_packet:
|
|
658
|
+
self._raw_body = self._io.read_bytes(self.len)
|
|
659
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
660
|
+
self.body = OpenpgpMessage.SecretKeyPacket(_io__raw_body, self, self._root)
|
|
661
|
+
self.body._read()
|
|
662
|
+
else:
|
|
663
|
+
self.body = self._io.read_bytes(self.len)
|
|
664
|
+
self._debug['body']['end'] = self._io.pos()
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
class Issuer(KaitaiStruct):
|
|
668
|
+
SEQ_FIELDS = ["keyid"]
|
|
669
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
670
|
+
self._io = _io
|
|
671
|
+
self._parent = _parent
|
|
672
|
+
self._root = _root if _root else self
|
|
673
|
+
self._debug = collections.defaultdict(dict)
|
|
674
|
+
|
|
675
|
+
def _read(self):
|
|
676
|
+
self._debug['keyid']['start'] = self._io.pos()
|
|
677
|
+
self.keyid = self._io.read_u8be()
|
|
678
|
+
self._debug['keyid']['end'] = self._io.pos()
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
class ExportableCertification(KaitaiStruct):
|
|
682
|
+
SEQ_FIELDS = ["exportable"]
|
|
683
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
684
|
+
self._io = _io
|
|
685
|
+
self._parent = _parent
|
|
686
|
+
self._root = _root if _root else self
|
|
687
|
+
self._debug = collections.defaultdict(dict)
|
|
688
|
+
|
|
689
|
+
def _read(self):
|
|
690
|
+
self._debug['exportable']['start'] = self._io.pos()
|
|
691
|
+
self.exportable = self._io.read_u1()
|
|
692
|
+
self._debug['exportable']['end'] = self._io.pos()
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
class SignatureExpirationTime(KaitaiStruct):
|
|
696
|
+
SEQ_FIELDS = ["time"]
|
|
697
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
698
|
+
self._io = _io
|
|
699
|
+
self._parent = _parent
|
|
700
|
+
self._root = _root if _root else self
|
|
701
|
+
self._debug = collections.defaultdict(dict)
|
|
702
|
+
|
|
703
|
+
def _read(self):
|
|
704
|
+
self._debug['time']['start'] = self._io.pos()
|
|
705
|
+
self.time = self._io.read_u4be()
|
|
706
|
+
self._debug['time']['end'] = self._io.pos()
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
class SignatureCreationTime(KaitaiStruct):
|
|
710
|
+
SEQ_FIELDS = ["time"]
|
|
711
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
712
|
+
self._io = _io
|
|
713
|
+
self._parent = _parent
|
|
714
|
+
self._root = _root if _root else self
|
|
715
|
+
self._debug = collections.defaultdict(dict)
|
|
716
|
+
|
|
717
|
+
def _read(self):
|
|
718
|
+
self._debug['time']['start'] = self._io.pos()
|
|
719
|
+
self.time = self._io.read_u4be()
|
|
720
|
+
self._debug['time']['end'] = self._io.pos()
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
class SignaturePacket(KaitaiStruct):
|
|
724
|
+
SEQ_FIELDS = ["version", "signature_type", "public_key_algorithm", "hash_algorithm", "len_hashed_subpacket", "hashed_subpackets", "len_unhashed_subpacket", "unhashed_subpackets", "left_signed_hash", "rsa_n", "signature"]
|
|
725
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
726
|
+
self._io = _io
|
|
727
|
+
self._parent = _parent
|
|
728
|
+
self._root = _root if _root else self
|
|
729
|
+
self._debug = collections.defaultdict(dict)
|
|
730
|
+
|
|
731
|
+
def _read(self):
|
|
732
|
+
self._debug['version']['start'] = self._io.pos()
|
|
733
|
+
self.version = self._io.read_u1()
|
|
734
|
+
self._debug['version']['end'] = self._io.pos()
|
|
735
|
+
self._debug['signature_type']['start'] = self._io.pos()
|
|
736
|
+
self.signature_type = self._io.read_u1()
|
|
737
|
+
self._debug['signature_type']['end'] = self._io.pos()
|
|
738
|
+
self._debug['public_key_algorithm']['start'] = self._io.pos()
|
|
739
|
+
self.public_key_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.PublicKeyAlgorithms, self._io.read_u1())
|
|
740
|
+
self._debug['public_key_algorithm']['end'] = self._io.pos()
|
|
741
|
+
self._debug['hash_algorithm']['start'] = self._io.pos()
|
|
742
|
+
self.hash_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.HashAlgorithms, self._io.read_u1())
|
|
743
|
+
self._debug['hash_algorithm']['end'] = self._io.pos()
|
|
744
|
+
self._debug['len_hashed_subpacket']['start'] = self._io.pos()
|
|
745
|
+
self.len_hashed_subpacket = self._io.read_u2be()
|
|
746
|
+
self._debug['len_hashed_subpacket']['end'] = self._io.pos()
|
|
747
|
+
self._debug['hashed_subpackets']['start'] = self._io.pos()
|
|
748
|
+
self._raw_hashed_subpackets = self._io.read_bytes(self.len_hashed_subpacket)
|
|
749
|
+
_io__raw_hashed_subpackets = KaitaiStream(BytesIO(self._raw_hashed_subpackets))
|
|
750
|
+
self.hashed_subpackets = OpenpgpMessage.Subpackets(_io__raw_hashed_subpackets, self, self._root)
|
|
751
|
+
self.hashed_subpackets._read()
|
|
752
|
+
self._debug['hashed_subpackets']['end'] = self._io.pos()
|
|
753
|
+
self._debug['len_unhashed_subpacket']['start'] = self._io.pos()
|
|
754
|
+
self.len_unhashed_subpacket = self._io.read_u2be()
|
|
755
|
+
self._debug['len_unhashed_subpacket']['end'] = self._io.pos()
|
|
756
|
+
self._debug['unhashed_subpackets']['start'] = self._io.pos()
|
|
757
|
+
self._raw_unhashed_subpackets = self._io.read_bytes(self.len_unhashed_subpacket)
|
|
758
|
+
_io__raw_unhashed_subpackets = KaitaiStream(BytesIO(self._raw_unhashed_subpackets))
|
|
759
|
+
self.unhashed_subpackets = OpenpgpMessage.Subpackets(_io__raw_unhashed_subpackets, self, self._root)
|
|
760
|
+
self.unhashed_subpackets._read()
|
|
761
|
+
self._debug['unhashed_subpackets']['end'] = self._io.pos()
|
|
762
|
+
self._debug['left_signed_hash']['start'] = self._io.pos()
|
|
763
|
+
self.left_signed_hash = self._io.read_u2be()
|
|
764
|
+
self._debug['left_signed_hash']['end'] = self._io.pos()
|
|
765
|
+
self._debug['rsa_n']['start'] = self._io.pos()
|
|
766
|
+
self.rsa_n = self._io.read_u2be()
|
|
767
|
+
self._debug['rsa_n']['end'] = self._io.pos()
|
|
768
|
+
self._debug['signature']['start'] = self._io.pos()
|
|
769
|
+
self.signature = self._io.read_bytes_full()
|
|
770
|
+
self._debug['signature']['end'] = self._io.pos()
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
class Revocable(KaitaiStruct):
|
|
774
|
+
SEQ_FIELDS = ["revocable"]
|
|
775
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
776
|
+
self._io = _io
|
|
777
|
+
self._parent = _parent
|
|
778
|
+
self._root = _root if _root else self
|
|
779
|
+
self._debug = collections.defaultdict(dict)
|
|
780
|
+
|
|
781
|
+
def _read(self):
|
|
782
|
+
self._debug['revocable']['start'] = self._io.pos()
|
|
783
|
+
self.revocable = self._io.read_u1()
|
|
784
|
+
self._debug['revocable']['end'] = self._io.pos()
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
class EmbeddedSignature(KaitaiStruct):
|
|
788
|
+
SEQ_FIELDS = ["signature_packet"]
|
|
789
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
790
|
+
self._io = _io
|
|
791
|
+
self._parent = _parent
|
|
792
|
+
self._root = _root if _root else self
|
|
793
|
+
self._debug = collections.defaultdict(dict)
|
|
794
|
+
|
|
795
|
+
def _read(self):
|
|
796
|
+
self._debug['signature_packet']['start'] = self._io.pos()
|
|
797
|
+
self.signature_packet = OpenpgpMessage.SignaturePacket(self._io, self, self._root)
|
|
798
|
+
self.signature_packet._read()
|
|
799
|
+
self._debug['signature_packet']['end'] = self._io.pos()
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
class PreferredKeyServer(KaitaiStruct):
|
|
803
|
+
SEQ_FIELDS = ["uri"]
|
|
804
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
805
|
+
self._io = _io
|
|
806
|
+
self._parent = _parent
|
|
807
|
+
self._root = _root if _root else self
|
|
808
|
+
self._debug = collections.defaultdict(dict)
|
|
809
|
+
|
|
810
|
+
def _read(self):
|
|
811
|
+
self._debug['uri']['start'] = self._io.pos()
|
|
812
|
+
self.uri = (self._io.read_bytes_full()).decode(u"UTF-8")
|
|
813
|
+
self._debug['uri']['end'] = self._io.pos()
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
class ReasonForRevocation(KaitaiStruct):
|
|
817
|
+
SEQ_FIELDS = ["revocation_code", "reason"]
|
|
818
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
819
|
+
self._io = _io
|
|
820
|
+
self._parent = _parent
|
|
821
|
+
self._root = _root if _root else self
|
|
822
|
+
self._debug = collections.defaultdict(dict)
|
|
823
|
+
|
|
824
|
+
def _read(self):
|
|
825
|
+
self._debug['revocation_code']['start'] = self._io.pos()
|
|
826
|
+
self.revocation_code = KaitaiStream.resolve_enum(OpenpgpMessage.RevocationCodes, self._io.read_u1())
|
|
827
|
+
self._debug['revocation_code']['end'] = self._io.pos()
|
|
828
|
+
self._debug['reason']['start'] = self._io.pos()
|
|
829
|
+
self.reason = (self._io.read_bytes_full()).decode(u"UTF-8")
|
|
830
|
+
self._debug['reason']['end'] = self._io.pos()
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
class LenSubpacket(KaitaiStruct):
|
|
834
|
+
SEQ_FIELDS = ["first_octet", "second_octet", "scalar"]
|
|
835
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
836
|
+
self._io = _io
|
|
837
|
+
self._parent = _parent
|
|
838
|
+
self._root = _root if _root else self
|
|
839
|
+
self._debug = collections.defaultdict(dict)
|
|
840
|
+
|
|
841
|
+
def _read(self):
|
|
842
|
+
self._debug['first_octet']['start'] = self._io.pos()
|
|
843
|
+
self.first_octet = self._io.read_u1()
|
|
844
|
+
self._debug['first_octet']['end'] = self._io.pos()
|
|
845
|
+
if ((self.first_octet >= 192) and (self.first_octet < 255)) :
|
|
846
|
+
self._debug['second_octet']['start'] = self._io.pos()
|
|
847
|
+
self.second_octet = self._io.read_u1()
|
|
848
|
+
self._debug['second_octet']['end'] = self._io.pos()
|
|
849
|
+
|
|
850
|
+
if self.first_octet == 255:
|
|
851
|
+
self._debug['scalar']['start'] = self._io.pos()
|
|
852
|
+
self.scalar = self._io.read_u4be()
|
|
853
|
+
self._debug['scalar']['end'] = self._io.pos()
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
@property
|
|
857
|
+
def len(self):
|
|
858
|
+
if hasattr(self, '_m_len'):
|
|
859
|
+
return self._m_len if hasattr(self, '_m_len') else None
|
|
860
|
+
|
|
861
|
+
self._m_len = (self.first_octet if self.first_octet < 192 else (((((self.first_octet - 192) << 8) + self.second_octet) + 192) if ((self.first_octet >= 192) and (self.first_octet < 255)) else self.scalar))
|
|
862
|
+
return self._m_len if hasattr(self, '_m_len') else None
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
class NotationData(KaitaiStruct):
|
|
866
|
+
SEQ_FIELDS = ["flags", "len_name", "len_value", "name", "value"]
|
|
867
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
868
|
+
self._io = _io
|
|
869
|
+
self._parent = _parent
|
|
870
|
+
self._root = _root if _root else self
|
|
871
|
+
self._debug = collections.defaultdict(dict)
|
|
872
|
+
|
|
873
|
+
def _read(self):
|
|
874
|
+
self._debug['flags']['start'] = self._io.pos()
|
|
875
|
+
self.flags = self._io.read_bytes(4)
|
|
876
|
+
self._debug['flags']['end'] = self._io.pos()
|
|
877
|
+
self._debug['len_name']['start'] = self._io.pos()
|
|
878
|
+
self.len_name = self._io.read_u2be()
|
|
879
|
+
self._debug['len_name']['end'] = self._io.pos()
|
|
880
|
+
self._debug['len_value']['start'] = self._io.pos()
|
|
881
|
+
self.len_value = self._io.read_u2be()
|
|
882
|
+
self._debug['len_value']['end'] = self._io.pos()
|
|
883
|
+
self._debug['name']['start'] = self._io.pos()
|
|
884
|
+
self.name = self._io.read_bytes(self.len_name)
|
|
885
|
+
self._debug['name']['end'] = self._io.pos()
|
|
886
|
+
self._debug['value']['start'] = self._io.pos()
|
|
887
|
+
self.value = self._io.read_bytes(self.len_value)
|
|
888
|
+
self._debug['value']['end'] = self._io.pos()
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
class PublicKeyPacket(KaitaiStruct):
|
|
892
|
+
SEQ_FIELDS = ["version", "timestamp", "public_key_algorithm", "len_alg", "rsa_n", "padding", "rsa_e"]
|
|
893
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
894
|
+
self._io = _io
|
|
895
|
+
self._parent = _parent
|
|
896
|
+
self._root = _root if _root else self
|
|
897
|
+
self._debug = collections.defaultdict(dict)
|
|
898
|
+
|
|
899
|
+
def _read(self):
|
|
900
|
+
self._debug['version']['start'] = self._io.pos()
|
|
901
|
+
self.version = self._io.read_u1()
|
|
902
|
+
self._debug['version']['end'] = self._io.pos()
|
|
903
|
+
self._debug['timestamp']['start'] = self._io.pos()
|
|
904
|
+
self.timestamp = self._io.read_u4be()
|
|
905
|
+
self._debug['timestamp']['end'] = self._io.pos()
|
|
906
|
+
self._debug['public_key_algorithm']['start'] = self._io.pos()
|
|
907
|
+
self.public_key_algorithm = KaitaiStream.resolve_enum(OpenpgpMessage.PublicKeyAlgorithms, self._io.read_u1())
|
|
908
|
+
self._debug['public_key_algorithm']['end'] = self._io.pos()
|
|
909
|
+
self._debug['len_alg']['start'] = self._io.pos()
|
|
910
|
+
self.len_alg = self._io.read_u2be()
|
|
911
|
+
self._debug['len_alg']['end'] = self._io.pos()
|
|
912
|
+
self._debug['rsa_n']['start'] = self._io.pos()
|
|
913
|
+
self.rsa_n = self._io.read_bytes(self.len_alg // 8)
|
|
914
|
+
self._debug['rsa_n']['end'] = self._io.pos()
|
|
915
|
+
self._debug['padding']['start'] = self._io.pos()
|
|
916
|
+
self.padding = self._io.read_u2be()
|
|
917
|
+
self._debug['padding']['end'] = self._io.pos()
|
|
918
|
+
self._debug['rsa_e']['start'] = self._io.pos()
|
|
919
|
+
self.rsa_e = self._io.read_bytes(3)
|
|
920
|
+
self._debug['rsa_e']['end'] = self._io.pos()
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
class KeyExpirationTime(KaitaiStruct):
|
|
924
|
+
SEQ_FIELDS = ["time"]
|
|
925
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
926
|
+
self._io = _io
|
|
927
|
+
self._parent = _parent
|
|
928
|
+
self._root = _root if _root else self
|
|
929
|
+
self._debug = collections.defaultdict(dict)
|
|
930
|
+
|
|
931
|
+
def _read(self):
|
|
932
|
+
self._debug['time']['start'] = self._io.pos()
|
|
933
|
+
self.time = self._io.read_u4be()
|
|
934
|
+
self._debug['time']['end'] = self._io.pos()
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
class Packet(KaitaiStruct):
|
|
938
|
+
SEQ_FIELDS = ["one", "new_packet_format", "packet_type_new", "packet_type_old", "len_type", "body"]
|
|
939
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
940
|
+
self._io = _io
|
|
941
|
+
self._parent = _parent
|
|
942
|
+
self._root = _root if _root else self
|
|
943
|
+
self._debug = collections.defaultdict(dict)
|
|
944
|
+
|
|
945
|
+
def _read(self):
|
|
946
|
+
self._debug['one']['start'] = self._io.pos()
|
|
947
|
+
self.one = self._io.read_bits_int_be(1) != 0
|
|
948
|
+
self._debug['one']['end'] = self._io.pos()
|
|
949
|
+
self._debug['new_packet_format']['start'] = self._io.pos()
|
|
950
|
+
self.new_packet_format = self._io.read_bits_int_be(1) != 0
|
|
951
|
+
self._debug['new_packet_format']['end'] = self._io.pos()
|
|
952
|
+
if self.new_packet_format:
|
|
953
|
+
self._debug['packet_type_new']['start'] = self._io.pos()
|
|
954
|
+
self.packet_type_new = KaitaiStream.resolve_enum(OpenpgpMessage.PacketTags, self._io.read_bits_int_be(6))
|
|
955
|
+
self._debug['packet_type_new']['end'] = self._io.pos()
|
|
956
|
+
|
|
957
|
+
if not (self.new_packet_format):
|
|
958
|
+
self._debug['packet_type_old']['start'] = self._io.pos()
|
|
959
|
+
self.packet_type_old = KaitaiStream.resolve_enum(OpenpgpMessage.PacketTags, self._io.read_bits_int_be(4))
|
|
960
|
+
self._debug['packet_type_old']['end'] = self._io.pos()
|
|
961
|
+
|
|
962
|
+
if not (self.new_packet_format):
|
|
963
|
+
self._debug['len_type']['start'] = self._io.pos()
|
|
964
|
+
self.len_type = self._io.read_bits_int_be(2)
|
|
965
|
+
self._debug['len_type']['end'] = self._io.pos()
|
|
966
|
+
|
|
967
|
+
self._io.align_to_byte()
|
|
968
|
+
self._debug['body']['start'] = self._io.pos()
|
|
969
|
+
_on = self.new_packet_format
|
|
970
|
+
if _on == False:
|
|
971
|
+
self.body = OpenpgpMessage.OldPacket(self._io, self, self._root)
|
|
972
|
+
self.body._read()
|
|
973
|
+
self._debug['body']['end'] = self._io.pos()
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
class TrustSignature(KaitaiStruct):
|
|
977
|
+
SEQ_FIELDS = ["level", "amount"]
|
|
978
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
979
|
+
self._io = _io
|
|
980
|
+
self._parent = _parent
|
|
981
|
+
self._root = _root if _root else self
|
|
982
|
+
self._debug = collections.defaultdict(dict)
|
|
983
|
+
|
|
984
|
+
def _read(self):
|
|
985
|
+
self._debug['level']['start'] = self._io.pos()
|
|
986
|
+
self.level = self._io.read_u1()
|
|
987
|
+
self._debug['level']['end'] = self._io.pos()
|
|
988
|
+
self._debug['amount']['start'] = self._io.pos()
|
|
989
|
+
self.amount = self._io.read_u1()
|
|
990
|
+
self._debug['amount']['end'] = self._io.pos()
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|