Metadata-Version: 2.4
Name: icoextract
Version: 0.3.0
Summary: Windows EXE icon extractor
Author-email: James Lu <james@overdrivenetworks.com>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pefile
Provides-Extra: thumbnailer
Requires-Dist: Pillow; extra == "thumbnailer"
Provides-Extra: win16
Requires-Dist: nefile; extra == "win16"
Provides-Extra: dev
Requires-Dist: icoextract[thumbnailer]; extra == "dev"
Requires-Dist: icoextract[win16]; extra == "dev"
Requires-Dist: pdoc; extra == "dev"
Dynamic: license-file

# icoextract

[![Build Status](https://woodpecker.overdrivenetworks.com/api/badges/5/status.svg)](https://woodpecker.overdrivenetworks.com/repos/5)
[![Packaging status](https://repology.org/badge/tiny-repos/icoextract.svg)](https://repology.org/project/icoextract/versions)

**icoextract** is an icon extractor library for Windows executables (.exe/.dll/.mun). It also includes a thumbnailer script (`exe-thumbnailer`) for Linux desktops.

This project is inspired by [extract-icon-py](https://github.com/firodj/extract-icon-py), [icoutils](https://www.nongnu.org/icoutils/), and others.

icoextract aims to be:

- Lightweight
- Portable (cross-platform)
- Fast on large files

## Installation

### Dependencies

- Python 3.10+
- [pefile](https://github.com/erocarrera/pefile)
- [Pillow](https://pillow.readthedocs.io/en/stable/) - optional, for exe-thumbnailer
- [nefile](https://github.com/npjg/nefile) - optional, for Win16 / NE EXE support

### Installing from source

You can install the project via pip: `pip3 install icoextract[thumbnailer]`

On Linux, you can activate the thumbnailer by copying [`exe-thumbnailer.thumbnailer`](/exe-thumbnailer.thumbnailer) into the thumbnailers directory:

- `/usr/local/share/thumbnailers/` if you installed `icoextract` globally
- `~/.local/share/thumbnailers` if you installed `icoextract` for your user only

The thumbnailer should work with any file manager that implements the [Freedesktop Thumbnails Standard](https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html): this includes Nautilus, Caja, Nemo, Thunar (when Tumbler is installed), and PCManFM. KDE / Dolphin uses a different architecture and is *not* supported here.

### Distribution packages

You can install icoextract from any of these distribution repositories:

[![Packaging status](https://repology.org/badge/vertical-allrepos/icoextract.svg?columns=5)](https://repology.org/project/icoextract/versions)


## Usage

icoextract ships `icoextract` and `icolist` scripts to extract and list icon resources inside a file.

**Note**: recent versions of Windows (Windows 10 1903+) have moved icons from system libraries (`shell32.dll`, etc.) into a new [`C:\Windows\SystemResources`](https://superuser.com/questions/1480268/) folder. icoextract can extract these `.mun` files natively, but the `.dll`s themselves no longer contain icons.

For API docs, see https://projects.jlu5.com/icoextract.html

```
usage: icoextract [-h] [-V] [-n NUM] [-i ID] [-v] input output

Windows executable icon extractor.

positional arguments:
  input          input filename (.exe/.dll/.mun)
  output         output filename (.ico)

options:
  -h, --help     show this help message and exit
  -V, --version  show program's version number and exit
  -n, --num NUM  index of icon to extract
  -i, --id ID    resource ID of icon to extract
  -v, --verbose  enables debug logging
```

```
usage: icolist [-h] [-V] [-v] input

Lists group icons present in a program.

positional arguments:
  input          input filename

options:
  -h, --help     show this help message and exit
  -V, --version  show program's version number and exit
  -v, --verbose  enables debug logging
```
