Greetings [re]bootlanders!
I'm looking for some help in figuring out how to create an accountpicture-ms file. Apparently M$ decided that it was too much trouble using standard image formats and decided to create a new propitiatory format for storing...you guessed it. JPEG images.
Background:
Prior to Win8 M$ used standard .jpg or bmp files for the user account picture (start menu, login pic, etc.). Sometime during Win8 they switched to an undocumented .accountpicture-ms file. When you choose an account picture via the "immersive settings app" aka "Settings" the image (or webcam snap) is converted to a .jpg then to .accountpicture-ms and stored in
C:\Users\<UserName>\AppData\Roaming\Microsoft\Windows\AccountPictures
The Problem:
Some applications such as StartIsBack switched to mimic Win10 behavior and only read .accountpicture-ms files for the start menu user pic. Providing an filebox to select a user picture via the script interface is no longer easy, as the user would have to pick only an .accountpicture-ms file, that they can't create without changing their user account picture in windows, copying the file somewhere, then selecting it. good luck and have fun answering the question a zillion times why the account picture won't show up in PE cuz the user always never reads the instructions.
I would prefer to provide a more elegant solution.
- let the user choose any picture type (within reason)
- I'll transparently resize and convert it to the required format
What I know:
The file format is undocumented, though there are a few open source applications that claim to "extract" the binary images from the file. Really they can't read the file format, they just do a binary search for the JPG header/trailer and extract the bytestream and save it as a jpg file.
from what I can tell the file consists of:
<Unknown Header> <Binary JPG Image 96x96> <Unknown Header> <Binary JPG Image 448x448>
The header is the unknown here. if we can re-create the header (which is different for each image) we can in theory recreate the file format, as the rest is just resizing the provided image file and including the resulting binary
What I have been able to determine so far about the header
- The Unknown Header is a fixed size.
- There is a UTF16LE string, which seems to be fixed as "prop4294967295"
- variable bytes in the header are always at fixed offset and under 4 bytes
- the settings app that creates the accountpicture-ms file is calling out to C:\Windows\System32\SettingsHandlers_nt.dll there are a number of functions in the SystemSettings::DataModel::CAccountPicturePicker and SystemSettings::DataModel::CAccountPictureSetting namespace that appear to deal with the account picture. Its all written in the metro/UWP framework though so hard for me to backtrack trace api calls.
Any help with either understanding the construction of the header so we can create one manually, or figuring out how to create the file using a documented or undocumented API would be greatly appreciated!
cheers!
Homes32