Portrait Icon Extraction - HeroesToolChest/HeroesDataParser GitHub Wiki

Overview

Portrait icons are found not in the game data. They are dynamically downloaded when Heroes of the Storm is running. The default paths where they are download to are:

Windows: C:\ProgramData\Blizzard Entertainment\Battle.net\Cache
macOS: /Users/<username>/Blizzard/Battle.net/Cache

The files are going to be two directory structures down which are based on the file name. All file names are a SHA-256 hash of the files themselves. The first directory is the first two characters and the next directory is the next two characters.

Image files are the .wafl files. These are simply a renamed file extension and not actually the type of file. For the portrait texture sheet files, they are .dds.

To obtain the portrait icons from the texture sheets, they must be manual extracted. To assist in extracting the portrait icons from the .wafl files, there are several portrait commands available.

Getting Started

Two things are needed, first is the texture sheet files in the battle.net cache and second is the reward portrait data files. The reward portrait data files can be obtained from the option --extract-data rewardportrait.

In order to extract the portrait icons from the texture sheets it will involve manually matching up the texture sheets with the proper texture sheet image name found in the reward portrait data.

Before beginning, to ensure that the latest and correct texture sheets are being found either rename the cache folder or completely delete it. Then start Heroes of the Storm and wait for it to download all files (this is in the game not the Battle.net launcher). To confirm all files are downloaded go to the portrait collection.

To get a jump start on the portrait extraction, start with the Auto-Extract section, otherwise go to Manual Extraction.

Auto-Extract

The portrait-auto-extract command works by reading from the portrait-auto-extract.xml file (or through another file set by the --xml-config option). This file contains a collection of the portrait texture sheet image names along with the original texture sheet file name (the hash name). The Zero element is the name of the first portrait icon in the texture sheet (slot 0). It's used to help confirm the correct texture sheet.

Before running the command keep in mind the following!

  • The hash file names are from the US region, they might be different for other regions.

Run the command and wait for it to finish.

Depending on the output messages at the end, it may or may not have extracted all the images from the texture sheets. If there is a message in yellow that means manual extraction is required for the rest.

Manual Extraction

Depending on whether the auto-extract was performed successfully or not, this step will take little to a long time to complete.

First run the portrait-cache command. This will copy the files from the battle.net cache to the output directory as well as changing the extension to the correct image type.

The directory output will be known as the texture sheet directory. The original files in the Battle.net cache will not be used from this point on.

Now the extraction can begin.

Run the portrait-extract command. Only provide the first two arguments and be sure to include the --prompt option. It will prompt for the image file, which is found in the reward portrait data (e.g ui_heroes_portraits_sheet31.png).

A list of all the image file names associated with that image file will be displayed in order of the icon slot.

It will then prompt for the original texture sheet name, which is a file name in the texture sheet directory.

To find the original texture sheet name, it will manually require matching up the displayed image file names to the associated texture sheet. The displayed list of image file names will help.

If successful, the portrait icons will be extracted.

Tips

To help speed up the manual extraction of matching up the image file names to the texture sheet, the --delete-file option for the portrait-auto-extract and portrait-extract commands will delete the texture sheet image file after the extraction process.

For the auto extraction process, run the portrait-cache command first and set the portrait-auto-extract cache-directory-path argument to the portrait cache directory. With the --delete-file option set, the auto extractor will delete the texture sheet after being used.

⚠️ **GitHub.com Fallback** ⚠️