pytai-hex


Namepytai-hex JSON
Version 0.2.8 PyPI version JSON
download
home_page
SummaryKaitai Struct: Visualizer and Hex Viewer GUI in Python
upload_time2024-01-26 19:37:26
maintainer
docs_urlNone
authorDvd848
requires_python>=3.8
licenseMIT
keywords pytai python kaitai gui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytai

`pytai` is a Python-based [Kaitai Struct](https://kaitai.io/) visualizer and Hex viewer. 

> Kaitai Struct is a declarative language used for describing various binary data structures laid out in files or in memory: i.e. binary file formats, network stream packet formats, etc.

Given a binary file with a supported format, `pytai` can be used to browse the structure of the file and locate its members in the Hex view.

## Install

```console
$ pip install pytai-hex
```

Alternatively, the latest stable version of `pytai.pyz` can be downloaded from the [Releases](https://github.com/Dvd848/pytai/releases) page.

## Usage

```console
$ pytai -h                 
usage: pytai [-h] [-kf FORMAT] [file]

pytai: A Python-based Kaitai Struct Visualizer and HEX Viewer

positional arguments:
  file                  Path to binary file

optional arguments:
  -h, --help            show this help message and exit
  -kf FORMAT, --kaitai-format FORMAT
                        Kaitai Format to use when parsing the file. Current formats found under "kaitai/formats" are:
                        aix_utmp, allegro_dat, andes_firmware, android_asus_bootldr, android_dto, android_img,
                        android_opengl_shaders_cache, android_super, apm_partition_table, apple_single_double, au,
                        avi, bcd, bitcoin_transaction, blender_blend, bmp, broadcom_trx, bson, btrfs_stream,
                        bytes_with_io, code_6502, compressed_resource, cpio_old_le, cramfs, creative_voice_file, dbf,
                        dex, dicom, dime_message, dns_packet, doom_wad, dos_datetime, dos_mz, ds_store, dune_2_pak,
                        edid, efivar_signature_list, elf, ethernet_frame, exif, ext2, fallout2_dat, fallout_dat,
                        ftl_dat, genmidi_op2, gettext_mo, gif, gimp_brush, glibc_utmp, gltf_binary, google_protobuf,
                        gpt_partition_table, gran_turismo_vol, gzip, hashcat_restore, hccap, hccapx, heaps_pak,
                        heroes_of_might_and_magic_agg, heroes_of_might_and_magic_bmp, icmp_packet, ico, id3v1_1,
                        id3v2_3, id3v2_4, ines, ipv4_packet, ipv6_packet, iso9660, java_class, jpeg, luks, lvm2, lzh,
                        mach_o, mac_os_resource_snd, magicavoxel_vox, mbr_partition_table, microsoft_cfb,
                        microsoft_network_monitor_v2, microsoft_pe, minecraft_nbt, monomakh_sapr_chg, mozilla_mar,
                        msgpack, nitf, ogg, openpgp_message, packet_ppi, pcap, pcf_font, pcx, pcx_dcx,
                        phar_without_stub, php_serialized_value, png, protocol_body, psx_tim, python_pickle,
                        python_pyc_27, quake_mdl, quake_pak, quicktime_mov, rar, regf, renderware_binary_stream,
                        resource_fork, riff, rtcp_payload, rtpdump, rtp_packet, ruby_marshal, saints_row_2_vpp_pc,
                        shapefile_index, shapefile_main, sqlite3, ssh_public_key, standard_midi_file, stl, sudoers_ts,
                        swf, systemd_journal, tcp_segment, tga, tls_client_hello, tr_dos_image, tsm, ttf,
                        udp_datagram, uefi_te, uimage, utf8_string, vdi, vfat, vlq_base128_be, vlq_base128_le,
                        vmware_vmdk, vp8_ivf, warcraft_2_pud, wav, websocket, windows_evt_log, windows_lnk_file,
                        windows_minidump, windows_resource_file, windows_shell_items, windows_systemtime, wmf, xwd,
                        zip, zx_spectrum_tap
```

Examples:

```console
$ pytai
$ pytai ../../image.png
$ pytai ../../image.png -kf png
$ python3 ./pytai.pyz ../../archive.zip -kf zip
$ python3 __main__.py ../../program.exe -kf dos_mz
```

## Screenshots

### Main Window

![Main Window](https://github.com/Dvd848/pytai/raw/main/docs/images/pytai.png)

### Marking Elements

![Mark Elements 1](https://github.com/Dvd848/pytai/raw/main/docs/images/mark1.png)

![Mark Elements 2](https://github.com/Dvd848/pytai/raw/main/docs/images/mark2.png)

### Metadata Members

These are members that are inferred from the binary contents (usually a user-friendly display for explicit data).

![Mark Elements 2](https://github.com/Dvd848/pytai/raw/main/docs/images/meta.png)

### Cross References

It's possible to right-click an area in the Hex output and locate its logical structure in the structure tree.

![Cross Reference](https://github.com/Dvd848/pytai/raw/main/docs/images/xref.gif)

## Similar Tools

* [Kaitai Struct: Visualizer](https://github.com/kaitai-io/kaitai_struct_visualizer): Text-based visualizer written in Ruby
* [Kaitai Web IDE](https://ide.kaitai.io/): A browser-based visualizer
* [Kaitai Struct: Visualization GUI Tool](https://github.com/kaitai-io/kaitai_struct_gui): GUI visualizer written in Java
* [Binary Ninja UI Plugin](https://github.com/Vector35/kaitai): A GUI plugin for Binary Ninja
* [Kaitai Struct VSCode](https://marketplace.visualstudio.com/items?itemName=fudgepops.kaitai-struct-vscode): Extension for [VS Code](https://code.visualstudio.com/)
* [Hobbits](https://github.com/Mahlet-Inc/hobbits): Multi-platform GUI for bit-based analysis, processing, and visualization
* [PolyFile](https://github.com/trailofbits/polyfile): A utility to identify and map the semantic structure of files

Find more tools under [Awesome Kaitai](https://github.com/kaitai-io/awesome-kaitai) or angea's '[Hex Viewers and Editors](https://twitter.com/i/events/841916822014332930)' list.

## Requirements

 * Python3.8+ with tkinter

## Formats

The supported formats were taken from the [Kaitai Struct format gallery repo](https://github.com/kaitai-io/kaitai_struct_formats) and compiled to Python using the [Kaitai Struct Compiler](http://kaitai.io/#download).

### Adding Support for New Formats

1. Create or download a format definition (`*.ksy` file) using the Kaitai Struct language
2. Install the Kaitai Struct Compiler 
3. Compile the format definition file:

    `ksc --target python --debug --import-path /path/to/imports/if/needed /path/to/format.ksy`

4. Copy the output file (`*.py`) to the `pytai/kaitai/formats` subfolder.


## Known Limitations

 * No ability to interactively edit files (not a Hex editor, just a viewer).
 * Currently no special optimizations implemented in order to handle very large files.
 * Structure offsets are based on output from Kaitai. Kaitai doesn't fully support bit-field offsets, and therefore the GUI cannot accurately mark bit-field members.

## Contributions

Contributions in the form of pull requests, comments, suggestions and issue reports are welcome! 

As a general guideline, this project attempts to minimize the amount of external dependencies which it relies on. The preference of the project is to avoid adding external dependencies except for cases which involve complex logic that can be significantly simplified using a popular package.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pytai-hex",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "pytai,python,kaitai,gui",
    "author": "Dvd848",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/2c/5b/2c94f4ab70d7bd844bb1683a378aa222ed5e3bce935d5d6d5d0117b4d89f/pytai-hex-0.2.8.tar.gz",
    "platform": null,
    "description": "# pytai\n\n`pytai` is a Python-based [Kaitai Struct](https://kaitai.io/) visualizer and Hex viewer. \n\n> Kaitai Struct is a declarative language used for describing various binary data structures laid out in files or in memory: i.e. binary file formats, network stream packet formats, etc.\n\nGiven a binary file with a supported format, `pytai` can be used to browse the structure of the file and locate its members in the Hex view.\n\n## Install\n\n```console\n$ pip install pytai-hex\n```\n\nAlternatively, the latest stable version of `pytai.pyz` can be downloaded from the [Releases](https://github.com/Dvd848/pytai/releases) page.\n\n## Usage\n\n```console\n$ pytai -h                 \nusage: pytai [-h] [-kf FORMAT] [file]\n\npytai: A Python-based Kaitai Struct Visualizer and HEX Viewer\n\npositional arguments:\n  file                  Path to binary file\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -kf FORMAT, --kaitai-format FORMAT\n                        Kaitai Format to use when parsing the file. Current formats found under \"kaitai/formats\" are:\n                        aix_utmp, allegro_dat, andes_firmware, android_asus_bootldr, android_dto, android_img,\n                        android_opengl_shaders_cache, android_super, apm_partition_table, apple_single_double, au,\n                        avi, bcd, bitcoin_transaction, blender_blend, bmp, broadcom_trx, bson, btrfs_stream,\n                        bytes_with_io, code_6502, compressed_resource, cpio_old_le, cramfs, creative_voice_file, dbf,\n                        dex, dicom, dime_message, dns_packet, doom_wad, dos_datetime, dos_mz, ds_store, dune_2_pak,\n                        edid, efivar_signature_list, elf, ethernet_frame, exif, ext2, fallout2_dat, fallout_dat,\n                        ftl_dat, genmidi_op2, gettext_mo, gif, gimp_brush, glibc_utmp, gltf_binary, google_protobuf,\n                        gpt_partition_table, gran_turismo_vol, gzip, hashcat_restore, hccap, hccapx, heaps_pak,\n                        heroes_of_might_and_magic_agg, heroes_of_might_and_magic_bmp, icmp_packet, ico, id3v1_1,\n                        id3v2_3, id3v2_4, ines, ipv4_packet, ipv6_packet, iso9660, java_class, jpeg, luks, lvm2, lzh,\n                        mach_o, mac_os_resource_snd, magicavoxel_vox, mbr_partition_table, microsoft_cfb,\n                        microsoft_network_monitor_v2, microsoft_pe, minecraft_nbt, monomakh_sapr_chg, mozilla_mar,\n                        msgpack, nitf, ogg, openpgp_message, packet_ppi, pcap, pcf_font, pcx, pcx_dcx,\n                        phar_without_stub, php_serialized_value, png, protocol_body, psx_tim, python_pickle,\n                        python_pyc_27, quake_mdl, quake_pak, quicktime_mov, rar, regf, renderware_binary_stream,\n                        resource_fork, riff, rtcp_payload, rtpdump, rtp_packet, ruby_marshal, saints_row_2_vpp_pc,\n                        shapefile_index, shapefile_main, sqlite3, ssh_public_key, standard_midi_file, stl, sudoers_ts,\n                        swf, systemd_journal, tcp_segment, tga, tls_client_hello, tr_dos_image, tsm, ttf,\n                        udp_datagram, uefi_te, uimage, utf8_string, vdi, vfat, vlq_base128_be, vlq_base128_le,\n                        vmware_vmdk, vp8_ivf, warcraft_2_pud, wav, websocket, windows_evt_log, windows_lnk_file,\n                        windows_minidump, windows_resource_file, windows_shell_items, windows_systemtime, wmf, xwd,\n                        zip, zx_spectrum_tap\n```\n\nExamples:\n\n```console\n$ pytai\n$ pytai ../../image.png\n$ pytai ../../image.png -kf png\n$ python3 ./pytai.pyz ../../archive.zip -kf zip\n$ python3 __main__.py ../../program.exe -kf dos_mz\n```\n\n## Screenshots\n\n### Main Window\n\n![Main Window](https://github.com/Dvd848/pytai/raw/main/docs/images/pytai.png)\n\n### Marking Elements\n\n![Mark Elements 1](https://github.com/Dvd848/pytai/raw/main/docs/images/mark1.png)\n\n![Mark Elements 2](https://github.com/Dvd848/pytai/raw/main/docs/images/mark2.png)\n\n### Metadata Members\n\nThese are members that are inferred from the binary contents (usually a user-friendly display for explicit data).\n\n![Mark Elements 2](https://github.com/Dvd848/pytai/raw/main/docs/images/meta.png)\n\n### Cross References\n\nIt's possible to right-click an area in the Hex output and locate its logical structure in the structure tree.\n\n![Cross Reference](https://github.com/Dvd848/pytai/raw/main/docs/images/xref.gif)\n\n## Similar Tools\n\n* [Kaitai Struct: Visualizer](https://github.com/kaitai-io/kaitai_struct_visualizer): Text-based visualizer written in Ruby\n* [Kaitai Web IDE](https://ide.kaitai.io/): A browser-based visualizer\n* [Kaitai Struct: Visualization GUI Tool](https://github.com/kaitai-io/kaitai_struct_gui): GUI visualizer written in Java\n* [Binary Ninja UI Plugin](https://github.com/Vector35/kaitai): A GUI plugin for Binary Ninja\n* [Kaitai Struct VSCode](https://marketplace.visualstudio.com/items?itemName=fudgepops.kaitai-struct-vscode): Extension for [VS Code](https://code.visualstudio.com/)\n* [Hobbits](https://github.com/Mahlet-Inc/hobbits): Multi-platform GUI for bit-based analysis, processing, and visualization\n* [PolyFile](https://github.com/trailofbits/polyfile): A utility to identify and map the semantic structure of files\n\nFind more tools under [Awesome Kaitai](https://github.com/kaitai-io/awesome-kaitai) or angea's '[Hex Viewers and Editors](https://twitter.com/i/events/841916822014332930)' list.\n\n## Requirements\n\n * Python3.8+ with tkinter\n\n## Formats\n\nThe supported formats were taken from the [Kaitai Struct format gallery repo](https://github.com/kaitai-io/kaitai_struct_formats) and compiled to Python using the [Kaitai Struct Compiler](http://kaitai.io/#download).\n\n### Adding Support for New Formats\n\n1. Create or download a format definition (`*.ksy` file) using the Kaitai Struct language\n2. Install the Kaitai Struct Compiler \n3. Compile the format definition file:\n\n    `ksc --target python --debug --import-path /path/to/imports/if/needed /path/to/format.ksy`\n\n4. Copy the output file (`*.py`) to the `pytai/kaitai/formats` subfolder.\n\n\n## Known Limitations\n\n * No ability to interactively edit files (not a Hex editor, just a viewer).\n * Currently no special optimizations implemented in order to handle very large files.\n * Structure offsets are based on output from Kaitai. Kaitai doesn't fully support bit-field offsets, and therefore the GUI cannot accurately mark bit-field members.\n\n## Contributions\n\nContributions in the form of pull requests, comments, suggestions and issue reports are welcome! \n\nAs a general guideline, this project attempts to minimize the amount of external dependencies which it relies on. The preference of the project is to avoid adding external dependencies except for cases which involve complex logic that can be significantly simplified using a popular package.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Kaitai Struct: Visualizer and Hex Viewer GUI in Python",
    "version": "0.2.8",
    "project_urls": {
        "Homepage": "https://github.com/Dvd848/pytai"
    },
    "split_keywords": [
        "pytai",
        "python",
        "kaitai",
        "gui"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f82e2065f948ad6e84b291e01e92c61b4b1387b202ff981ef997ff44f4190f18",
                "md5": "4e58b05d3065bdb6e1c082e73739581f",
                "sha256": "a79165e597fb5e40880b4d39d66cb81fbfb4f838c67fa95e5a624f2002841c4b"
            },
            "downloads": -1,
            "filename": "pytai_hex-0.2.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e58b05d3065bdb6e1c082e73739581f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1028919,
            "upload_time": "2024-01-26T19:37:24",
            "upload_time_iso_8601": "2024-01-26T19:37:24.179645Z",
            "url": "https://files.pythonhosted.org/packages/f8/2e/2065f948ad6e84b291e01e92c61b4b1387b202ff981ef997ff44f4190f18/pytai_hex-0.2.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c5b2c94f4ab70d7bd844bb1683a378aa222ed5e3bce935d5d6d5d0117b4d89f",
                "md5": "76b36a05014e9272e5eb4414722f763f",
                "sha256": "4a98a457c7d40c9e19b865ab404dca85342000c37372ab94a8c9306a6b5f0857"
            },
            "downloads": -1,
            "filename": "pytai-hex-0.2.8.tar.gz",
            "has_sig": false,
            "md5_digest": "76b36a05014e9272e5eb4414722f763f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1517935,
            "upload_time": "2024-01-26T19:37:26",
            "upload_time_iso_8601": "2024-01-26T19:37:26.785040Z",
            "url": "https://files.pythonhosted.org/packages/2c/5b/2c94f4ab70d7bd844bb1683a378aa222ed5e3bce935d5d6d5d0117b4d89f/pytai-hex-0.2.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-26 19:37:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Dvd848",
    "github_project": "pytai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pytai-hex"
}
        
Elapsed time: 0.18410s