Extracting icons from executable files (.exe, .dll on Windows; .app bundles on macOS; ELF binaries on Linux) can be achieved through various methods depending on the operating system.
Windows
On Windows, icons are embedded as resources within PE (Portable Executable) files like .exe
or .dll
files.
- Third-Party Tools: This is often the most straightforward approach.
- Resource Hacker: A popular freeware utility to view, modify, rename, add, delete, and extract resources. Navigate to the Icon or Icon Group section to save icons.
- BeCyIconGrabber: A lightweight tool specifically designed to scan files and folders for icons and cursors, allowing batch extraction in various formats (ICO, PNG, BMP) and sizes.
- IcoFX: While primarily an icon editor, it can open executable files and extract icons for editing or saving.
- Programmatic Extraction: Developers can use Windows API functions like
ExtractIconEx
(from ) to retrieve icon handles or save them to files. This requires programming knowledge (e.g., C++, C#).
macOS
Applications on macOS are typically .app
bundles, which are essentially folders. The primary application icon is usually a .icns
file.

- Finder "Get Info":
- Select the application in Finder.
- Press
Command + I
(or File > Get Info). - In the Get Info window, click on the small icon preview at the top left.
- Press
Command + C
to copy it. - Open *, press
Command + N
(File > New from Clipboard). - You can then export the icon from Preview in various formats (e.g., PNG).
- Direct Access:
- Right-click the
.app
file and select "Show Package Contents." - Navigate to the
Contents/Resources/
folder. - Look for a file with a
.icns
extension (e.g., ). This file contains multiple sizes of the icon. You can copy this file directly. Specialized tools or Preview can then be used to extract specific sizes from the.icns
file.
- Right-click the
- Command Line (
sips
): The Scriptable Image Processing System (sips
) can convert.icns
files to other formats. For example, to convert to PNG:sips -s format png /path/to/*/Contents/Resources/* --out /path/to/*
You might need to specify a pixel height/width with
--resampleHeight
or--resampleWidth
to extract a specific size before converting.
Linux
For Windows executables running under Wine or for native Linux ELF binaries, methods vary.
- Using
icoutils
(for Windows executables): Theicoutils
package provides tools likewrestool
andicotool
.wrestool
: Can extract resources from Windows PE files.Example: To list resources:
wrestool -l your_*
To extract an icon group (e.g., named "MAINICON" or by numerical index from the list):
wrestool -x -t group_icon --name=MAINICON -o * your_*
orwrestool -x -t 14 --raw -o * your_*
(where 14 is the RT_GROUP_ICON resource type).icotool
: Can then be used to list sizes within the extracted.ico
file or convert them to PNGs.Example: To list sizes:
icotool -l *
To extract a specific icon from the
.ico
file (e.g., the first one at index 0) to PNG:icotool -x -i 0 -o * *
- Native Linux Applications: Icons for native Linux applications are typically
.png
or.svg
files conforming to the * icon theme specification. They are usually found in/usr/share/icons/
or~/.local/share/icons/
, often within theme-specific subdirectories (e.g.,hicolor
) and size-specific folders (e.g.,48x48/apps
). The.desktop
file for the application (found in/usr/share/applications/
or~/.local/share/applications/
) will specify the icon name (e.g.,Icon=appname
). You can then locate this icon file based on the name and standard icon paths. - Desktop Environment Tools: Some desktop environments and file managers may allow you to right-click an application's shortcut or menu entry and save its icon or view its properties to find the icon path.