Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pe_tree

> 编程语言
Open source

Python module for viewing Portable Executable (PE) files in a tree-view using pefile and PyQt5. Can also be used with IDA Pro and Rekall to dump in-memory PE fi

1.3K stars0 likes0 views
WebsiteGitHub

About

Python module for viewing Portable Executable (PE) files in a tree-view using pefile and PyQt5. Can also be used with IDA Pro and Rekall to dump in-memory PE fi

PE Tree

PE Tree is a Python module for viewing Portable Executable (PE) files in a tree-view using pefile and PyQt5. It can also be used with IDA Pro, Ghidra, Volatility, Rekall and minidump to view and dump in-memory PE files, as well as perform import table reconstruction.

Table of contents

  1. Features
  2. Application
    • Requirements
    • Features
    • Installation
      • Windows
      • Mac/Linux
      • For developers
    • Usage
    • Dark-mode
  3. IDAPython
    • Requirements
    • Features
    • Installation
      • Using setuptools
      • Install manually
      • For developers
    • Usage
    • Example
      • Dumping in-memory PE files
  4. Rekall
    • Requirements
    • Features
    • Installation
    • Usage
  5. Volatility
    • Requirements
    • Features
    • Installation
    • Usage
  6. Ghidra
    • Requirements
    • Features
    • Installation
    • Usage
  7. Minidump
    • Requirements
    • Features
    • Installation
    • Usage
  8. Configuration
    • Overview
    • Options
    • Location
    • 3rd party data sharing
  9. Troubleshooting
  10. Contributing
    • Developer documentation
  11. License

Features

  • Standalone application with plugins for:
    • IDA Pro
    • Ghidra
    • Volatility
    • Rekall
    • Minidumps
    • Carving
  • Supports Windows, Linux and Mac
  • Parsing PE files and memory images from:
    • File-system
    • ZIP archives (including password protected)
    • Windows memory dumps (raw, EWF, vmem etc.)
    • Live Windows memory (using rekall)
    • Windows Minidump
    • IDA Pro database
    • Ghidra database
    • Binary file carving
  • Rainbow PE map:
    • Provides a high-level overview of PE structures, size and file location
    • Allows for fast visual overview and comparison of PE samples
  • Displays the following PE headers in a tree-view:
    • MZ header
    • DOS stub
    • Rich headers
    • NT/File/Optional headers
    • Data directories
    • Sections
    • Imports
    • Exports
    • Debug information
    • Load config
    • TLS
    • Resources
    • Version information
    • Certificates
    • Overlay
  • Extract and save data from:
    • DOS stub
    • Sections
    • Resources
    • Certificates
    • Overlay
    • Export to CyberChef for further manipulation
  • Perform VirusTotal searches of:
    • File hashes
    • PDB path
    • Timestamps
    • Section hash/name
    • Import hash/name
    • Export name
    • Resource hash
    • Certificate serial
  • Dump loaded PE images from memory:
    • Fix up section pointers and sizes
    • Fix up PE headers:
      • Remove unnecessary data directory pointers
      • Recalculate PE checksum
      • Update entry-point
    • Reconstruct import address and directory tables (IAT/IDT) using several methods:
      1. Use existing IAT/IDT
      2. Rebuild IDT from existing IAT
      3. Rebuild IAT and IDT from disassembly (using IDA Pro, Ghidra or capstone)

Application

The PE Tree standalone application finds portable executables in files, folders and ZIP archives.

Requirements

  • Python 3.5+

Features

  • Scan files and folders for PE files
  • Extract PE files from ZIP archives (including password protected with infected)
  • Carve PE files from binary files
  • Double-click VA/RVA to disassemble with capstone
  • Hex-dump data

Installation

Using pip (recommended)

Install directly from GitHub using a fresh virtual environment and pip:

Windows
> virtualenv env
> env\Scripts\activate
> pip install --upgrade pip
> pip install git+https://github.com/blackberry/pe_tree.git
Mac/Linux
$ python3 -m venv env
$ source ./env/bin/activate
$ pip install --upgrade pip
$ pip install git+https://github.com/blackberry/pe_tree.git

For developers

Git clone the repository and setup for development:

Windows
> git clone https://github.com/blackberry/pe_tree.git
> cd pe_tree
> virtualenv env
> env\Scripts\activate
> pip install -e .
Mac/Linux
$ git clone https://github.com/blackberry/pe_tree.git
$ cd pe_tree
$ python3 -m venv env
$ source ./env/bin/activate
$ pip install -e .

Usage

Run PE Tree and scan for portable executables in files, folders and ZIP archives:

$ pe-tree -h
usage: pe-tree [-h] [filenames [filenames ...]]

PE-Tree

positional arguments:
  filenames   Path(s) to file/folder/zip

optional arguments:
  -h, --help  show this help message and exit

Run PE Tree and attempt to carve portable executable files from a binary file:

$ pe-tree-carve -h
usage: pe-tree-carve [-h] filename

PE-Tree (Carve)

positional arguments:
  filename    Path to file to carve

optional arguments:
  -h, --help  show this help message and exit

Dark-mode

Dark-mode can be enabled by installing QDarkStyle:

$ pip install qdarkstyle

IDAPython

The PE Tree IDAPython plugin finds portable executables in IDA databases.

Requirements

  • IDA Pro 7.0+ with Python 2.7
  • IDA Pro 7.4+ with Python 2.7 or 3.5+

Features

  • Easy navigation of PE file structures
  • Double-click on a memory address in PE Tree to view in IDA-view or hex-view
  • Search an IDB for in-memory PE images and;
    • Reconstruct imports (IAT + IDT)
    • Dump reconstructed PE files
    • Automatically comment PE file structures in IDB
    • Automatically label IAT offsets in IDB

Installation

To install and run as an IDAPython plugin you can either use setuptools or install manually.

Using setuptools

  1. Download pe_tree and install for the global Python interpreter used by IDA:

    $ git clone https://github.com/blackberry/pe_tree.git
    $ cd pe_tree
    $ python setup.py develop --ida
    
  2. Copy pe_tree_ida.py to your IDA plugins folder

Install manually

  1. Download pe_tree and install requirements for the global Python interpreter used by IDA:

    $ git clone https://github.com/blackberry/pe_tree.git
    $ cd pe_tree
    $ pip install -r requirements.txt
    
  2. Copy pe_tree_ida.py and the contents of ./pe_tree/ to your IDA plugins folder

For developers

To forgo installing as a plugin, and simply run as a script under IDA, first install the pe_tree package requirements for the global Python installation:

$ pip install -r requirements.txt

Then run pe_tree_ida.py under IDA:

File -> Script file... -> pe_tree_ida.py -> Open

IDA plugins folder

OS Plugins folder
Windows %ProgramFiles%\IDA Pro 7.X\plugins
Linux /opt/ida-7.X/plugins
Mac ~/.idapro/plugins

Usage

  1. Launch IDA Pro and disassemble a PE file (always select Manual Load and Load Resources for best results!)

  2. Load the PE Tree plugin:

    Edit -> Plugins -> PE Tree

Example

Dumping in-memory PE files

Below are the basic steps to dump a packed PE file (for example MPRESS or UPX) and reconstruct imports (assuming the image base/entry-point is fairly standard):

  1. Launch IDA Pro and disassemble an MPRESS or UPX packed PE file (select Manual Load and Load Resources)

  2. Select a debugger (Windows or Bochs) and run until OEP (usually 0x00401000, but not always!)

  3. At this point you could take a memory snapshot (saving all segments) and save the IDB for later

  4. Ensure IDA has found all code:

    Options -> General -> Analysis -> Reanalyze program

  5. Open the PE Tree IDAPython plugin, right-click in the right-hand pane and select:

    Add PE -> Search IDB

    This will scan the IDB for MZ/PE headers and display any modules it finds.

  6. Right-click on HEADER-0x00400000 (or appropriate module name) and select Dump...

  7. Specify the AddressOfEntryPoint (typically 0x1000, but again, not always!)

  8. Ensure Rebuild IDT/IAT is selected

  9. Dump!

A new executable will be created using the unpacked section data obtained from memory/IDB, whilst a new section named .pe_tree and containing the rebuilt IAT, hint name table and IDT will be appended to the PE file (much like an .idata section). If the entry-point memory segment has been marked writable during execution (via VirtualProtect for example) then the entry-point section's characteristics will also be marked writable. Finally, the BASERELOC, BOUND_IMPORT and SECURITY data directories are marked null, and the OPTIONAL_HEADER checksum is recalculated (if specified).

Using the above approach it is possible to dump many in-memory PE files that have either been unpacked, injected, reflectively loaded or hollowed etc.

Rekall

The PE Tree Rekall plugin finds portable executables in Windows memory dumps.

Requirements

  • Python 3+

Features

  • Operates against a Windows memory dump or a live system
  • View, dump and reconstruct PE modules from;
    • Active processes and DLLs
    • Loaded kernel-mode drivers

Installation

  1. Install Rekall from GitHub.
  2. Install PE Tree standalone application (see Installation) under the same virtual environment.

Usage

Run Rekall and view active processes, DLLs and drivers on a live system:

$ rekall --live Memory
[1] Live (Memory) 00:00:00> run -i pe_tree_rekall.py

Alternatively, run Rekall/PE Tree against an existing memory dump:

$rekall -f memory.vmem
[1] memory.vmem 00:00:00> run -i pe_tree_rekall.py

Volatility

The PE Tree Volatility plugin finds portable executables in Windows memory dumps.

Requirements

  • Python 3.5+

Features

  • Operates against a Windows memory dump
  • View, dump and reconstruct PE modules from;
    • Active processes and DLLs
    • Loaded kernel-mode drivers

Installation

  1. Install Volatility3 from GitHub.
  2. Install PE Tree standalone application (see Installation) under the same virtual environment.

Usage

$ pe-tree-vol -h
usage: pe-tree-vol [-h] filename

PE-Tree (Volatility)

positional arguments:
  filename    Path to memory dump

optional arguments:
  -h, --help  show this help message and exit

Ghidra

The PE Tree Ghidra plugin finds portable executables in Ghidra databases.

Requirements

  • Python 3.5+
  • Ghidra Bridge

Features

  • Easy navigat

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言