Jump to content











Photo
- - - - -

Account Picture Challange


  • Please log in to reply
2 replies to this topic

#1 homes32

homes32

    Gold Member

  • .script developer
  • 1034 posts
  • Location:Minnesota
  •  
    United States

Posted 3 weeks ago

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.  :frusty:


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.

  1.     let the user choose any picture type (within reason)
  2.     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
 



#2 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2944 posts
  • Location:Nantes - France
  •  
    France

Posted 3 weeks ago

Hi Homes32,

 

You probably tried already but what if you just stuff in a header you got from a previous file?

Does this meta data matters or will the new file with a random but valid header will do?

 

Regards,

Erwan


  • Brito likes this

#3 homes32

homes32

    Gold Member

  • .script developer
  • 1034 posts
  • Location:Minnesota
  •  
    United States

Posted 3 weeks ago

Hi Homes32,

 

You probably tried already but what if you just stuff in a header you got from a previous file?

Does this meta data matters or will the new file with a random but valid header will do?

 

Regards,

Erwan

Sorry, should have mentioned I tried that. It invalidates the file if you swap headers. Perhaps there is some sort of file size property or checksum.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users