Skip to main content

Creates the hexdump of a selected file

Project description

Description

  • Prints the hexdump of a selected file.
  • Filters zero and non-ASCII values.
  • Reads x bytes starting from an offset

Installation

pip install hexdumper

Usage

From command line:

python -m hexdumper [-h] --path PATH [--outfile OUTFILE] [--offset OFFSET] [--noOfBytes NOOFBYTES] [--filterZeroRows] [--filterNonAsciiRows] [--noHash]

Option Short Type Default Description
--path -p String - Path to file which shall be dumped
--outfile -o String result.txt Path to result file
--offset -s Int 0 No of bytes to offset before read
--noOfBytes -b Int - Starting at offset and read the given number of bytes
--noHash -n Flag False Disable hashing e.g. for big files
--filterZeroRows -f Flag False Filters zero rows in hex dump
--filterNonAsciiRows -e Flag False Filters non ascii rows in hex dump

Example

py -m hexdumper -p .\data\testfile

result.txt:

         Datetime: 01/01/1970 10:11:12

Investigated File: result.txt
         MD5 Hash: 57f34e4aacacbd209eaf6990f16d0289
      SHA256 Hash: 162eb0e1083e50dd7832729b6b96cda7ba9ca76d21c8b46f706b204d3d8b8c0f

          Offset   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F    ASCII           
----------------   -----------------------------------------------    ---------------- 
0000000000000000   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 31 0A    I am testline 1. 
0000000000000010   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
0000000000000020   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 32 0A    I am testline 2. 
0000000000000030   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 33 33    I am testline 33 
0000000000000040   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 34 0A    I am testline 4. 
0000000000000050   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
0000000000000060   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
0000000000000070   BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB    ................ 
0000000000000080   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
0000000000000090   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
00000000000000A0   CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC    ................ 
00000000000000B0   DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD    ................ 
00000000000000C0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
00000000000000D0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
00000000000000E0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
00000000000000F0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................ 
0000000000000100   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

py -m hexdumper -p .\data\testfile --offset 0 --noOfBytes 120 --filterZeroRows

result.txt:

         Datetime: 08/10/2022 23:13:12

Investigated File: result.txt
         MD5 Hash: 57f34e4aacacbd209eaf6990f16d0289
      SHA256 Hash: 162eb0e1083e50dd7832729b6b96cda7ba9ca76d21c8b46f706b204d3d8b8c0f

           Offset: 0
     No. of bytes: 120
         MD5 Hash: 83ad2f110819e0d358a4846352167740
      SHA256 Hash: e00caf06e9b512bd5787bcd08a1717f0bee668d7856d56cf244cdc1a4c5546c8

          Offset   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F    ASCII           
----------------   -----------------------------------------------    ---------------- 
0000000000000000   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 31 0A    I am testline 1. 

--------------->   Skipped 1 zero rows  

0000000000000020   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 32 0A    I am testline 2. 
0000000000000030   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 33 33    I am testline 33 
0000000000000040   49 20 61 6D 20 74 65 73 74 6C 69 6E 65 20 34 0A    I am testline 4. 

--------------->   Skipped 2 zero rows  

0000000000000070   BB BB BB BB BB BB BB BB                            ........    

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexdumper-2.0.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hexdumper-2.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file hexdumper-2.0.2.tar.gz.

File metadata

  • Download URL: hexdumper-2.0.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for hexdumper-2.0.2.tar.gz
Algorithm Hash digest
SHA256 48b7df4cc6c1dbaa5a15c0ca1188e27405332b579466d629fdf9d069328b196f
MD5 4568466273d27df6d40ddf2e5ec014d7
BLAKE2b-256 3c8756aea3ca14496f6c2cd64cd2aa4b9856222b7f72e423441b4d01a93c2cdb

See more details on using hashes here.

File details

Details for the file hexdumper-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: hexdumper-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for hexdumper-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc05e2e18bdb096cc4ceafb73e8558798f08298e6b1f8a21028ee8a6d723ac7c
MD5 02117a5e02fb7cb9a1c93384eeb9d6c7
BLAKE2b-256 3fec17bed77a0d6b0d3a7e9e21e37096fc7ac0aa0b087b3bf477ce88918da534

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page