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,877 @@
|
|
|
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 RenderwareBinaryStream(KaitaiStruct):
|
|
14
|
+
"""
|
|
15
|
+
.. seealso::
|
|
16
|
+
Source - https://gtamods.com/wiki/RenderWare_binary_stream_file
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
class Sections(Enum):
|
|
20
|
+
struct = 1
|
|
21
|
+
string = 2
|
|
22
|
+
extension = 3
|
|
23
|
+
camera = 5
|
|
24
|
+
texture = 6
|
|
25
|
+
material = 7
|
|
26
|
+
material_list = 8
|
|
27
|
+
atomic_section = 9
|
|
28
|
+
plane_section = 10
|
|
29
|
+
world = 11
|
|
30
|
+
spline = 12
|
|
31
|
+
matrix = 13
|
|
32
|
+
frame_list = 14
|
|
33
|
+
geometry = 15
|
|
34
|
+
clump = 16
|
|
35
|
+
light = 18
|
|
36
|
+
unicode_string = 19
|
|
37
|
+
atomic = 20
|
|
38
|
+
texture_native = 21
|
|
39
|
+
texture_dictionary = 22
|
|
40
|
+
animation_database = 23
|
|
41
|
+
image = 24
|
|
42
|
+
skin_animation = 25
|
|
43
|
+
geometry_list = 26
|
|
44
|
+
anim_animation = 27
|
|
45
|
+
team = 28
|
|
46
|
+
crowd = 29
|
|
47
|
+
delta_morph_animation = 30
|
|
48
|
+
right_to_render = 31
|
|
49
|
+
multitexture_effect_native = 32
|
|
50
|
+
multitexture_effect_dictionary = 33
|
|
51
|
+
team_dictionary = 34
|
|
52
|
+
platform_independent_texture_dictionary = 35
|
|
53
|
+
table_of_contents = 36
|
|
54
|
+
particle_standard_global_data = 37
|
|
55
|
+
altpipe = 38
|
|
56
|
+
platform_independent_peds = 39
|
|
57
|
+
patch_mesh = 40
|
|
58
|
+
chunk_group_start = 41
|
|
59
|
+
chunk_group_end = 42
|
|
60
|
+
uv_animation_dictionary = 43
|
|
61
|
+
coll_tree = 44
|
|
62
|
+
metrics_plg = 257
|
|
63
|
+
spline_plg = 258
|
|
64
|
+
stereo_plg = 259
|
|
65
|
+
vrml_plg = 260
|
|
66
|
+
morph_plg = 261
|
|
67
|
+
pvs_plg = 262
|
|
68
|
+
memory_leak_plg = 263
|
|
69
|
+
animation_plg = 264
|
|
70
|
+
gloss_plg = 265
|
|
71
|
+
logo_plg = 266
|
|
72
|
+
memory_info_plg = 267
|
|
73
|
+
random_plg = 268
|
|
74
|
+
png_image_plg = 269
|
|
75
|
+
bone_plg = 270
|
|
76
|
+
vrml_anim_plg = 271
|
|
77
|
+
sky_mipmap_val = 272
|
|
78
|
+
mrm_plg = 273
|
|
79
|
+
lod_atomic_plg = 274
|
|
80
|
+
me_plg = 275
|
|
81
|
+
lightmap_plg = 276
|
|
82
|
+
refine_plg = 277
|
|
83
|
+
skin_plg = 278
|
|
84
|
+
label_plg = 279
|
|
85
|
+
particles_plg = 280
|
|
86
|
+
geomtx_plg = 281
|
|
87
|
+
synth_core_plg = 282
|
|
88
|
+
stqpp_plg = 283
|
|
89
|
+
part_pp_plg = 284
|
|
90
|
+
collision_plg = 285
|
|
91
|
+
hanim_plg = 286
|
|
92
|
+
user_data_plg = 287
|
|
93
|
+
material_effects_plg = 288
|
|
94
|
+
particle_system_plg = 289
|
|
95
|
+
delta_morph_plg = 290
|
|
96
|
+
patch_plg = 291
|
|
97
|
+
team_plg = 292
|
|
98
|
+
crowd_pp_plg = 293
|
|
99
|
+
mip_split_plg = 294
|
|
100
|
+
anisotropy_plg = 295
|
|
101
|
+
gcn_material_plg = 297
|
|
102
|
+
geometric_pvs_plg = 298
|
|
103
|
+
xbox_material_plg = 299
|
|
104
|
+
multi_texture_plg = 300
|
|
105
|
+
chain_plg = 301
|
|
106
|
+
toon_plg = 302
|
|
107
|
+
ptank_plg = 303
|
|
108
|
+
particle_standard_plg = 304
|
|
109
|
+
pds_plg = 305
|
|
110
|
+
prtadv_plg = 306
|
|
111
|
+
normal_map_plg = 307
|
|
112
|
+
adc_plg = 308
|
|
113
|
+
uv_animation_plg = 309
|
|
114
|
+
character_set_plg = 384
|
|
115
|
+
nohs_world_plg = 385
|
|
116
|
+
import_util_plg = 386
|
|
117
|
+
slerp_plg = 387
|
|
118
|
+
optim_plg = 388
|
|
119
|
+
tl_world_plg = 389
|
|
120
|
+
database_plg = 390
|
|
121
|
+
raytrace_plg = 391
|
|
122
|
+
ray_plg = 392
|
|
123
|
+
library_plg = 393
|
|
124
|
+
plg_2d = 400
|
|
125
|
+
tile_render_plg = 401
|
|
126
|
+
jpeg_image_plg = 402
|
|
127
|
+
tga_image_plg = 403
|
|
128
|
+
gif_image_plg = 404
|
|
129
|
+
quat_plg = 405
|
|
130
|
+
spline_pvs_plg = 406
|
|
131
|
+
mipmap_plg = 407
|
|
132
|
+
mipmapk_plg = 408
|
|
133
|
+
font_2d = 409
|
|
134
|
+
intersection_plg = 410
|
|
135
|
+
tiff_image_plg = 411
|
|
136
|
+
pick_plg = 412
|
|
137
|
+
bmp_image_plg = 413
|
|
138
|
+
ras_image_plg = 414
|
|
139
|
+
skin_fx_plg = 415
|
|
140
|
+
vcat_plg = 416
|
|
141
|
+
path_2d = 417
|
|
142
|
+
brush_2d = 418
|
|
143
|
+
object_2d = 419
|
|
144
|
+
shape_2d = 420
|
|
145
|
+
scene_2d = 421
|
|
146
|
+
pick_region_2d = 422
|
|
147
|
+
object_string_2d = 423
|
|
148
|
+
animation_plg_2d = 424
|
|
149
|
+
animation_2d = 425
|
|
150
|
+
keyframe_2d = 432
|
|
151
|
+
maestro_2d = 433
|
|
152
|
+
barycentric = 434
|
|
153
|
+
platform_independent_texture_dictionary_tk = 435
|
|
154
|
+
toc_tk = 436
|
|
155
|
+
tpl_tk = 437
|
|
156
|
+
altpipe_tk = 438
|
|
157
|
+
animation_tk = 439
|
|
158
|
+
skin_split_tookit = 440
|
|
159
|
+
compressed_key_tk = 441
|
|
160
|
+
geometry_conditioning_plg = 442
|
|
161
|
+
wing_plg = 443
|
|
162
|
+
generic_pipeline_tk = 444
|
|
163
|
+
lightmap_conversion_tk = 445
|
|
164
|
+
filesystem_plg = 446
|
|
165
|
+
dictionary_tk = 447
|
|
166
|
+
uv_animation_linear = 448
|
|
167
|
+
uv_animation_parameter = 449
|
|
168
|
+
bin_mesh_plg = 1294
|
|
169
|
+
native_data_plg = 1296
|
|
170
|
+
zmodeler_lock = 61982
|
|
171
|
+
atomic_visibility_distance = 39055872
|
|
172
|
+
clump_visibility_distance = 39055873
|
|
173
|
+
frame_visibility_distance = 39055874
|
|
174
|
+
pipeline_set = 39056115
|
|
175
|
+
unused_5 = 39056116
|
|
176
|
+
texdictionary_link = 39056117
|
|
177
|
+
specular_material = 39056118
|
|
178
|
+
unused_8 = 39056119
|
|
179
|
+
effect_2d = 39056120
|
|
180
|
+
extra_vert_colour = 39056121
|
|
181
|
+
collision_model = 39056122
|
|
182
|
+
gta_hanim = 39056123
|
|
183
|
+
reflection_material = 39056124
|
|
184
|
+
breakable = 39056125
|
|
185
|
+
frame = 39056126
|
|
186
|
+
unused_16 = 39056127
|
|
187
|
+
SEQ_FIELDS = ["code", "size", "library_id_stamp", "body"]
|
|
188
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
189
|
+
self._io = _io
|
|
190
|
+
self._parent = _parent
|
|
191
|
+
self._root = _root if _root else self
|
|
192
|
+
self._debug = collections.defaultdict(dict)
|
|
193
|
+
|
|
194
|
+
def _read(self):
|
|
195
|
+
self._debug['code']['start'] = self._io.pos()
|
|
196
|
+
self.code = KaitaiStream.resolve_enum(RenderwareBinaryStream.Sections, self._io.read_u4le())
|
|
197
|
+
self._debug['code']['end'] = self._io.pos()
|
|
198
|
+
self._debug['size']['start'] = self._io.pos()
|
|
199
|
+
self.size = self._io.read_u4le()
|
|
200
|
+
self._debug['size']['end'] = self._io.pos()
|
|
201
|
+
self._debug['library_id_stamp']['start'] = self._io.pos()
|
|
202
|
+
self.library_id_stamp = self._io.read_u4le()
|
|
203
|
+
self._debug['library_id_stamp']['end'] = self._io.pos()
|
|
204
|
+
self._debug['body']['start'] = self._io.pos()
|
|
205
|
+
_on = self.code
|
|
206
|
+
if _on == RenderwareBinaryStream.Sections.atomic:
|
|
207
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
208
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
209
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
210
|
+
self.body._read()
|
|
211
|
+
elif _on == RenderwareBinaryStream.Sections.geometry:
|
|
212
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
213
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
214
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
215
|
+
self.body._read()
|
|
216
|
+
elif _on == RenderwareBinaryStream.Sections.texture_dictionary:
|
|
217
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
218
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
219
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
220
|
+
self.body._read()
|
|
221
|
+
elif _on == RenderwareBinaryStream.Sections.geometry_list:
|
|
222
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
223
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
224
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
225
|
+
self.body._read()
|
|
226
|
+
elif _on == RenderwareBinaryStream.Sections.texture_native:
|
|
227
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
228
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
229
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
230
|
+
self.body._read()
|
|
231
|
+
elif _on == RenderwareBinaryStream.Sections.clump:
|
|
232
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
233
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
234
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
235
|
+
self.body._read()
|
|
236
|
+
elif _on == RenderwareBinaryStream.Sections.frame_list:
|
|
237
|
+
self._raw_body = self._io.read_bytes(self.size)
|
|
238
|
+
_io__raw_body = KaitaiStream(BytesIO(self._raw_body))
|
|
239
|
+
self.body = RenderwareBinaryStream.ListWithHeader(_io__raw_body, self, self._root)
|
|
240
|
+
self.body._read()
|
|
241
|
+
else:
|
|
242
|
+
self.body = self._io.read_bytes(self.size)
|
|
243
|
+
self._debug['body']['end'] = self._io.pos()
|
|
244
|
+
|
|
245
|
+
class StructClump(KaitaiStruct):
|
|
246
|
+
"""
|
|
247
|
+
.. seealso::
|
|
248
|
+
Source - https://gtamods.com/wiki/RpClump
|
|
249
|
+
"""
|
|
250
|
+
SEQ_FIELDS = ["num_atomics", "num_lights", "num_cameras"]
|
|
251
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
252
|
+
self._io = _io
|
|
253
|
+
self._parent = _parent
|
|
254
|
+
self._root = _root if _root else self
|
|
255
|
+
self._debug = collections.defaultdict(dict)
|
|
256
|
+
|
|
257
|
+
def _read(self):
|
|
258
|
+
self._debug['num_atomics']['start'] = self._io.pos()
|
|
259
|
+
self.num_atomics = self._io.read_u4le()
|
|
260
|
+
self._debug['num_atomics']['end'] = self._io.pos()
|
|
261
|
+
if self._parent.version >= 208896:
|
|
262
|
+
self._debug['num_lights']['start'] = self._io.pos()
|
|
263
|
+
self.num_lights = self._io.read_u4le()
|
|
264
|
+
self._debug['num_lights']['end'] = self._io.pos()
|
|
265
|
+
|
|
266
|
+
if self._parent.version >= 208896:
|
|
267
|
+
self._debug['num_cameras']['start'] = self._io.pos()
|
|
268
|
+
self.num_cameras = self._io.read_u4le()
|
|
269
|
+
self._debug['num_cameras']['end'] = self._io.pos()
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
class StructGeometry(KaitaiStruct):
|
|
274
|
+
"""
|
|
275
|
+
.. seealso::
|
|
276
|
+
Source - https://gtamods.com/wiki/RpGeometry
|
|
277
|
+
"""
|
|
278
|
+
SEQ_FIELDS = ["format", "num_triangles", "num_vertices", "num_morph_targets", "surf_prop", "geometry", "morph_targets"]
|
|
279
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
280
|
+
self._io = _io
|
|
281
|
+
self._parent = _parent
|
|
282
|
+
self._root = _root if _root else self
|
|
283
|
+
self._debug = collections.defaultdict(dict)
|
|
284
|
+
|
|
285
|
+
def _read(self):
|
|
286
|
+
self._debug['format']['start'] = self._io.pos()
|
|
287
|
+
self.format = self._io.read_u4le()
|
|
288
|
+
self._debug['format']['end'] = self._io.pos()
|
|
289
|
+
self._debug['num_triangles']['start'] = self._io.pos()
|
|
290
|
+
self.num_triangles = self._io.read_u4le()
|
|
291
|
+
self._debug['num_triangles']['end'] = self._io.pos()
|
|
292
|
+
self._debug['num_vertices']['start'] = self._io.pos()
|
|
293
|
+
self.num_vertices = self._io.read_u4le()
|
|
294
|
+
self._debug['num_vertices']['end'] = self._io.pos()
|
|
295
|
+
self._debug['num_morph_targets']['start'] = self._io.pos()
|
|
296
|
+
self.num_morph_targets = self._io.read_u4le()
|
|
297
|
+
self._debug['num_morph_targets']['end'] = self._io.pos()
|
|
298
|
+
if self._parent.version < 212992:
|
|
299
|
+
self._debug['surf_prop']['start'] = self._io.pos()
|
|
300
|
+
self.surf_prop = RenderwareBinaryStream.SurfaceProperties(self._io, self, self._root)
|
|
301
|
+
self.surf_prop._read()
|
|
302
|
+
self._debug['surf_prop']['end'] = self._io.pos()
|
|
303
|
+
|
|
304
|
+
if not (self.is_native):
|
|
305
|
+
self._debug['geometry']['start'] = self._io.pos()
|
|
306
|
+
self.geometry = RenderwareBinaryStream.GeometryNonNative(self._io, self, self._root)
|
|
307
|
+
self.geometry._read()
|
|
308
|
+
self._debug['geometry']['end'] = self._io.pos()
|
|
309
|
+
|
|
310
|
+
self._debug['morph_targets']['start'] = self._io.pos()
|
|
311
|
+
self.morph_targets = [None] * (self.num_morph_targets)
|
|
312
|
+
for i in range(self.num_morph_targets):
|
|
313
|
+
if not 'arr' in self._debug['morph_targets']:
|
|
314
|
+
self._debug['morph_targets']['arr'] = []
|
|
315
|
+
self._debug['morph_targets']['arr'].append({'start': self._io.pos()})
|
|
316
|
+
_t_morph_targets = RenderwareBinaryStream.MorphTarget(self._io, self, self._root)
|
|
317
|
+
_t_morph_targets._read()
|
|
318
|
+
self.morph_targets[i] = _t_morph_targets
|
|
319
|
+
self._debug['morph_targets']['arr'][i]['end'] = self._io.pos()
|
|
320
|
+
|
|
321
|
+
self._debug['morph_targets']['end'] = self._io.pos()
|
|
322
|
+
|
|
323
|
+
@property
|
|
324
|
+
def num_uv_layers_raw(self):
|
|
325
|
+
if hasattr(self, '_m_num_uv_layers_raw'):
|
|
326
|
+
return self._m_num_uv_layers_raw if hasattr(self, '_m_num_uv_layers_raw') else None
|
|
327
|
+
|
|
328
|
+
self._m_num_uv_layers_raw = ((self.format & 16711680) >> 16)
|
|
329
|
+
return self._m_num_uv_layers_raw if hasattr(self, '_m_num_uv_layers_raw') else None
|
|
330
|
+
|
|
331
|
+
@property
|
|
332
|
+
def is_textured(self):
|
|
333
|
+
if hasattr(self, '_m_is_textured'):
|
|
334
|
+
return self._m_is_textured if hasattr(self, '_m_is_textured') else None
|
|
335
|
+
|
|
336
|
+
self._m_is_textured = (self.format & 4) != 0
|
|
337
|
+
return self._m_is_textured if hasattr(self, '_m_is_textured') else None
|
|
338
|
+
|
|
339
|
+
@property
|
|
340
|
+
def is_native(self):
|
|
341
|
+
if hasattr(self, '_m_is_native'):
|
|
342
|
+
return self._m_is_native if hasattr(self, '_m_is_native') else None
|
|
343
|
+
|
|
344
|
+
self._m_is_native = (self.format & 16777216) != 0
|
|
345
|
+
return self._m_is_native if hasattr(self, '_m_is_native') else None
|
|
346
|
+
|
|
347
|
+
@property
|
|
348
|
+
def num_uv_layers(self):
|
|
349
|
+
if hasattr(self, '_m_num_uv_layers'):
|
|
350
|
+
return self._m_num_uv_layers if hasattr(self, '_m_num_uv_layers') else None
|
|
351
|
+
|
|
352
|
+
self._m_num_uv_layers = ((2 if self.is_textured2 else (1 if self.is_textured else 0)) if self.num_uv_layers_raw == 0 else self.num_uv_layers_raw)
|
|
353
|
+
return self._m_num_uv_layers if hasattr(self, '_m_num_uv_layers') else None
|
|
354
|
+
|
|
355
|
+
@property
|
|
356
|
+
def is_textured2(self):
|
|
357
|
+
if hasattr(self, '_m_is_textured2'):
|
|
358
|
+
return self._m_is_textured2 if hasattr(self, '_m_is_textured2') else None
|
|
359
|
+
|
|
360
|
+
self._m_is_textured2 = (self.format & 128) != 0
|
|
361
|
+
return self._m_is_textured2 if hasattr(self, '_m_is_textured2') else None
|
|
362
|
+
|
|
363
|
+
@property
|
|
364
|
+
def is_prelit(self):
|
|
365
|
+
if hasattr(self, '_m_is_prelit'):
|
|
366
|
+
return self._m_is_prelit if hasattr(self, '_m_is_prelit') else None
|
|
367
|
+
|
|
368
|
+
self._m_is_prelit = (self.format & 8) != 0
|
|
369
|
+
return self._m_is_prelit if hasattr(self, '_m_is_prelit') else None
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
class GeometryNonNative(KaitaiStruct):
|
|
373
|
+
SEQ_FIELDS = ["prelit_colors", "uv_layers", "triangles"]
|
|
374
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
375
|
+
self._io = _io
|
|
376
|
+
self._parent = _parent
|
|
377
|
+
self._root = _root if _root else self
|
|
378
|
+
self._debug = collections.defaultdict(dict)
|
|
379
|
+
|
|
380
|
+
def _read(self):
|
|
381
|
+
if self._parent.is_prelit:
|
|
382
|
+
self._debug['prelit_colors']['start'] = self._io.pos()
|
|
383
|
+
self.prelit_colors = [None] * (self._parent.num_vertices)
|
|
384
|
+
for i in range(self._parent.num_vertices):
|
|
385
|
+
if not 'arr' in self._debug['prelit_colors']:
|
|
386
|
+
self._debug['prelit_colors']['arr'] = []
|
|
387
|
+
self._debug['prelit_colors']['arr'].append({'start': self._io.pos()})
|
|
388
|
+
_t_prelit_colors = RenderwareBinaryStream.Rgba(self._io, self, self._root)
|
|
389
|
+
_t_prelit_colors._read()
|
|
390
|
+
self.prelit_colors[i] = _t_prelit_colors
|
|
391
|
+
self._debug['prelit_colors']['arr'][i]['end'] = self._io.pos()
|
|
392
|
+
|
|
393
|
+
self._debug['prelit_colors']['end'] = self._io.pos()
|
|
394
|
+
|
|
395
|
+
self._debug['uv_layers']['start'] = self._io.pos()
|
|
396
|
+
self.uv_layers = [None] * (self._parent.num_uv_layers)
|
|
397
|
+
for i in range(self._parent.num_uv_layers):
|
|
398
|
+
if not 'arr' in self._debug['uv_layers']:
|
|
399
|
+
self._debug['uv_layers']['arr'] = []
|
|
400
|
+
self._debug['uv_layers']['arr'].append({'start': self._io.pos()})
|
|
401
|
+
_t_uv_layers = RenderwareBinaryStream.UvLayer(self._parent.num_vertices, self._io, self, self._root)
|
|
402
|
+
_t_uv_layers._read()
|
|
403
|
+
self.uv_layers[i] = _t_uv_layers
|
|
404
|
+
self._debug['uv_layers']['arr'][i]['end'] = self._io.pos()
|
|
405
|
+
|
|
406
|
+
self._debug['uv_layers']['end'] = self._io.pos()
|
|
407
|
+
self._debug['triangles']['start'] = self._io.pos()
|
|
408
|
+
self.triangles = [None] * (self._parent.num_triangles)
|
|
409
|
+
for i in range(self._parent.num_triangles):
|
|
410
|
+
if not 'arr' in self._debug['triangles']:
|
|
411
|
+
self._debug['triangles']['arr'] = []
|
|
412
|
+
self._debug['triangles']['arr'].append({'start': self._io.pos()})
|
|
413
|
+
_t_triangles = RenderwareBinaryStream.Triangle(self._io, self, self._root)
|
|
414
|
+
_t_triangles._read()
|
|
415
|
+
self.triangles[i] = _t_triangles
|
|
416
|
+
self._debug['triangles']['arr'][i]['end'] = self._io.pos()
|
|
417
|
+
|
|
418
|
+
self._debug['triangles']['end'] = self._io.pos()
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
class StructGeometryList(KaitaiStruct):
|
|
422
|
+
"""
|
|
423
|
+
.. seealso::
|
|
424
|
+
Source - https://gtamods.com/wiki/Geometry_List_(RW_Section)#Structure
|
|
425
|
+
"""
|
|
426
|
+
SEQ_FIELDS = ["num_geometries"]
|
|
427
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
428
|
+
self._io = _io
|
|
429
|
+
self._parent = _parent
|
|
430
|
+
self._root = _root if _root else self
|
|
431
|
+
self._debug = collections.defaultdict(dict)
|
|
432
|
+
|
|
433
|
+
def _read(self):
|
|
434
|
+
self._debug['num_geometries']['start'] = self._io.pos()
|
|
435
|
+
self.num_geometries = self._io.read_u4le()
|
|
436
|
+
self._debug['num_geometries']['end'] = self._io.pos()
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
class Rgba(KaitaiStruct):
|
|
440
|
+
SEQ_FIELDS = ["r", "g", "b", "a"]
|
|
441
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
442
|
+
self._io = _io
|
|
443
|
+
self._parent = _parent
|
|
444
|
+
self._root = _root if _root else self
|
|
445
|
+
self._debug = collections.defaultdict(dict)
|
|
446
|
+
|
|
447
|
+
def _read(self):
|
|
448
|
+
self._debug['r']['start'] = self._io.pos()
|
|
449
|
+
self.r = self._io.read_u1()
|
|
450
|
+
self._debug['r']['end'] = self._io.pos()
|
|
451
|
+
self._debug['g']['start'] = self._io.pos()
|
|
452
|
+
self.g = self._io.read_u1()
|
|
453
|
+
self._debug['g']['end'] = self._io.pos()
|
|
454
|
+
self._debug['b']['start'] = self._io.pos()
|
|
455
|
+
self.b = self._io.read_u1()
|
|
456
|
+
self._debug['b']['end'] = self._io.pos()
|
|
457
|
+
self._debug['a']['start'] = self._io.pos()
|
|
458
|
+
self.a = self._io.read_u1()
|
|
459
|
+
self._debug['a']['end'] = self._io.pos()
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
class Sphere(KaitaiStruct):
|
|
463
|
+
SEQ_FIELDS = ["x", "y", "z", "radius"]
|
|
464
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
465
|
+
self._io = _io
|
|
466
|
+
self._parent = _parent
|
|
467
|
+
self._root = _root if _root else self
|
|
468
|
+
self._debug = collections.defaultdict(dict)
|
|
469
|
+
|
|
470
|
+
def _read(self):
|
|
471
|
+
self._debug['x']['start'] = self._io.pos()
|
|
472
|
+
self.x = self._io.read_f4le()
|
|
473
|
+
self._debug['x']['end'] = self._io.pos()
|
|
474
|
+
self._debug['y']['start'] = self._io.pos()
|
|
475
|
+
self.y = self._io.read_f4le()
|
|
476
|
+
self._debug['y']['end'] = self._io.pos()
|
|
477
|
+
self._debug['z']['start'] = self._io.pos()
|
|
478
|
+
self.z = self._io.read_f4le()
|
|
479
|
+
self._debug['z']['end'] = self._io.pos()
|
|
480
|
+
self._debug['radius']['start'] = self._io.pos()
|
|
481
|
+
self.radius = self._io.read_f4le()
|
|
482
|
+
self._debug['radius']['end'] = self._io.pos()
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
class MorphTarget(KaitaiStruct):
|
|
486
|
+
SEQ_FIELDS = ["bounding_sphere", "has_vertices", "has_normals", "vertices", "normals"]
|
|
487
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
488
|
+
self._io = _io
|
|
489
|
+
self._parent = _parent
|
|
490
|
+
self._root = _root if _root else self
|
|
491
|
+
self._debug = collections.defaultdict(dict)
|
|
492
|
+
|
|
493
|
+
def _read(self):
|
|
494
|
+
self._debug['bounding_sphere']['start'] = self._io.pos()
|
|
495
|
+
self.bounding_sphere = RenderwareBinaryStream.Sphere(self._io, self, self._root)
|
|
496
|
+
self.bounding_sphere._read()
|
|
497
|
+
self._debug['bounding_sphere']['end'] = self._io.pos()
|
|
498
|
+
self._debug['has_vertices']['start'] = self._io.pos()
|
|
499
|
+
self.has_vertices = self._io.read_u4le()
|
|
500
|
+
self._debug['has_vertices']['end'] = self._io.pos()
|
|
501
|
+
self._debug['has_normals']['start'] = self._io.pos()
|
|
502
|
+
self.has_normals = self._io.read_u4le()
|
|
503
|
+
self._debug['has_normals']['end'] = self._io.pos()
|
|
504
|
+
if self.has_vertices != 0:
|
|
505
|
+
self._debug['vertices']['start'] = self._io.pos()
|
|
506
|
+
self.vertices = [None] * (self._parent.num_vertices)
|
|
507
|
+
for i in range(self._parent.num_vertices):
|
|
508
|
+
if not 'arr' in self._debug['vertices']:
|
|
509
|
+
self._debug['vertices']['arr'] = []
|
|
510
|
+
self._debug['vertices']['arr'].append({'start': self._io.pos()})
|
|
511
|
+
_t_vertices = RenderwareBinaryStream.Vector3d(self._io, self, self._root)
|
|
512
|
+
_t_vertices._read()
|
|
513
|
+
self.vertices[i] = _t_vertices
|
|
514
|
+
self._debug['vertices']['arr'][i]['end'] = self._io.pos()
|
|
515
|
+
|
|
516
|
+
self._debug['vertices']['end'] = self._io.pos()
|
|
517
|
+
|
|
518
|
+
if self.has_normals != 0:
|
|
519
|
+
self._debug['normals']['start'] = self._io.pos()
|
|
520
|
+
self.normals = [None] * (self._parent.num_vertices)
|
|
521
|
+
for i in range(self._parent.num_vertices):
|
|
522
|
+
if not 'arr' in self._debug['normals']:
|
|
523
|
+
self._debug['normals']['arr'] = []
|
|
524
|
+
self._debug['normals']['arr'].append({'start': self._io.pos()})
|
|
525
|
+
_t_normals = RenderwareBinaryStream.Vector3d(self._io, self, self._root)
|
|
526
|
+
_t_normals._read()
|
|
527
|
+
self.normals[i] = _t_normals
|
|
528
|
+
self._debug['normals']['arr'][i]['end'] = self._io.pos()
|
|
529
|
+
|
|
530
|
+
self._debug['normals']['end'] = self._io.pos()
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
class StructAtomic(KaitaiStruct):
|
|
535
|
+
"""
|
|
536
|
+
.. seealso::
|
|
537
|
+
Source - https://gtamods.com/wiki/Atomic_(RW_Section)#Structure
|
|
538
|
+
"""
|
|
539
|
+
SEQ_FIELDS = ["frame_index", "geometry_index", "flag_render", "_unnamed3", "flag_collision_test", "_unnamed5", "unused"]
|
|
540
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
541
|
+
self._io = _io
|
|
542
|
+
self._parent = _parent
|
|
543
|
+
self._root = _root if _root else self
|
|
544
|
+
self._debug = collections.defaultdict(dict)
|
|
545
|
+
|
|
546
|
+
def _read(self):
|
|
547
|
+
self._debug['frame_index']['start'] = self._io.pos()
|
|
548
|
+
self.frame_index = self._io.read_u4le()
|
|
549
|
+
self._debug['frame_index']['end'] = self._io.pos()
|
|
550
|
+
self._debug['geometry_index']['start'] = self._io.pos()
|
|
551
|
+
self.geometry_index = self._io.read_u4le()
|
|
552
|
+
self._debug['geometry_index']['end'] = self._io.pos()
|
|
553
|
+
self._debug['flag_render']['start'] = self._io.pos()
|
|
554
|
+
self.flag_render = self._io.read_bits_int_le(1) != 0
|
|
555
|
+
self._debug['flag_render']['end'] = self._io.pos()
|
|
556
|
+
self._debug['_unnamed3']['start'] = self._io.pos()
|
|
557
|
+
self._unnamed3 = self._io.read_bits_int_le(1) != 0
|
|
558
|
+
self._debug['_unnamed3']['end'] = self._io.pos()
|
|
559
|
+
self._debug['flag_collision_test']['start'] = self._io.pos()
|
|
560
|
+
self.flag_collision_test = self._io.read_bits_int_le(1) != 0
|
|
561
|
+
self._debug['flag_collision_test']['end'] = self._io.pos()
|
|
562
|
+
self._debug['_unnamed5']['start'] = self._io.pos()
|
|
563
|
+
self._unnamed5 = self._io.read_bits_int_le(29)
|
|
564
|
+
self._debug['_unnamed5']['end'] = self._io.pos()
|
|
565
|
+
self._io.align_to_byte()
|
|
566
|
+
self._debug['unused']['start'] = self._io.pos()
|
|
567
|
+
self.unused = self._io.read_u4le()
|
|
568
|
+
self._debug['unused']['end'] = self._io.pos()
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class SurfaceProperties(KaitaiStruct):
|
|
572
|
+
"""
|
|
573
|
+
.. seealso::
|
|
574
|
+
Source - https://gtamods.com/wiki/RpGeometry
|
|
575
|
+
"""
|
|
576
|
+
SEQ_FIELDS = ["ambient", "specular", "diffuse"]
|
|
577
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
578
|
+
self._io = _io
|
|
579
|
+
self._parent = _parent
|
|
580
|
+
self._root = _root if _root else self
|
|
581
|
+
self._debug = collections.defaultdict(dict)
|
|
582
|
+
|
|
583
|
+
def _read(self):
|
|
584
|
+
self._debug['ambient']['start'] = self._io.pos()
|
|
585
|
+
self.ambient = self._io.read_f4le()
|
|
586
|
+
self._debug['ambient']['end'] = self._io.pos()
|
|
587
|
+
self._debug['specular']['start'] = self._io.pos()
|
|
588
|
+
self.specular = self._io.read_f4le()
|
|
589
|
+
self._debug['specular']['end'] = self._io.pos()
|
|
590
|
+
self._debug['diffuse']['start'] = self._io.pos()
|
|
591
|
+
self.diffuse = self._io.read_f4le()
|
|
592
|
+
self._debug['diffuse']['end'] = self._io.pos()
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
class StructFrameList(KaitaiStruct):
|
|
596
|
+
"""
|
|
597
|
+
.. seealso::
|
|
598
|
+
Source - https://gtamods.com/wiki/Frame_List_(RW_Section)#Structure
|
|
599
|
+
"""
|
|
600
|
+
SEQ_FIELDS = ["num_frames", "frames"]
|
|
601
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
602
|
+
self._io = _io
|
|
603
|
+
self._parent = _parent
|
|
604
|
+
self._root = _root if _root else self
|
|
605
|
+
self._debug = collections.defaultdict(dict)
|
|
606
|
+
|
|
607
|
+
def _read(self):
|
|
608
|
+
self._debug['num_frames']['start'] = self._io.pos()
|
|
609
|
+
self.num_frames = self._io.read_u4le()
|
|
610
|
+
self._debug['num_frames']['end'] = self._io.pos()
|
|
611
|
+
self._debug['frames']['start'] = self._io.pos()
|
|
612
|
+
self.frames = [None] * (self.num_frames)
|
|
613
|
+
for i in range(self.num_frames):
|
|
614
|
+
if not 'arr' in self._debug['frames']:
|
|
615
|
+
self._debug['frames']['arr'] = []
|
|
616
|
+
self._debug['frames']['arr'].append({'start': self._io.pos()})
|
|
617
|
+
_t_frames = RenderwareBinaryStream.Frame(self._io, self, self._root)
|
|
618
|
+
_t_frames._read()
|
|
619
|
+
self.frames[i] = _t_frames
|
|
620
|
+
self._debug['frames']['arr'][i]['end'] = self._io.pos()
|
|
621
|
+
|
|
622
|
+
self._debug['frames']['end'] = self._io.pos()
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
class Matrix(KaitaiStruct):
|
|
626
|
+
"""
|
|
627
|
+
.. seealso::
|
|
628
|
+
Source - https://gtamods.com/wiki/Frame_List_(RW_Section)#Structure
|
|
629
|
+
"""
|
|
630
|
+
SEQ_FIELDS = ["entries"]
|
|
631
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
632
|
+
self._io = _io
|
|
633
|
+
self._parent = _parent
|
|
634
|
+
self._root = _root if _root else self
|
|
635
|
+
self._debug = collections.defaultdict(dict)
|
|
636
|
+
|
|
637
|
+
def _read(self):
|
|
638
|
+
self._debug['entries']['start'] = self._io.pos()
|
|
639
|
+
self.entries = [None] * (3)
|
|
640
|
+
for i in range(3):
|
|
641
|
+
if not 'arr' in self._debug['entries']:
|
|
642
|
+
self._debug['entries']['arr'] = []
|
|
643
|
+
self._debug['entries']['arr'].append({'start': self._io.pos()})
|
|
644
|
+
_t_entries = RenderwareBinaryStream.Vector3d(self._io, self, self._root)
|
|
645
|
+
_t_entries._read()
|
|
646
|
+
self.entries[i] = _t_entries
|
|
647
|
+
self._debug['entries']['arr'][i]['end'] = self._io.pos()
|
|
648
|
+
|
|
649
|
+
self._debug['entries']['end'] = self._io.pos()
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
class Vector3d(KaitaiStruct):
|
|
653
|
+
"""
|
|
654
|
+
.. seealso::
|
|
655
|
+
Source - https://gtamods.com/wiki/Frame_List_(RW_Section)#Structure
|
|
656
|
+
"""
|
|
657
|
+
SEQ_FIELDS = ["x", "y", "z"]
|
|
658
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
659
|
+
self._io = _io
|
|
660
|
+
self._parent = _parent
|
|
661
|
+
self._root = _root if _root else self
|
|
662
|
+
self._debug = collections.defaultdict(dict)
|
|
663
|
+
|
|
664
|
+
def _read(self):
|
|
665
|
+
self._debug['x']['start'] = self._io.pos()
|
|
666
|
+
self.x = self._io.read_f4le()
|
|
667
|
+
self._debug['x']['end'] = self._io.pos()
|
|
668
|
+
self._debug['y']['start'] = self._io.pos()
|
|
669
|
+
self.y = self._io.read_f4le()
|
|
670
|
+
self._debug['y']['end'] = self._io.pos()
|
|
671
|
+
self._debug['z']['start'] = self._io.pos()
|
|
672
|
+
self.z = self._io.read_f4le()
|
|
673
|
+
self._debug['z']['end'] = self._io.pos()
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
class ListWithHeader(KaitaiStruct):
|
|
677
|
+
"""Typical structure used by many data types in RenderWare binary
|
|
678
|
+
stream. Substream contains a list of binary stream entries,
|
|
679
|
+
first entry always has type "struct" and carries some specific
|
|
680
|
+
binary data it in, determined by the type of parent. All other
|
|
681
|
+
entries, beside the first one, are normal, self-describing
|
|
682
|
+
records.
|
|
683
|
+
"""
|
|
684
|
+
SEQ_FIELDS = ["code", "header_size", "library_id_stamp", "header", "entries"]
|
|
685
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
686
|
+
self._io = _io
|
|
687
|
+
self._parent = _parent
|
|
688
|
+
self._root = _root if _root else self
|
|
689
|
+
self._debug = collections.defaultdict(dict)
|
|
690
|
+
|
|
691
|
+
def _read(self):
|
|
692
|
+
self._debug['code']['start'] = self._io.pos()
|
|
693
|
+
self.code = self._io.read_bytes(4)
|
|
694
|
+
self._debug['code']['end'] = self._io.pos()
|
|
695
|
+
if not self.code == b"\x01\x00\x00\x00":
|
|
696
|
+
raise kaitaistruct.ValidationNotEqualError(b"\x01\x00\x00\x00", self.code, self._io, u"/types/list_with_header/seq/0")
|
|
697
|
+
self._debug['header_size']['start'] = self._io.pos()
|
|
698
|
+
self.header_size = self._io.read_u4le()
|
|
699
|
+
self._debug['header_size']['end'] = self._io.pos()
|
|
700
|
+
self._debug['library_id_stamp']['start'] = self._io.pos()
|
|
701
|
+
self.library_id_stamp = self._io.read_u4le()
|
|
702
|
+
self._debug['library_id_stamp']['end'] = self._io.pos()
|
|
703
|
+
self._debug['header']['start'] = self._io.pos()
|
|
704
|
+
_on = self._parent.code
|
|
705
|
+
if _on == RenderwareBinaryStream.Sections.atomic:
|
|
706
|
+
self._raw_header = self._io.read_bytes(self.header_size)
|
|
707
|
+
_io__raw_header = KaitaiStream(BytesIO(self._raw_header))
|
|
708
|
+
self.header = RenderwareBinaryStream.StructAtomic(_io__raw_header, self, self._root)
|
|
709
|
+
self.header._read()
|
|
710
|
+
elif _on == RenderwareBinaryStream.Sections.geometry:
|
|
711
|
+
self._raw_header = self._io.read_bytes(self.header_size)
|
|
712
|
+
_io__raw_header = KaitaiStream(BytesIO(self._raw_header))
|
|
713
|
+
self.header = RenderwareBinaryStream.StructGeometry(_io__raw_header, self, self._root)
|
|
714
|
+
self.header._read()
|
|
715
|
+
elif _on == RenderwareBinaryStream.Sections.texture_dictionary:
|
|
716
|
+
self._raw_header = self._io.read_bytes(self.header_size)
|
|
717
|
+
_io__raw_header = KaitaiStream(BytesIO(self._raw_header))
|
|
718
|
+
self.header = RenderwareBinaryStream.StructTextureDictionary(_io__raw_header, self, self._root)
|
|
719
|
+
self.header._read()
|
|
720
|
+
elif _on == RenderwareBinaryStream.Sections.geometry_list:
|
|
721
|
+
self._raw_header = self._io.read_bytes(self.header_size)
|
|
722
|
+
_io__raw_header = KaitaiStream(BytesIO(self._raw_header))
|
|
723
|
+
self.header = RenderwareBinaryStream.StructGeometryList(_io__raw_header, self, self._root)
|
|
724
|
+
self.header._read()
|
|
725
|
+
elif _on == RenderwareBinaryStream.Sections.clump:
|
|
726
|
+
self._raw_header = self._io.read_bytes(self.header_size)
|
|
727
|
+
_io__raw_header = KaitaiStream(BytesIO(self._raw_header))
|
|
728
|
+
self.header = RenderwareBinaryStream.StructClump(_io__raw_header, self, self._root)
|
|
729
|
+
self.header._read()
|
|
730
|
+
elif _on == RenderwareBinaryStream.Sections.frame_list:
|
|
731
|
+
self._raw_header = self._io.read_bytes(self.header_size)
|
|
732
|
+
_io__raw_header = KaitaiStream(BytesIO(self._raw_header))
|
|
733
|
+
self.header = RenderwareBinaryStream.StructFrameList(_io__raw_header, self, self._root)
|
|
734
|
+
self.header._read()
|
|
735
|
+
else:
|
|
736
|
+
self.header = self._io.read_bytes(self.header_size)
|
|
737
|
+
self._debug['header']['end'] = self._io.pos()
|
|
738
|
+
self._debug['entries']['start'] = self._io.pos()
|
|
739
|
+
self.entries = []
|
|
740
|
+
i = 0
|
|
741
|
+
while not self._io.is_eof():
|
|
742
|
+
if not 'arr' in self._debug['entries']:
|
|
743
|
+
self._debug['entries']['arr'] = []
|
|
744
|
+
self._debug['entries']['arr'].append({'start': self._io.pos()})
|
|
745
|
+
_t_entries = RenderwareBinaryStream(self._io)
|
|
746
|
+
_t_entries._read()
|
|
747
|
+
self.entries.append(_t_entries)
|
|
748
|
+
self._debug['entries']['arr'][len(self.entries) - 1]['end'] = self._io.pos()
|
|
749
|
+
i += 1
|
|
750
|
+
|
|
751
|
+
self._debug['entries']['end'] = self._io.pos()
|
|
752
|
+
|
|
753
|
+
@property
|
|
754
|
+
def version(self):
|
|
755
|
+
if hasattr(self, '_m_version'):
|
|
756
|
+
return self._m_version if hasattr(self, '_m_version') else None
|
|
757
|
+
|
|
758
|
+
self._m_version = (((((self.library_id_stamp >> 14) & 261888) + 196608) | ((self.library_id_stamp >> 16) & 63)) if (self.library_id_stamp & 4294901760) != 0 else (self.library_id_stamp << 8))
|
|
759
|
+
return self._m_version if hasattr(self, '_m_version') else None
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
class Triangle(KaitaiStruct):
|
|
763
|
+
SEQ_FIELDS = ["vertex2", "vertex1", "material_id", "vertex3"]
|
|
764
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
765
|
+
self._io = _io
|
|
766
|
+
self._parent = _parent
|
|
767
|
+
self._root = _root if _root else self
|
|
768
|
+
self._debug = collections.defaultdict(dict)
|
|
769
|
+
|
|
770
|
+
def _read(self):
|
|
771
|
+
self._debug['vertex2']['start'] = self._io.pos()
|
|
772
|
+
self.vertex2 = self._io.read_u2le()
|
|
773
|
+
self._debug['vertex2']['end'] = self._io.pos()
|
|
774
|
+
self._debug['vertex1']['start'] = self._io.pos()
|
|
775
|
+
self.vertex1 = self._io.read_u2le()
|
|
776
|
+
self._debug['vertex1']['end'] = self._io.pos()
|
|
777
|
+
self._debug['material_id']['start'] = self._io.pos()
|
|
778
|
+
self.material_id = self._io.read_u2le()
|
|
779
|
+
self._debug['material_id']['end'] = self._io.pos()
|
|
780
|
+
self._debug['vertex3']['start'] = self._io.pos()
|
|
781
|
+
self.vertex3 = self._io.read_u2le()
|
|
782
|
+
self._debug['vertex3']['end'] = self._io.pos()
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
class Frame(KaitaiStruct):
|
|
786
|
+
"""
|
|
787
|
+
.. seealso::
|
|
788
|
+
Source - https://gtamods.com/wiki/Frame_List_(RW_Section)#Structure
|
|
789
|
+
"""
|
|
790
|
+
SEQ_FIELDS = ["rotation_matrix", "position", "cur_frame_idx", "matrix_creation_flags"]
|
|
791
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
792
|
+
self._io = _io
|
|
793
|
+
self._parent = _parent
|
|
794
|
+
self._root = _root if _root else self
|
|
795
|
+
self._debug = collections.defaultdict(dict)
|
|
796
|
+
|
|
797
|
+
def _read(self):
|
|
798
|
+
self._debug['rotation_matrix']['start'] = self._io.pos()
|
|
799
|
+
self.rotation_matrix = RenderwareBinaryStream.Matrix(self._io, self, self._root)
|
|
800
|
+
self.rotation_matrix._read()
|
|
801
|
+
self._debug['rotation_matrix']['end'] = self._io.pos()
|
|
802
|
+
self._debug['position']['start'] = self._io.pos()
|
|
803
|
+
self.position = RenderwareBinaryStream.Vector3d(self._io, self, self._root)
|
|
804
|
+
self.position._read()
|
|
805
|
+
self._debug['position']['end'] = self._io.pos()
|
|
806
|
+
self._debug['cur_frame_idx']['start'] = self._io.pos()
|
|
807
|
+
self.cur_frame_idx = self._io.read_s4le()
|
|
808
|
+
self._debug['cur_frame_idx']['end'] = self._io.pos()
|
|
809
|
+
self._debug['matrix_creation_flags']['start'] = self._io.pos()
|
|
810
|
+
self.matrix_creation_flags = self._io.read_u4le()
|
|
811
|
+
self._debug['matrix_creation_flags']['end'] = self._io.pos()
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
class TexCoord(KaitaiStruct):
|
|
815
|
+
SEQ_FIELDS = ["u", "v"]
|
|
816
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
817
|
+
self._io = _io
|
|
818
|
+
self._parent = _parent
|
|
819
|
+
self._root = _root if _root else self
|
|
820
|
+
self._debug = collections.defaultdict(dict)
|
|
821
|
+
|
|
822
|
+
def _read(self):
|
|
823
|
+
self._debug['u']['start'] = self._io.pos()
|
|
824
|
+
self.u = self._io.read_f4le()
|
|
825
|
+
self._debug['u']['end'] = self._io.pos()
|
|
826
|
+
self._debug['v']['start'] = self._io.pos()
|
|
827
|
+
self.v = self._io.read_f4le()
|
|
828
|
+
self._debug['v']['end'] = self._io.pos()
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
class UvLayer(KaitaiStruct):
|
|
832
|
+
SEQ_FIELDS = ["tex_coords"]
|
|
833
|
+
def __init__(self, num_vertices, _io, _parent=None, _root=None):
|
|
834
|
+
self._io = _io
|
|
835
|
+
self._parent = _parent
|
|
836
|
+
self._root = _root if _root else self
|
|
837
|
+
self.num_vertices = num_vertices
|
|
838
|
+
self._debug = collections.defaultdict(dict)
|
|
839
|
+
|
|
840
|
+
def _read(self):
|
|
841
|
+
self._debug['tex_coords']['start'] = self._io.pos()
|
|
842
|
+
self.tex_coords = [None] * (self.num_vertices)
|
|
843
|
+
for i in range(self.num_vertices):
|
|
844
|
+
if not 'arr' in self._debug['tex_coords']:
|
|
845
|
+
self._debug['tex_coords']['arr'] = []
|
|
846
|
+
self._debug['tex_coords']['arr'].append({'start': self._io.pos()})
|
|
847
|
+
_t_tex_coords = RenderwareBinaryStream.TexCoord(self._io, self, self._root)
|
|
848
|
+
_t_tex_coords._read()
|
|
849
|
+
self.tex_coords[i] = _t_tex_coords
|
|
850
|
+
self._debug['tex_coords']['arr'][i]['end'] = self._io.pos()
|
|
851
|
+
|
|
852
|
+
self._debug['tex_coords']['end'] = self._io.pos()
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
class StructTextureDictionary(KaitaiStruct):
|
|
856
|
+
SEQ_FIELDS = ["num_textures"]
|
|
857
|
+
def __init__(self, _io, _parent=None, _root=None):
|
|
858
|
+
self._io = _io
|
|
859
|
+
self._parent = _parent
|
|
860
|
+
self._root = _root if _root else self
|
|
861
|
+
self._debug = collections.defaultdict(dict)
|
|
862
|
+
|
|
863
|
+
def _read(self):
|
|
864
|
+
self._debug['num_textures']['start'] = self._io.pos()
|
|
865
|
+
self.num_textures = self._io.read_u4le()
|
|
866
|
+
self._debug['num_textures']['end'] = self._io.pos()
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
@property
|
|
870
|
+
def version(self):
|
|
871
|
+
if hasattr(self, '_m_version'):
|
|
872
|
+
return self._m_version if hasattr(self, '_m_version') else None
|
|
873
|
+
|
|
874
|
+
self._m_version = (((((self.library_id_stamp >> 14) & 261888) + 196608) | ((self.library_id_stamp >> 16) & 63)) if (self.library_id_stamp & 4294901760) != 0 else (self.library_id_stamp << 8))
|
|
875
|
+
return self._m_version if hasattr(self, '_m_version') else None
|
|
876
|
+
|
|
877
|
+
|