Skip to main content

Carve Exe is a simple best effort tool to carve PE and ELF files from arbitrary, binary files (e.g. memory dumps and executables).

Project description

Carve Exe

Carve Exe is a simple best effort tool to carve PE and ELF files from arbitrary, binary files (e.g. memory dumps and executables).

Carve Exe is:

  • Simple: it's only a couple of lines of Python.
  • Modular: it's easy to add a new file format.
  • Best effort: it tries to cover the most common cases, but it is likely possible to craft a valid PE/ELF file that will not be carved correctly by this tool, as the PE and ELF formats are complex.
  • Smart about loading files: it is possible to carve 100GB files, without loading the whole file into memory, as the files are parsed byte-per-byte.

Carve Exe depends on pefile and pyelftools to do all the heavy lifting of parsing the actual file formats.

It should be noted that executables with wrong values in their headers (e.g. wrong section sizes), will produce wrong output. Garbage in, garbage out.

Installation

$ pip install poetry
$ git clone git@github.com:joren485/carve-exe.git
$ cd exe-carver
$ poetry install

Usage

Help

$ poetry shell
$ carve-exe --help
                                                                                                                                                                                                                  
 Usage: carve-exe [OPTIONS]                                                                                                                                                                                       
                                                                                                                                                                                                                  
 Carve PE files from binary blob.                                                                                                                                                                                 
                                                                                                                                                                                                                  
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --input               -i      PATH       Input file or directory [default: None] [required]                                                                                                                 │
│ *  --output              -o      DIRECTORY  Output directory [default: None] [required]                                                                                                                        │
│    --install-completion                     Install completion for the current shell.                                                                                                                          │
│    --show-completion                        Show completion for the current shell, to copy it or customize the installation.                                                                                   │
│    --help                                   Show this message and exit.                                                                                                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Example

$ poetry shell
$ carve-exe --input test/input.bin --output /tmp/   # Carve test/input.bin and write output to /tmp/
$ carve-exe --input test/ --output /tmp/            # Carve all files in test/ and write output to /tmp/

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

carve_exe-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

carve_exe-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file carve_exe-1.0.1.tar.gz.

File metadata

  • Download URL: carve_exe-1.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.7-arch1-1

File hashes

Hashes for carve_exe-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2fa3081512ccbc0748386219b78df76eb28ed391214854936cea4d0eda7c05ca
MD5 326eafc89800ab7f4173c52da803ed75
BLAKE2b-256 55759f1e5bcf9d8b2781ba869945e5cca0f8216ee411994f9c8b8bcec0197cc2

See more details on using hashes here.

File details

Details for the file carve_exe-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: carve_exe-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.7-arch1-1

File hashes

Hashes for carve_exe-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1aa6549f60c9b74958314b1ab336369bdb5dfe1fdab216cc85fcbc657de32cc
MD5 20d7bb6f62237982108b7aee38d76965
BLAKE2b-256 90c74060089c41052403a9267eb4379e1ba4d701a3a45b6acb4b0c5e5040169f

See more details on using hashes here.

Supported by

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