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.

Files changed (585) hide show
  1. polyfile/__init__.py +15 -0
  2. polyfile/__main__.py +394 -0
  3. polyfile/arithmetic.py +27 -0
  4. polyfile/ast.py +114 -0
  5. polyfile/debugger.py +1039 -0
  6. polyfile/expressions.py +346 -0
  7. polyfile/fileutils.py +343 -0
  8. polyfile/html.py +135 -0
  9. polyfile/http/__init__.py +1 -0
  10. polyfile/http/defacto.py +37 -0
  11. polyfile/http/deprecated.py +51 -0
  12. polyfile/http/experimental.py +67 -0
  13. polyfile/http/http_11.py +548 -0
  14. polyfile/http/matcher.py +37 -0
  15. polyfile/http/structured_headers.py +48 -0
  16. polyfile/iterators.py +72 -0
  17. polyfile/jpeg.py +24 -0
  18. polyfile/kaitai/__init__.py +0 -0
  19. polyfile/kaitai/compiler.py +156 -0
  20. polyfile/kaitai/parser.py +312 -0
  21. polyfile/kaitai/parsers/__init__.py +0 -0
  22. polyfile/kaitai/parsers/aix_utmp.py +116 -0
  23. polyfile/kaitai/parsers/allegro_dat.py +367 -0
  24. polyfile/kaitai/parsers/andes_firmware.py +64 -0
  25. polyfile/kaitai/parsers/android_bootldr_asus.py +105 -0
  26. polyfile/kaitai/parsers/android_bootldr_huawei.py +181 -0
  27. polyfile/kaitai/parsers/android_bootldr_qcom.py +217 -0
  28. polyfile/kaitai/parsers/android_dto.py +138 -0
  29. polyfile/kaitai/parsers/android_img.py +319 -0
  30. polyfile/kaitai/parsers/android_nanoapp_header.py +83 -0
  31. polyfile/kaitai/parsers/android_opengl_shaders_cache.py +151 -0
  32. polyfile/kaitai/parsers/android_sparse.py +237 -0
  33. polyfile/kaitai/parsers/android_super.py +401 -0
  34. polyfile/kaitai/parsers/apm_partition_table.py +196 -0
  35. polyfile/kaitai/parsers/apple_single_double.py +180 -0
  36. polyfile/kaitai/parsers/asn1_der.py +235 -0
  37. polyfile/kaitai/parsers/au.py +138 -0
  38. polyfile/kaitai/parsers/avantes_roh60.py +112 -0
  39. polyfile/kaitai/parsers/avi.py +296 -0
  40. polyfile/kaitai/parsers/bcd.py +111 -0
  41. polyfile/kaitai/parsers/bitcoin_transaction.py +210 -0
  42. polyfile/kaitai/parsers/blender_blend.py +334 -0
  43. polyfile/kaitai/parsers/bmp.py +780 -0
  44. polyfile/kaitai/parsers/bson.py +411 -0
  45. polyfile/kaitai/parsers/btrfs_stream.py +318 -0
  46. polyfile/kaitai/parsers/bytes_with_io.py +27 -0
  47. polyfile/kaitai/parsers/chrome_pak.py +194 -0
  48. polyfile/kaitai/parsers/code_6502.py +456 -0
  49. polyfile/kaitai/parsers/compressed_resource.py +217 -0
  50. polyfile/kaitai/parsers/cpio_old_le.py +154 -0
  51. polyfile/kaitai/parsers/cramfs.py +344 -0
  52. polyfile/kaitai/parsers/creative_voice_file.py +342 -0
  53. polyfile/kaitai/parsers/dbf.py +274 -0
  54. polyfile/kaitai/parsers/dcmp_0.py +664 -0
  55. polyfile/kaitai/parsers/dcmp_1.py +422 -0
  56. polyfile/kaitai/parsers/dcmp_2.py +312 -0
  57. polyfile/kaitai/parsers/dcmp_variable_length_integer.py +66 -0
  58. polyfile/kaitai/parsers/dex.py +1086 -0
  59. polyfile/kaitai/parsers/dicom.py +4370 -0
  60. polyfile/kaitai/parsers/dime_message.py +201 -0
  61. polyfile/kaitai/parsers/dns_packet.py +569 -0
  62. polyfile/kaitai/parsers/doom_wad.py +654 -0
  63. polyfile/kaitai/parsers/dos_datetime.py +191 -0
  64. polyfile/kaitai/parsers/dos_mz.py +172 -0
  65. polyfile/kaitai/parsers/ds_store.py +513 -0
  66. polyfile/kaitai/parsers/dtb.py +310 -0
  67. polyfile/kaitai/parsers/dune_2_pak.py +126 -0
  68. polyfile/kaitai/parsers/edid.py +472 -0
  69. polyfile/kaitai/parsers/efivar_signature_list.py +331 -0
  70. polyfile/kaitai/parsers/elf.py +2482 -0
  71. polyfile/kaitai/parsers/ethernet_frame.py +114 -0
  72. polyfile/kaitai/parsers/exif.py +723 -0
  73. polyfile/kaitai/parsers/ext2.py +537 -0
  74. polyfile/kaitai/parsers/fallout2_dat.py +187 -0
  75. polyfile/kaitai/parsers/fallout_dat.py +156 -0
  76. polyfile/kaitai/parsers/fasttracker_xm_module.py +558 -0
  77. polyfile/kaitai/parsers/ftl_dat.py +90 -0
  78. polyfile/kaitai/parsers/genmidi_op2.py +161 -0
  79. polyfile/kaitai/parsers/gettext_mo.py +541 -0
  80. polyfile/kaitai/parsers/gif.py +492 -0
  81. polyfile/kaitai/parsers/gimp_brush.py +244 -0
  82. polyfile/kaitai/parsers/glibc_utmp.py +114 -0
  83. polyfile/kaitai/parsers/gltf_binary.py +132 -0
  84. polyfile/kaitai/parsers/google_protobuf.py +151 -0
  85. polyfile/kaitai/parsers/gpt_partition_table.py +175 -0
  86. polyfile/kaitai/parsers/gran_turismo_vol.py +140 -0
  87. polyfile/kaitai/parsers/grub2_font.py +337 -0
  88. polyfile/kaitai/parsers/gzip.py +232 -0
  89. polyfile/kaitai/parsers/hashcat_restore.py +60 -0
  90. polyfile/kaitai/parsers/hccap.py +111 -0
  91. polyfile/kaitai/parsers/hccapx.py +103 -0
  92. polyfile/kaitai/parsers/heaps_pak.py +177 -0
  93. polyfile/kaitai/parsers/heroes_of_might_and_magic_agg.py +116 -0
  94. polyfile/kaitai/parsers/heroes_of_might_and_magic_bmp.py +34 -0
  95. polyfile/kaitai/parsers/icmp_packet.py +136 -0
  96. polyfile/kaitai/parsers/ico.py +129 -0
  97. polyfile/kaitai/parsers/id3v1_1.py +220 -0
  98. polyfile/kaitai/parsers/id3v2_3.py +324 -0
  99. polyfile/kaitai/parsers/id3v2_4.py +423 -0
  100. polyfile/kaitai/parsers/ines.py +282 -0
  101. polyfile/kaitai/parsers/ipv4_packet.py +158 -0
  102. polyfile/kaitai/parsers/ipv6_packet.py +55 -0
  103. polyfile/kaitai/parsers/iso9660.py +544 -0
  104. polyfile/kaitai/parsers/java_class.py +1113 -0
  105. polyfile/kaitai/parsers/jpeg.py +361 -0
  106. polyfile/kaitai/parsers/luks.py +149 -0
  107. polyfile/kaitai/parsers/lzh.py +165 -0
  108. polyfile/kaitai/parsers/mac_os_resource_snd.py +493 -0
  109. polyfile/kaitai/parsers/mach_o.py +3033 -0
  110. polyfile/kaitai/parsers/mach_o_fat.py +92 -0
  111. polyfile/kaitai/parsers/magicavoxel_vox.py +391 -0
  112. polyfile/kaitai/parsers/manifest.json +1 -0
  113. polyfile/kaitai/parsers/mbr_partition_table.py +119 -0
  114. polyfile/kaitai/parsers/mcap.py +1015 -0
  115. polyfile/kaitai/parsers/microsoft_cfb.py +293 -0
  116. polyfile/kaitai/parsers/microsoft_network_monitor_v2.py +309 -0
  117. polyfile/kaitai/parsers/microsoft_pe.py +765 -0
  118. polyfile/kaitai/parsers/mifare_classic.py +706 -0
  119. polyfile/kaitai/parsers/minecraft_nbt.py +449 -0
  120. polyfile/kaitai/parsers/monomakh_sapr_chg.py +69 -0
  121. polyfile/kaitai/parsers/mozilla_mar.py +239 -0
  122. polyfile/kaitai/parsers/mp4.py +333 -0
  123. polyfile/kaitai/parsers/msgpack.py +467 -0
  124. polyfile/kaitai/parsers/nitf.py +1189 -0
  125. polyfile/kaitai/parsers/nt_mdt_pal.py +155 -0
  126. polyfile/kaitai/parsers/ogg.py +118 -0
  127. polyfile/kaitai/parsers/openpgp_message.py +993 -0
  128. polyfile/kaitai/parsers/packet_ppi.py +515 -0
  129. polyfile/kaitai/parsers/pcap.py +344 -0
  130. polyfile/kaitai/parsers/pcf_font.py +506 -0
  131. polyfile/kaitai/parsers/pcx.py +195 -0
  132. polyfile/kaitai/parsers/pcx_dcx.py +79 -0
  133. polyfile/kaitai/parsers/phar_without_stub.py +399 -0
  134. polyfile/kaitai/parsers/php_serialized_value.py +505 -0
  135. polyfile/kaitai/parsers/png.py +721 -0
  136. polyfile/kaitai/parsers/protocol_body.py +260 -0
  137. polyfile/kaitai/parsers/psx_tim.py +104 -0
  138. polyfile/kaitai/parsers/python_pickle.py +718 -0
  139. polyfile/kaitai/parsers/python_pyc_27.py +510 -0
  140. polyfile/kaitai/parsers/quake_mdl.py +441 -0
  141. polyfile/kaitai/parsers/quake_pak.py +112 -0
  142. polyfile/kaitai/parsers/quicktime_mov.py +634 -0
  143. polyfile/kaitai/parsers/rar.py +265 -0
  144. polyfile/kaitai/parsers/regf.py +569 -0
  145. polyfile/kaitai/parsers/renderware_binary_stream.py +877 -0
  146. polyfile/kaitai/parsers/resource_fork.py +611 -0
  147. polyfile/kaitai/parsers/respack.py +57 -0
  148. polyfile/kaitai/parsers/riff.py +409 -0
  149. polyfile/kaitai/parsers/rpm.py +964 -0
  150. polyfile/kaitai/parsers/rtcp_payload.py +579 -0
  151. polyfile/kaitai/parsers/rtp_packet.py +150 -0
  152. polyfile/kaitai/parsers/rtpdump.py +115 -0
  153. polyfile/kaitai/parsers/ruby_marshal.py +423 -0
  154. polyfile/kaitai/parsers/s3m.py +493 -0
  155. polyfile/kaitai/parsers/saints_row_2_vpp_pc.py +254 -0
  156. polyfile/kaitai/parsers/shapefile_index.py +174 -0
  157. polyfile/kaitai/parsers/shapefile_main.py +893 -0
  158. polyfile/kaitai/parsers/some_ip.py +209 -0
  159. polyfile/kaitai/parsers/some_ip_container.py +37 -0
  160. polyfile/kaitai/parsers/some_ip_sd.py +86 -0
  161. polyfile/kaitai/parsers/some_ip_sd_entries.py +160 -0
  162. polyfile/kaitai/parsers/some_ip_sd_options.py +374 -0
  163. polyfile/kaitai/parsers/specpr.py +404 -0
  164. polyfile/kaitai/parsers/sqlite3.py +472 -0
  165. polyfile/kaitai/parsers/ssh_public_key.py +252 -0
  166. polyfile/kaitai/parsers/standard_midi_file.py +390 -0
  167. polyfile/kaitai/parsers/stl.py +111 -0
  168. polyfile/kaitai/parsers/sudoers_ts.py +201 -0
  169. polyfile/kaitai/parsers/swf.py +406 -0
  170. polyfile/kaitai/parsers/systemd_journal.py +361 -0
  171. polyfile/kaitai/parsers/tcp_segment.py +57 -0
  172. polyfile/kaitai/parsers/tga.py +213 -0
  173. polyfile/kaitai/parsers/tls_client_hello.py +293 -0
  174. polyfile/kaitai/parsers/tr_dos_image.py +322 -0
  175. polyfile/kaitai/parsers/tsm.py +198 -0
  176. polyfile/kaitai/parsers/ttf.py +1847 -0
  177. polyfile/kaitai/parsers/udp_datagram.py +42 -0
  178. polyfile/kaitai/parsers/uefi_te.py +236 -0
  179. polyfile/kaitai/parsers/uimage.py +198 -0
  180. polyfile/kaitai/parsers/utf8_string.py +137 -0
  181. polyfile/kaitai/parsers/vfat.py +410 -0
  182. polyfile/kaitai/parsers/vlq_base128_be.py +104 -0
  183. polyfile/kaitai/parsers/vlq_base128_le.py +129 -0
  184. polyfile/kaitai/parsers/vmware_vmdk.py +167 -0
  185. polyfile/kaitai/parsers/vp8_ivf.py +112 -0
  186. polyfile/kaitai/parsers/warcraft_2_pud.py +423 -0
  187. polyfile/kaitai/parsers/wav.py +1014 -0
  188. polyfile/kaitai/parsers/websocket.py +167 -0
  189. polyfile/kaitai/parsers/windows_evt_log.py +304 -0
  190. polyfile/kaitai/parsers/windows_lnk_file.py +467 -0
  191. polyfile/kaitai/parsers/windows_minidump.py +575 -0
  192. polyfile/kaitai/parsers/windows_resource_file.py +243 -0
  193. polyfile/kaitai/parsers/windows_shell_items.py +190 -0
  194. polyfile/kaitai/parsers/windows_systemtime.py +52 -0
  195. polyfile/kaitai/parsers/wmf.py +502 -0
  196. polyfile/kaitai/parsers/xar.py +181 -0
  197. polyfile/kaitai/parsers/xwd.py +189 -0
  198. polyfile/kaitai/parsers/zip.py +685 -0
  199. polyfile/kaitai/parsers/zisofs.py +158 -0
  200. polyfile/kaitai/parsers/zx_spectrum_tap.py +184 -0
  201. polyfile/kaitaimatcher.py +113 -0
  202. polyfile/languagematcher.py +217 -0
  203. polyfile/logger.py +135 -0
  204. polyfile/magic.py +2983 -0
  205. polyfile/magic_defs/COPYING +29 -0
  206. polyfile/magic_defs/__init__.py +0 -0
  207. polyfile/magic_defs/acorn +102 -0
  208. polyfile/magic_defs/adi +13 -0
  209. polyfile/magic_defs/adventure +122 -0
  210. polyfile/magic_defs/aes +29 -0
  211. polyfile/magic_defs/algol68 +35 -0
  212. polyfile/magic_defs/allegro +9 -0
  213. polyfile/magic_defs/alliant +18 -0
  214. polyfile/magic_defs/alpha +32 -0
  215. polyfile/magic_defs/amanda +12 -0
  216. polyfile/magic_defs/amigaos +218 -0
  217. polyfile/magic_defs/android +259 -0
  218. polyfile/magic_defs/animation +1197 -0
  219. polyfile/magic_defs/aout +46 -0
  220. polyfile/magic_defs/apache +28 -0
  221. polyfile/magic_defs/apl +7 -0
  222. polyfile/magic_defs/apple +773 -0
  223. polyfile/magic_defs/application +7 -0
  224. polyfile/magic_defs/applix +13 -0
  225. polyfile/magic_defs/apt +52 -0
  226. polyfile/magic_defs/archive +2586 -0
  227. polyfile/magic_defs/aria +38 -0
  228. polyfile/magic_defs/arm +50 -0
  229. polyfile/magic_defs/asf +132 -0
  230. polyfile/magic_defs/assembler +18 -0
  231. polyfile/magic_defs/asterix +18 -0
  232. polyfile/magic_defs/att3b +41 -0
  233. polyfile/magic_defs/audio +1291 -0
  234. polyfile/magic_defs/avm +33 -0
  235. polyfile/magic_defs/basis +18 -0
  236. polyfile/magic_defs/beetle +7 -0
  237. polyfile/magic_defs/ber +65 -0
  238. polyfile/magic_defs/bflt +14 -0
  239. polyfile/magic_defs/bhl +10 -0
  240. polyfile/magic_defs/bioinformatics +178 -0
  241. polyfile/magic_defs/biosig +154 -0
  242. polyfile/magic_defs/blackberry +8 -0
  243. polyfile/magic_defs/blcr +25 -0
  244. polyfile/magic_defs/blender +50 -0
  245. polyfile/magic_defs/blit +24 -0
  246. polyfile/magic_defs/bm +10 -0
  247. polyfile/magic_defs/bout +11 -0
  248. polyfile/magic_defs/bsdi +33 -0
  249. polyfile/magic_defs/bsi +10 -0
  250. polyfile/magic_defs/btsnoop +13 -0
  251. polyfile/magic_defs/burp +7 -0
  252. polyfile/magic_defs/bytecode +41 -0
  253. polyfile/magic_defs/c-lang +110 -0
  254. polyfile/magic_defs/c64 +531 -0
  255. polyfile/magic_defs/cad +437 -0
  256. polyfile/magic_defs/cafebabe +107 -0
  257. polyfile/magic_defs/cbor +21 -0
  258. polyfile/magic_defs/ccf +14 -0
  259. polyfile/magic_defs/cddb +12 -0
  260. polyfile/magic_defs/chord +15 -0
  261. polyfile/magic_defs/cisco +12 -0
  262. polyfile/magic_defs/citrus +12 -0
  263. polyfile/magic_defs/clarion +27 -0
  264. polyfile/magic_defs/claris +48 -0
  265. polyfile/magic_defs/clipper +65 -0
  266. polyfile/magic_defs/clojure +30 -0
  267. polyfile/magic_defs/coff +98 -0
  268. polyfile/magic_defs/commands +201 -0
  269. polyfile/magic_defs/communications +22 -0
  270. polyfile/magic_defs/compress +461 -0
  271. polyfile/magic_defs/console +1213 -0
  272. polyfile/magic_defs/convex +69 -0
  273. polyfile/magic_defs/coverage +91 -0
  274. polyfile/magic_defs/cracklib +14 -0
  275. polyfile/magic_defs/crypto +31 -0
  276. polyfile/magic_defs/csv +8 -0
  277. polyfile/magic_defs/ctags +6 -0
  278. polyfile/magic_defs/ctf +23 -0
  279. polyfile/magic_defs/cubemap +8 -0
  280. polyfile/magic_defs/cups +56 -0
  281. polyfile/magic_defs/dact +11 -0
  282. polyfile/magic_defs/database +886 -0
  283. polyfile/magic_defs/dataone +47 -0
  284. polyfile/magic_defs/dbpf +15 -0
  285. polyfile/magic_defs/der +146 -0
  286. polyfile/magic_defs/diamond +12 -0
  287. polyfile/magic_defs/dif +33 -0
  288. polyfile/magic_defs/diff +41 -0
  289. polyfile/magic_defs/digital +59 -0
  290. polyfile/magic_defs/dolby +69 -0
  291. polyfile/magic_defs/dsf +25 -0
  292. polyfile/magic_defs/dump +96 -0
  293. polyfile/magic_defs/dwarfs +45 -0
  294. polyfile/magic_defs/dyadic +61 -0
  295. polyfile/magic_defs/ebml +8 -0
  296. polyfile/magic_defs/edid +11 -0
  297. polyfile/magic_defs/editors +43 -0
  298. polyfile/magic_defs/efi +15 -0
  299. polyfile/magic_defs/elf +379 -0
  300. polyfile/magic_defs/encore +22 -0
  301. polyfile/magic_defs/epoc +62 -0
  302. polyfile/magic_defs/erlang +21 -0
  303. polyfile/magic_defs/espressif +57 -0
  304. polyfile/magic_defs/esri +28 -0
  305. polyfile/magic_defs/etf +33 -0
  306. polyfile/magic_defs/fcs +9 -0
  307. polyfile/magic_defs/filesystems +2694 -0
  308. polyfile/magic_defs/finger +16 -0
  309. polyfile/magic_defs/firmware +133 -0
  310. polyfile/magic_defs/flash +62 -0
  311. polyfile/magic_defs/flif +36 -0
  312. polyfile/magic_defs/fonts +449 -0
  313. polyfile/magic_defs/forth +82 -0
  314. polyfile/magic_defs/fortran +9 -0
  315. polyfile/magic_defs/frame +62 -0
  316. polyfile/magic_defs/freebsd +164 -0
  317. polyfile/magic_defs/fsav +128 -0
  318. polyfile/magic_defs/fusecompress +12 -0
  319. polyfile/magic_defs/games +696 -0
  320. polyfile/magic_defs/gcc +17 -0
  321. polyfile/magic_defs/gconv +10 -0
  322. polyfile/magic_defs/gentoo +85 -0
  323. polyfile/magic_defs/geo +166 -0
  324. polyfile/magic_defs/geos +20 -0
  325. polyfile/magic_defs/gimp +77 -0
  326. polyfile/magic_defs/git +13 -0
  327. polyfile/magic_defs/glibc +21 -0
  328. polyfile/magic_defs/gnome +59 -0
  329. polyfile/magic_defs/gnu +173 -0
  330. polyfile/magic_defs/gnumeric +8 -0
  331. polyfile/magic_defs/gpt +240 -0
  332. polyfile/magic_defs/gpu +28 -0
  333. polyfile/magic_defs/grace +21 -0
  334. polyfile/magic_defs/graphviz +12 -0
  335. polyfile/magic_defs/gringotts +48 -0
  336. polyfile/magic_defs/guile +13 -0
  337. polyfile/magic_defs/hardware +12 -0
  338. polyfile/magic_defs/hitachi-sh +30 -0
  339. polyfile/magic_defs/hp +433 -0
  340. polyfile/magic_defs/human68k +26 -0
  341. polyfile/magic_defs/ibm370 +52 -0
  342. polyfile/magic_defs/ibm6000 +35 -0
  343. polyfile/magic_defs/icc +214 -0
  344. polyfile/magic_defs/iff +80 -0
  345. polyfile/magic_defs/images +4210 -0
  346. polyfile/magic_defs/inform +9 -0
  347. polyfile/magic_defs/intel +310 -0
  348. polyfile/magic_defs/interleaf +9 -0
  349. polyfile/magic_defs/island +10 -0
  350. polyfile/magic_defs/ispell +63 -0
  351. polyfile/magic_defs/isz +15 -0
  352. polyfile/magic_defs/java +52 -0
  353. polyfile/magic_defs/javascript +171 -0
  354. polyfile/magic_defs/jpeg +252 -0
  355. polyfile/magic_defs/json +8 -0
  356. polyfile/magic_defs/karma +9 -0
  357. polyfile/magic_defs/kde +11 -0
  358. polyfile/magic_defs/keepass +20 -0
  359. polyfile/magic_defs/kerberos +45 -0
  360. polyfile/magic_defs/kicad +85 -0
  361. polyfile/magic_defs/kml +34 -0
  362. polyfile/magic_defs/lammps +64 -0
  363. polyfile/magic_defs/lecter +6 -0
  364. polyfile/magic_defs/lex +12 -0
  365. polyfile/magic_defs/lif +50 -0
  366. polyfile/magic_defs/linux +557 -0
  367. polyfile/magic_defs/lisp +78 -0
  368. polyfile/magic_defs/llvm +22 -0
  369. polyfile/magic_defs/locoscript +12 -0
  370. polyfile/magic_defs/lua +31 -0
  371. polyfile/magic_defs/luks +126 -0
  372. polyfile/magic_defs/m4 +11 -0
  373. polyfile/magic_defs/mach +303 -0
  374. polyfile/magic_defs/macintosh +505 -0
  375. polyfile/magic_defs/macos +7 -0
  376. polyfile/magic_defs/magic +10 -0
  377. polyfile/magic_defs/magic.mgc +0 -0
  378. polyfile/magic_defs/mail.news +132 -0
  379. polyfile/magic_defs/make +21 -0
  380. polyfile/magic_defs/map +413 -0
  381. polyfile/magic_defs/maple +109 -0
  382. polyfile/magic_defs/marc21 +30 -0
  383. polyfile/magic_defs/mathcad +8 -0
  384. polyfile/magic_defs/mathematica +188 -0
  385. polyfile/magic_defs/matroska +17 -0
  386. polyfile/magic_defs/mcrypt +52 -0
  387. polyfile/magic_defs/measure +44 -0
  388. polyfile/magic_defs/mercurial +13 -0
  389. polyfile/magic_defs/metastore +8 -0
  390. polyfile/magic_defs/meteorological +53 -0
  391. polyfile/magic_defs/microfocus +21 -0
  392. polyfile/magic_defs/mime +9 -0
  393. polyfile/magic_defs/mips +120 -0
  394. polyfile/magic_defs/mirage +8 -0
  395. polyfile/magic_defs/misctools +140 -0
  396. polyfile/magic_defs/mkid +11 -0
  397. polyfile/magic_defs/mlssa +8 -0
  398. polyfile/magic_defs/mmdf +6 -0
  399. polyfile/magic_defs/modem +92 -0
  400. polyfile/magic_defs/modulefile +9 -0
  401. polyfile/magic_defs/motorola +71 -0
  402. polyfile/magic_defs/mozilla +37 -0
  403. polyfile/magic_defs/msdos +2304 -0
  404. polyfile/magic_defs/msooxml +68 -0
  405. polyfile/magic_defs/msvc +222 -0
  406. polyfile/magic_defs/msx +309 -0
  407. polyfile/magic_defs/mup +24 -0
  408. polyfile/magic_defs/music +17 -0
  409. polyfile/magic_defs/nasa +7 -0
  410. polyfile/magic_defs/natinst +24 -0
  411. polyfile/magic_defs/ncr +49 -0
  412. polyfile/magic_defs/neko +12 -0
  413. polyfile/magic_defs/netbsd +251 -0
  414. polyfile/magic_defs/netscape +26 -0
  415. polyfile/magic_defs/netware +11 -0
  416. polyfile/magic_defs/news +13 -0
  417. polyfile/magic_defs/nifty +202 -0
  418. polyfile/magic_defs/nim-lang +29 -0
  419. polyfile/magic_defs/nitpicker +14 -0
  420. polyfile/magic_defs/numpy +9 -0
  421. polyfile/magic_defs/oasis +12 -0
  422. polyfile/magic_defs/ocaml +14 -0
  423. polyfile/magic_defs/octave +6 -0
  424. polyfile/magic_defs/ole2compounddocs +760 -0
  425. polyfile/magic_defs/olf +98 -0
  426. polyfile/magic_defs/openfst +17 -0
  427. polyfile/magic_defs/opentimestamps +16 -0
  428. polyfile/magic_defs/oric +16 -0
  429. polyfile/magic_defs/os2 +186 -0
  430. polyfile/magic_defs/os400 +39 -0
  431. polyfile/magic_defs/os9 +80 -0
  432. polyfile/magic_defs/osf1 +10 -0
  433. polyfile/magic_defs/palm +156 -0
  434. polyfile/magic_defs/parix +13 -0
  435. polyfile/magic_defs/parrot +22 -0
  436. polyfile/magic_defs/pascal +39 -0
  437. polyfile/magic_defs/pbf +11 -0
  438. polyfile/magic_defs/pbm +8 -0
  439. polyfile/magic_defs/pc88 +24 -0
  440. polyfile/magic_defs/pc98 +77 -0
  441. polyfile/magic_defs/pci_ids +116 -0
  442. polyfile/magic_defs/pcjr +8 -0
  443. polyfile/magic_defs/pdf +51 -0
  444. polyfile/magic_defs/pdp +42 -0
  445. polyfile/magic_defs/perl +100 -0
  446. polyfile/magic_defs/pgf +52 -0
  447. polyfile/magic_defs/pgp +581 -0
  448. polyfile/magic_defs/pgp-binary-keys +388 -0
  449. polyfile/magic_defs/pkgadd +7 -0
  450. polyfile/magic_defs/plan9 +25 -0
  451. polyfile/magic_defs/playdate +57 -0
  452. polyfile/magic_defs/plus5 +18 -0
  453. polyfile/magic_defs/pmem +46 -0
  454. polyfile/magic_defs/polyfile_zip +5 -0
  455. polyfile/magic_defs/polyml +23 -0
  456. polyfile/magic_defs/printer +269 -0
  457. polyfile/magic_defs/project +10 -0
  458. polyfile/magic_defs/psdbms +14 -0
  459. polyfile/magic_defs/psl +14 -0
  460. polyfile/magic_defs/pulsar +13 -0
  461. polyfile/magic_defs/puzzle +17 -0
  462. polyfile/magic_defs/pwsafe +14 -0
  463. polyfile/magic_defs/pyramid +12 -0
  464. polyfile/magic_defs/python +305 -0
  465. polyfile/magic_defs/qt +30 -0
  466. polyfile/magic_defs/revision +66 -0
  467. polyfile/magic_defs/riff +840 -0
  468. polyfile/magic_defs/rinex +44 -0
  469. polyfile/magic_defs/ringdove +45 -0
  470. polyfile/magic_defs/rpi +52 -0
  471. polyfile/magic_defs/rpm +45 -0
  472. polyfile/magic_defs/rpmsg +7 -0
  473. polyfile/magic_defs/rst +11 -0
  474. polyfile/magic_defs/rtf +94 -0
  475. polyfile/magic_defs/ruby +55 -0
  476. polyfile/magic_defs/rust +21 -0
  477. polyfile/magic_defs/sc +7 -0
  478. polyfile/magic_defs/sccs +24 -0
  479. polyfile/magic_defs/scientific +144 -0
  480. polyfile/magic_defs/securitycerts +6 -0
  481. polyfile/magic_defs/selinux +24 -0
  482. polyfile/magic_defs/sendmail +37 -0
  483. polyfile/magic_defs/sequent +42 -0
  484. polyfile/magic_defs/sereal +35 -0
  485. polyfile/magic_defs/sgi +144 -0
  486. polyfile/magic_defs/sgml +161 -0
  487. polyfile/magic_defs/sharc +23 -0
  488. polyfile/magic_defs/sinclair +40 -0
  489. polyfile/magic_defs/sisu +18 -0
  490. polyfile/magic_defs/sketch +6 -0
  491. polyfile/magic_defs/smalltalk +25 -0
  492. polyfile/magic_defs/smile +34 -0
  493. polyfile/magic_defs/sniffer +482 -0
  494. polyfile/magic_defs/softquad +40 -0
  495. polyfile/magic_defs/sosi +40 -0
  496. polyfile/magic_defs/spec +21 -0
  497. polyfile/magic_defs/spectrum +184 -0
  498. polyfile/magic_defs/sql +288 -0
  499. polyfile/magic_defs/ssh +39 -0
  500. polyfile/magic_defs/ssl +20 -0
  501. polyfile/magic_defs/statistics +45 -0
  502. polyfile/magic_defs/subtitle +38 -0
  503. polyfile/magic_defs/sun +141 -0
  504. polyfile/magic_defs/svf +5 -0
  505. polyfile/magic_defs/sylk +36 -0
  506. polyfile/magic_defs/symbos +42 -0
  507. polyfile/magic_defs/sysex +429 -0
  508. polyfile/magic_defs/tcl +29 -0
  509. polyfile/magic_defs/teapot +6 -0
  510. polyfile/magic_defs/terminfo +63 -0
  511. polyfile/magic_defs/tex +141 -0
  512. polyfile/magic_defs/tgif +7 -0
  513. polyfile/magic_defs/ti-8x +239 -0
  514. polyfile/magic_defs/timezone +42 -0
  515. polyfile/magic_defs/tplink +95 -0
  516. polyfile/magic_defs/troff +38 -0
  517. polyfile/magic_defs/tuxedo +8 -0
  518. polyfile/magic_defs/typeset +8 -0
  519. polyfile/magic_defs/uf2 +72 -0
  520. polyfile/magic_defs/unicode +15 -0
  521. polyfile/magic_defs/unisig +12 -0
  522. polyfile/magic_defs/unknown +34 -0
  523. polyfile/magic_defs/usd +21 -0
  524. polyfile/magic_defs/uterus +16 -0
  525. polyfile/magic_defs/uuencode +28 -0
  526. polyfile/magic_defs/vacuum-cleaner +54 -0
  527. polyfile/magic_defs/varied.out +46 -0
  528. polyfile/magic_defs/varied.script +21 -0
  529. polyfile/magic_defs/vax +32 -0
  530. polyfile/magic_defs/vicar +17 -0
  531. polyfile/magic_defs/virtual +307 -0
  532. polyfile/magic_defs/virtutech +12 -0
  533. polyfile/magic_defs/visx +32 -0
  534. polyfile/magic_defs/vms +30 -0
  535. polyfile/magic_defs/vmware +6 -0
  536. polyfile/magic_defs/vorbis +155 -0
  537. polyfile/magic_defs/vxl +14 -0
  538. polyfile/magic_defs/warc +16 -0
  539. polyfile/magic_defs/weak +16 -0
  540. polyfile/magic_defs/web +18 -0
  541. polyfile/magic_defs/webassembly +17 -0
  542. polyfile/magic_defs/windows +1811 -0
  543. polyfile/magic_defs/wireless +7 -0
  544. polyfile/magic_defs/wordprocessors +630 -0
  545. polyfile/magic_defs/wsdl +23 -0
  546. polyfile/magic_defs/x68000 +25 -0
  547. polyfile/magic_defs/xdelta +13 -0
  548. polyfile/magic_defs/xenix +106 -0
  549. polyfile/magic_defs/xilinx +58 -0
  550. polyfile/magic_defs/xo65 +37 -0
  551. polyfile/magic_defs/xwindows +43 -0
  552. polyfile/magic_defs/yara +17 -0
  553. polyfile/magic_defs/zfs +96 -0
  554. polyfile/magic_defs/zilog +12 -0
  555. polyfile/magic_defs/zip +126 -0
  556. polyfile/magic_defs/zyxel +17 -0
  557. polyfile/nes.py +144 -0
  558. polyfile/nitf.py +15 -0
  559. polyfile/pdf.py +1264 -0
  560. polyfile/pickles.py +45 -0
  561. polyfile/polyfile.py +409 -0
  562. polyfile/profiling.py +115 -0
  563. polyfile/repl.py +624 -0
  564. polyfile/search.py +310 -0
  565. polyfile/serialization.py +323 -0
  566. polyfile/structmatcher.py +46 -0
  567. polyfile/structs.py +281 -0
  568. polyfile/templates/download.js +162 -0
  569. polyfile/templates/hexdump.css +268 -0
  570. polyfile/templates/hexdump.js +756 -0
  571. polyfile/templates/jquery-3.4.1.min.js +2 -0
  572. polyfile/templates/template.html +119 -0
  573. polyfile/wildcards.py +62 -0
  574. polyfile/zipmatcher.py +183 -0
  575. polyfile_weave-0.5.5.dist-info/METADATA +173 -0
  576. polyfile_weave-0.5.5.dist-info/RECORD +585 -0
  577. polyfile_weave-0.5.5.dist-info/WHEEL +5 -0
  578. polyfile_weave-0.5.5.dist-info/entry_points.txt +2 -0
  579. polyfile_weave-0.5.5.dist-info/licenses/LICENSE +202 -0
  580. polyfile_weave-0.5.5.dist-info/top_level.txt +2 -0
  581. polymerge/__init__.py +1 -0
  582. polymerge/__main__.py +296 -0
  583. polymerge/cfg.py +127 -0
  584. polymerge/polymerge.py +227 -0
  585. polymerge/polytracker.py +190 -0
@@ -0,0 +1,531 @@
1
+
2
+ #------------------------------------------------------------------------------
3
+ # $File: c64,v 1.13 2022/11/21 22:25:37 christos Exp $
4
+ # c64: file(1) magic for various commodore 64 related files
5
+ #
6
+ # From: Dirk Jagdmann <doj@cubic.org>
7
+
8
+ 0x16500 belong 0x12014100 D64 Image
9
+ 0x16500 belong 0x12014180 D71 Image
10
+ 0x61800 belong 0x28034400 D81 Image
11
+ 0 belong 0x43154164 X64 Image
12
+
13
+ # C64 (and other CBM) cartridges
14
+ # Extended by David Korth <gerbilsoft@gerbilsoft.com>
15
+ # Reference: https://vice-emu.sourceforge.io/vice_17.html#SEC391
16
+
17
+ 0 string C64\40CARTRIDGE Commodore 64 cartridge
18
+ >0x20 ubyte 0 \b,
19
+ >0x20 ubyte !0
20
+ >>0x20 string/T x \b: "%.32s",
21
+ >0x16 beshort 0
22
+ >>0x18 beshort 0x0000 16 KB game
23
+ >>0x18 beshort 0x0001 8 KB game
24
+ >>0x18 beshort 0x0100 UltiMax mode
25
+ >>0x18 beshort 0x0101 RAM/disabled
26
+ >0x16 beshort 1 Action Replay
27
+ >0x16 beshort 2 KCS Power Cartridge
28
+ >0x16 beshort 3 Final Cartridge III
29
+ >0x16 beshort 4 Simons' BASIC
30
+ >0x16 beshort 5 Ocean type 1
31
+ >0x16 beshort 6 Expert Cartridge
32
+ >0x16 beshort 7 Fun Play, Power Play
33
+ >0x16 beshort 8 Super Games
34
+ >0x16 beshort 9 Atomic Power
35
+ >0x16 beshort 10 Epyx Fastload
36
+ >0x16 beshort 11 Westermann Learning
37
+ >0x16 beshort 12 Rex Utility
38
+ >0x16 beshort 13 Final Cartridge I
39
+ >0x16 beshort 14 Magic Formel
40
+ >0x16 beshort 15 C64 Game System, System 3
41
+ >0x16 beshort 16 Warp Speed
42
+ >0x16 beshort 17 Dinamic
43
+ >0x16 beshort 18 Zaxxon / Super Zaxxon (Sega)
44
+ >0x16 beshort 19 Magic Desk, Domark, HES Australia
45
+ >0x16 beshort 20 Super Snapshot V5
46
+ >0x16 beshort 21 Comal-80
47
+ >0x16 beshort 22 Structured BASIC
48
+ >0x16 beshort 23 Ross
49
+ >0x16 beshort 24 Dela EP64
50
+ >0x16 beshort 25 Dela EP7x8
51
+ >0x16 beshort 26 Dela EP256
52
+ >0x16 beshort 27 Rex EP256
53
+ >0x16 beshort 28 Mikro Assembler
54
+ >0x16 beshort 29 Final Cartridge Plus
55
+ >0x16 beshort 30 Action Replay 4
56
+ >0x16 beshort 31 Stardos
57
+ >0x16 beshort 32 EasyFlash
58
+ >0x16 beshort 33 EasyFlash Xbank
59
+ >0x16 beshort 34 Capture
60
+ >0x16 beshort 35 Action Replay 3
61
+ >0x16 beshort 36
62
+ >>0x1A ubyte 1 Nordic Replay
63
+ >>0x1A ubyte !1 Retro Replay
64
+ >0x16 beshort 37 MMC64
65
+ >0x16 beshort 38 MMC Replay
66
+ >0x16 beshort 39 IDE64
67
+ >0x16 beshort 40 Super Snapshot V4
68
+ >0x16 beshort 41 IEEE-488
69
+ >0x16 beshort 42 Game Killer
70
+ >0x16 beshort 43 Prophet64
71
+ >0x16 beshort 44 EXOS
72
+ >0x16 beshort 45 Freeze Frame
73
+ >0x16 beshort 46 Freeze Machine
74
+ >0x16 beshort 47 Snapshot64
75
+ >0x16 beshort 48 Super Explode V5.0
76
+ >0x16 beshort 49 Magic Voice
77
+ >0x16 beshort 50 Action Replay 2
78
+ >0x16 beshort 51 MACH 5
79
+ >0x16 beshort 52 Diashow-Maker
80
+ >0x16 beshort 53 Pagefox
81
+ >0x16 beshort 54 Kingsoft
82
+ >0x16 beshort 55 Silverrock 128K Cartridge
83
+ >0x16 beshort 56 Formel 64
84
+ >0x16 beshort 57
85
+ >>0x1A ubyte 1 Hucky
86
+ >>0x1A ubyte !1 RGCD
87
+ >0x16 beshort 58 RR-Net MK3
88
+ >0x16 beshort 59 EasyCalc
89
+ >0x16 beshort 60 GMod2
90
+ >0x16 beshort 61 MAX Basic
91
+ >0x16 beshort 62 GMod3
92
+ >0x16 beshort 63 ZIPP-CODE 48
93
+ >0x16 beshort 64 Blackbox V8
94
+ >0x16 beshort 65 Blackbox V3
95
+ >0x16 beshort 66 Blackbox V4
96
+ >0x16 beshort 67 REX RAM-Floppy
97
+ >0x16 beshort 68 BIS-Plus
98
+ >0x16 beshort 69 SD-BOX
99
+ >0x16 beshort 70 MultiMAX
100
+ >0x16 beshort 71 Blackbox V9
101
+ >0x16 beshort 72 Lt. Kernal Host Adaptor
102
+ >0x16 beshort 73 RAMLink
103
+ >0x16 beshort 74 H.E.R.O.
104
+ >0x16 beshort 75 IEEE Flash! 64
105
+ >0x16 beshort 76 Turtle Graphics II
106
+ >0x16 beshort 77 Freeze Frame MK2
107
+
108
+ 0 string C128\40CARTRIDGE Commodore 128 cartridge
109
+ >0x20 ubyte 0 \b,
110
+ >0x20 ubyte !0
111
+ >>0x20 string/T x \b: "%.32s",
112
+ >0x16 beshort 0 generic cartridge
113
+ >0x16 beshort 1 Warpspeed128
114
+ >>0x1A ubyte 1 \b, REU support
115
+ >>0x1A ubyte 2 \b, REU support, with I/O and ROM banking
116
+
117
+ 0 string CBM2\40CARTRIDGE Commodore CBM-II cartridge
118
+ >0x20 ubyte !0
119
+ >>0x20 string/T x \b: "%.32s"
120
+
121
+ 0 string VIC20\40CARTRIDGE Commodore VIC-20 cartridge
122
+ >0x20 ubyte 0 \b,
123
+ >0x20 ubyte !0
124
+ >>0x20 string/T x \b: "%.32s",
125
+ >0x16 beshort 0 generic cartridge
126
+ >0x16 beshort 1 Mega-Cart
127
+ >0x16 beshort 2 Behr Bonz
128
+ >0x16 beshort 3 Vic Flash Plugin
129
+ >0x16 beshort 4 UltiMem
130
+ >0x16 beshort 5 Final Expansion
131
+
132
+ 0 string PLUS4\40CARTRIDGE Commodore 16/Plus4 cartridge
133
+ >0x20 ubyte !0
134
+ >>0x20 string/T x \b: "%.32s"
135
+
136
+
137
+ # DreamLoad archives see:
138
+ # https://www.lemon64.com/forum/viewtopic.php?t=37415\
139
+ # &sid=494dc2ca91289e05dadf80a7f8a968fe (at the bottom).
140
+ # https://www.c64-wiki.com/wiki/DreamLoad.
141
+ # Example HVSC Commodore 64 music collection:
142
+ # https://kohina.duckdns.org/HVSC/C64Music/10_Years_HVSC.dfi
143
+
144
+ 0 byte 0
145
+ >1 string DREAMLOAD\40FILE\40ARCHIVE
146
+ >>0x17 byte 0 DFI Image
147
+ >>>0x1a leshort x version: %d.
148
+ >>>0x18 leshort x \b%d
149
+ >>>0x1c lelong x tracks: %d
150
+
151
+ 0 string GCR-1541 GCR Image
152
+ >8 byte x version: %i
153
+ >9 byte x tracks: %i
154
+
155
+ 9 string PSUR ARC archive (c64)
156
+ 2 string -LH1- LHA archive (c64)
157
+
158
+ 0 string C64File PC64 Emulator file
159
+ >8 string >\0 "%s"
160
+ 0 string C64Image PC64 Freezer Image
161
+
162
+ 0 beshort 0x38CD C64 PCLink Image
163
+ 0 string CBM\144\0\0 Power 64 C64 Emulator Snapshot
164
+
165
+ 0 belong 0xFF424CFF WRAptor packer (c64)
166
+
167
+ 0 string C64S\x20tape\x20file T64 tape Image
168
+ >32 leshort x Version:%#x
169
+ >36 leshort !0 Entries:%i
170
+ >40 string x Name:%.24s
171
+
172
+ 0 string C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
173
+ >32 leshort x Version:%#x
174
+ >36 leshort !0 Entries:%i
175
+ >40 string x Name:%.24s
176
+
177
+ 0 string C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
178
+ >32 leshort x Version:%#x
179
+ >36 leshort !0 Entries:%i
180
+ >40 string x Name:%.24s
181
+
182
+ # Raw tape file format (.tap files)
183
+ # Esa Hyyti <esa@netlab.tkk.fi>
184
+ 0 string C64-TAPE-RAW C64 Raw Tape File (.tap),
185
+ >0x0c byte x Version:%u,
186
+ >0x10 lelong x Length:%u cycles
187
+
188
+ # magic for Goattracker2, http://covertbitops.c64.org/
189
+ # from Alex Myczko <alex@aiei.ch>
190
+ 0 string GTS5 GoatTracker 2 song
191
+ >4 string >\0 \b, "%s"
192
+ >36 string >\0 \b by %s
193
+ >68 string >\0 \b (C) %s
194
+ >100 byte >0 \b, %u subsong(s)
195
+
196
+ # CBM BASIC (cc65 compiled)
197
+ # Summary: binary executable or Basic program for Commodore C64 computers
198
+ # Update: Joerg Jenderek
199
+ # URL: http://fileformats.archiveteam.org/wiki/Commodore_BASIC_tokenized_file
200
+ # Reference: https://www.c64-wiki.com/wiki/BASIC_token
201
+ # https://github.com/thezerobit/bastext/blob/master/bastext.doc
202
+ # http://mark0.net/download/triddefs_xml.7z/defs/p/prg-c64.trid.xml
203
+ # TODO: unify Commodore BASIC/program sub routines
204
+ # Note: "PUCrunch archive data" moved from ./archive and merged with c64-exe
205
+ 0 leshort 0x0801
206
+ # if first token is not SYS this implies BASIC program in most cases
207
+ >6 ubyte !0x9e
208
+ # but sELF-ExTRACTING-zIP executable unzp6420.prg contains SYS token at end of second BASIC line (at 0x35)
209
+ >>23 search/30 \323ELF-E\330TRACTING-\332IP
210
+ >>>0 use c64-exe
211
+ >>23 default x
212
+ >>>0 use c64-prg
213
+ # if first token is SYS this implies binary executable
214
+ >6 ubyte =0x9e
215
+ >>0 use c64-exe
216
+ # display information about C64 binary executable (memory address, line number, token)
217
+ 0 name c64-exe
218
+ >0 uleshort x Commodore C64
219
+ # http://a1bert.kapsi.fi/Dev/pucrunch/
220
+ # start address 0801h; next offset 080bh; BASIC line number is 239=00EFh; BASIC instruction is SYS 2061
221
+ # the above combination appartly also occur for other Commodore programs like: gunzip111.c64.prg
222
+ # and there exist PUCrunch archive for other machines like C16 with other magics
223
+ >0 string \x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 program, probably PUCrunch archive data
224
+ !:mime application/x-compress-pucrunch
225
+ !:ext prg/pck
226
+ >0 string !\x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 program
227
+ !:mime application/x-commodore-exec
228
+ !:ext prg/
229
+ # start address like: 801h
230
+ >0 uleshort !0x0801 \b, start address %#4.4x
231
+ # 1st BASIC fragment
232
+ >2 use basic-line
233
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
234
+ >(2.s-0x800) ubyte x
235
+ >>&-1 ubyte !0 \b, no EOL=%#x
236
+ # valid 2nd BASIC fragment found only in sELF-ExTRACTING-zIP executable unzp6420.prg
237
+ >>23 search/30 \323ELF-E\330TRACTING-\332IP
238
+ # jump again from beginning
239
+ >>>(2.s-0x800) ubyte x
240
+ >>>>&0 use basic-line
241
+ # Zero-byte marking the end of the BASIC line
242
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
243
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
244
+ >>-2 ubeshort x \b%4.4x
245
+ # display information about tokenized C64 BASIC program (memory address, line number, token)
246
+ 0 name c64-prg
247
+ >0 uleshort x Commodore C64 BASIC program
248
+ !:mime application/x-commodore-basic
249
+ # Tokenized BASIC programs were stored by Commodore as file type program "PRG" in separate field in directory structures.
250
+ # So file name can have no suffix like in saveroms; When transferring to other platforms, they are often saved with .prg extensions.
251
+ # BAS suffix is typically used for the BASIC source but also found in program pods.bas
252
+ !:ext prg/bas/
253
+ # start address like: 801h
254
+ >0 uleshort !0x0801 \b, start address %#4.4x
255
+ # 1st BASIC fragment
256
+ >2 use basic-line
257
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
258
+ >(2.s-0x0800) ubyte x
259
+ >>&-1 ubyte !0 \b, no EOL=%#x
260
+ # 2nd BASIC fragment
261
+ >>&0 use basic-line
262
+ # zero-byte marking the end of the BASIC line
263
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
264
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
265
+ >>-2 ubeshort x \b%4.4x
266
+ # Summary: binary executable or Basic program for Commodore C128 computers
267
+ # URL: https://en.wikipedia.org/wiki/Commodore_128
268
+ # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/prg-c128.trid.xml
269
+ # From: Joerg Jenderek
270
+ # Note: Commodore 128 BASIC 7.0 variant; there exist varaints with different start addresses
271
+ 0 leshort 0x1C01
272
+ !:strength +1
273
+ # GRR: line above with strength 51 (50+1) is too generic because it matches SVr3 curses screen image, big-endian with strength (50) handled by ./terminfo
274
+ # probably skip SVr3 curses images with "invalid high" second line offset
275
+ >2 uleshort <0x1D02
276
+ # skip foo with "invalid low" second line offset
277
+ >>2 uleshort >0x1C06
278
+ # if first token is not SYS this implies BASIC program
279
+ >>>6 ubyte !0x9e
280
+ >>>>0 use c128-prg
281
+ # if first token is SYS this implies binary executable
282
+ >>>6 ubyte =0x9e
283
+ >>>>0 use c128-exe
284
+ # Summary: binary executable or Basic program for Commodore C128 computers
285
+ # Note: Commodore 128 BASIC 7.1 extension by Rick Simon
286
+ # start adress 132Dh
287
+ #0 leshort 0x132D THIS_IS_C128_7.1
288
+ #>0 use c128-prg
289
+ # Summary: binary executable or Basic program for Commodore C128 computers
290
+ # Note: Commodore 128 BASIC 7.0 saved with graphics mode enabled
291
+ # start adress 4001h
292
+ #0 leshort 0x4001 THIS_IS_C128_GRAPHIC
293
+ #>0 use c128-prg
294
+ # display information about tokenized C128 BASIC program (memory address, line number, token)
295
+ 0 name c128-prg
296
+ >0 uleshort x Commodore C128 BASIC program
297
+ !:mime application/x-commodore-basic
298
+ !:ext prg
299
+ # start address like: 1C01h
300
+ >0 uleshort !0x1C01 \b, start address %#4.4x
301
+ # 1st BASIC fragment
302
+ >2 use basic-line
303
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
304
+ >(2.s-0x1C00) ubyte x
305
+ >>&-1 ubyte !0 \b, no EOL=%#x
306
+ # 2nd BASIC fragment
307
+ >>&0 use basic-line
308
+ # Zero-byte marking the end of the BASIC line
309
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
310
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
311
+ >>-2 ubeshort x \b%4.4x
312
+ # display information about C128 program (memory address, line number, token)
313
+ 0 name c128-exe
314
+ >0 uleshort x Commodore C128 program
315
+ !:mime application/x-commodore-exec
316
+ !:ext prg/
317
+ # start address like: 1C01h
318
+ >0 uleshort !0x1C01 \b, start address %#4.4x
319
+ # 1st BASIC fragment
320
+ >2 use basic-line
321
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
322
+ >(2.s-0x1C00) ubyte x
323
+ >>&-1 ubyte !0 \b, no EOL=%#x
324
+ # no valid 2nd BASIC fragment in Commodore executables
325
+ #>>&0 use basic-line
326
+ # Zero-byte marking the end of the BASIC line
327
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
328
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
329
+ >>-2 ubeshort x \b%4.4x
330
+ # Summary: binary executable or Basic program for Commodore C16/VIC-20/Plus4 computers
331
+ # URL: https://en.wikipedia.org/wiki/Commodore_Plus/4
332
+ # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/prg-vic20.trid.xml
333
+ # defs/p/prg-plus4.trid.xml
334
+ # From: Joerg Jenderek
335
+ # Note: there exist VIC-20 variants with different start address
336
+ # GRR: line below is too generic because it matches Novell LANalyzer capture
337
+ # with regular trace header record handled by ./sniffer
338
+ 0 leshort 0x1001
339
+ # skip regular Novell LANalyzer capture (novell-2.tr1 novell-lanalyzer.tr1 novell-win10.tr1) with "invalid low" token value 54h
340
+ >6 ubyte >0x7F
341
+ # skip regular Novell LANalyzer capture (novell-2.tr1 novell-lanalyzer.tr1 novell-win10.tr1) with "invalid low" second line offset 4Ch
342
+ #>>2 uleshort >0x1006 OFFSET_NOT_TOO_LOW
343
+ # skip foo with "invalid high" second line offset but not for 0x123b (Minefield.prg)
344
+ #>>>2 uleshort <0x1102 OFFSET_NOT_TOO_HIGH
345
+ # if first token is not SYS this implies BASIC program
346
+ >>6 ubyte !0x9e
347
+ # valid second end of line separator implies BASIC program
348
+ >>>(2.s-0x1000) ubyte =0
349
+ >>>>0 use c16-prg
350
+ # invalid second end of line separator !=0 implies binary executable like: Minefield.prg
351
+ >>>(2.s-0x1000) ubyte !0
352
+ >>>>0 use c16-exe
353
+ # if first token is SYS this implies binary executable
354
+ >>6 ubyte =0x9e
355
+ >>>0 use c16-exe
356
+ # display information about C16 program (memory address, line number, token)
357
+ 0 name c16-exe
358
+ >0 uleshort x Commodore C16/VIC-20/Plus4 program
359
+ !:mime application/x-commodore-exec
360
+ !:ext prg/
361
+ # start address like: 1001h
362
+ >0 uleshort !0x1001 \b, start address %#4.4x
363
+ # 1st BASIC fragment
364
+ >2 use basic-line
365
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
366
+ >(2.s-0x1000) ubyte x
367
+ >>&-1 ubyte !0 \b, no EOL=%#x
368
+ # no valid 2nd BASIC fragment in excutables
369
+ #>>&0 use basic-line
370
+ # Zero-byte marking the end of the BASIC line
371
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
372
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
373
+ >>-2 ubeshort x \b%4.4x
374
+ # display information about tokenized C16 BASIC program (memory address, line number, token)
375
+ 0 name c16-prg
376
+ >0 uleshort x Commodore C16/VIC-20/Plus4 BASIC program
377
+ !:mime application/x-commodore-basic
378
+ !:ext prg
379
+ # start address like: 1001h
380
+ >0 uleshort !0x1001 \b, start address %#4.4x
381
+ # 1st BASIC fragment
382
+ >2 use basic-line
383
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
384
+ >(2.s-0x1000) ubyte x
385
+ >>&-1 ubyte !0 \b, no EOL=%#x
386
+ # 2nd BASIC fragment
387
+ >>&0 use basic-line
388
+ # Zero-byte marking the end of the BASIC line
389
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
390
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
391
+ >>-2 ubeshort x \b%4.4x
392
+ # Summary: binary executable or Basic program for Commodore VIC-20 computer with 8K RAM expansion
393
+ # URL: https://en.wikipedia.org/wiki/VIC-20
394
+ # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/prg-vic20-8k.trid.xml
395
+ # From: Joerg Jenderek
396
+ # Note: Basic v2.0 with Basic v4.0 extension (VIC20); there exist VIC-20 variants with different start addresses
397
+ # start adress 1201h
398
+ 0 leshort 0x1201
399
+ # if first token is not SYS this implies BASIC program
400
+ >6 ubyte !0x9e
401
+ >>0 use vic-prg
402
+ # if first token is SYS this implies binary executable
403
+ >6 ubyte =0x9e
404
+ >>0 use vic-exe
405
+ # display information about Commodore VIC-20 BASIC+8K program (memory address, line number, token)
406
+ 0 name vic-prg
407
+ >0 uleshort x Commodore VIC-20 +8K BASIC program
408
+ !:mime application/x-commodore-basic
409
+ !:ext prg
410
+ # start address like: 1201h
411
+ >0 uleshort !0x1201 \b, start address %#4.4x
412
+ # 1st BASIC fragment
413
+ >2 use basic-line
414
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
415
+ >(2.s-0x1200) ubyte x
416
+ >>&-1 ubyte !0 \b, no EOL=%#x
417
+ # 2nd BASIC fragment
418
+ >>&0 use basic-line
419
+ # Zero-byte marking the end of the BASIC line
420
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
421
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
422
+ >>-2 ubeshort x \b%4.4x
423
+ # display information about Commodore VIC-20 +8K program (memory address, line number, token)
424
+ 0 name vic-exe
425
+ >0 uleshort x Commodore VIC-20 +8K program
426
+ !:mime application/x-commodore-exec
427
+ !:ext prg/
428
+ # start address like: 1201h
429
+ >0 uleshort !0x1201 \b, start address %#4.4x
430
+ # 1st BASIC fragment
431
+ >2 use basic-line
432
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
433
+ >(2.s-0x0400) ubyte x
434
+ >>&-1 ubyte !0 \b, no EOL=%#x
435
+ # no valid 2nd BASIC fragment in excutables
436
+ #>>&0 use basic-line
437
+ # Zero-byte marking the end of the BASIC line
438
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
439
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
440
+ >>-2 ubeshort x \b%4.4x
441
+ # Summary: binary executable or Basic program for Commodore PET computers
442
+ # URL: https://en.wikipedia.org/wiki/Commodore_PET
443
+ # Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/prg-pet.trid.xml
444
+ # From: Joerg Jenderek
445
+ # start adress 0401h
446
+ 0 leshort 0x0401
447
+ !:strength +1
448
+ # GRR: line above with strength 51 (50+1) is too generic because it matches TTComp archive data, ASCII, 1K dictionary
449
+ # (strength=48=50-2) handled by ./archive and shared library (strength=50) handled by ./ibm6000
450
+ # skip TTComp archive data, ASCII, 1K dictionary ttcomp-ascii-1k.bin with "invalid high" second line offset 4162h
451
+ >2 uleshort <0x0502
452
+ # skip foo with "invalid low" second line offset
453
+ #>>2 uleshort >0x0406 OFFSET_NOT_TOO_LOW
454
+ # skip bar with "invalid end of line"
455
+ #>>>(2.s-0x0400) ubyte =0 END_OF_LINE_OK
456
+ # if first token is not SYS this implies BASIC program
457
+ >>6 ubyte !0x9e
458
+ >>>0 use pet-prg
459
+ # if first token is SYS this implies binary executable
460
+ >>6 ubyte =0x9e
461
+ >>>0 use pet-exe
462
+ # display information about Commodore PET BASIC program (memory address, line number, token)
463
+ 0 name pet-prg
464
+ >0 uleshort x Commodore PET BASIC program
465
+ !:mime application/x-commodore-basic
466
+ !:ext prg
467
+ # start address like: 0401h
468
+ >0 uleshort !0x0401 \b, start address %#4.4x
469
+ # 1st BASIC fragment
470
+ >2 use basic-line
471
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
472
+ >(2.s-0x0400) ubyte x
473
+ # 2nd BASIC fragment
474
+ >>&0 use basic-line
475
+ # zero-byte marking the end of the BASIC line
476
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
477
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
478
+ >>-2 ubeshort x \b%4.4x
479
+ # display information about Commodore PET program (memory address, line number, token)
480
+ 0 name pet-exe
481
+ >0 uleshort x Commodore PET program
482
+ !:mime application/x-commodore-exec
483
+ !:ext prg/
484
+ # start address like: 0401h
485
+ >0 uleshort !0x0401 \b, start address %#4.4x
486
+ # 1st BASIC fragment
487
+ >2 use basic-line
488
+ # jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
489
+ >(2.s-0x0400) ubyte x
490
+ >>&-1 ubyte !0 \b, no EOL=%#x
491
+ # no valid 2nd BASIC fragment in excutables
492
+ #>>&0 use basic-line
493
+ # Zero-byte marking the end of the BASIC line
494
+ >-3 ubyte !0 \b, 3 last bytes %#2.2x
495
+ # Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
496
+ >>-2 ubeshort x \b%4.4x
497
+ # display information about tokenized BASIC line (memory address, line number, Token)
498
+ 0 name basic-line
499
+ # pointer to memory address of beginning of "next" BASIC line
500
+ # greater then previous offset but maximal 100h difference
501
+ >0 uleshort x \b, offset %#4.4x
502
+ # BASIC line number with range from 0 to 65520; practice to increment numbers by some value (5, 10 or 100)
503
+ >2 uleshort x \b, line %u
504
+ # https://www.c64-wiki.com/wiki/BASIC_token
505
+ # The "high-bit" bytes from #128-#254 stood for the various BASIC commands and mathematical operators
506
+ >4 ubyte x \b, token (%#x)
507
+ # https://www.c64-wiki.com/wiki/REM
508
+ >4 string \x8f REM
509
+ # remark string like: ** SYNTHESIZER BY RICOCHET **
510
+ >>5 string >\0 %s
511
+ #>>>&1 uleshort x \b, NEXT OFFSET %#4.4x
512
+ # https://www.c64-wiki.com/wiki/PRINT
513
+ >4 string \x99 PRINT
514
+ # string like: "Hello world" "\021 \323ELF-E\330TRACTING-\332IP (64 ONLY)\016\231":\2362141
515
+ >>5 string x %s
516
+ #>>>&0 ubequad x AFTER_PRINT=%#16.16llx
517
+ # https://www.c64-wiki.com/wiki/POKE
518
+ >4 string \x97 POKE
519
+ # <Memory address>,<number>
520
+ >>5 regex \^[0-9,\040]+ %s
521
+ # https://www.c64-wiki.com/wiki/SYS 0x9e=\236
522
+ >4 string \x9e SYS
523
+ # SYS <Address> parameter is a 16-bit unsigned integer; in the range 0 - 65535
524
+ >>5 regex \^[0-9]{1,5} %s
525
+ # maybe followed by spaces, "control-characters" or colon (:) followed by next commnds or in victracker.prg
526
+ # (\302(43)\252256\254\302(44)\25236) /T.L.R/
527
+ #>>5 string x SYS_STRING="%s"
528
+ # https://www.c64-wiki.com/wiki/GOSUB
529
+ >4 string \x8d GOSUB
530
+ # <line>
531
+ >>5 string >\0 %s