Difference between revisions of "Preferences.dat file"

From AMule Project FAQ
Jump to: navigation, search
 
Line 11: Line 11:
 
The file format is as follows:
 
The file format is as follows:
  
'''VersionUserhash'''
+
'''VersionUserhashLengthFlagsShowcmdMaxpositionxMaxpositionyMinpositionxMinpositionyNormalpositionleftNormalpositiontopNormalpositionrightNormalpositionbottom'''
  
As you can see, both are stored without any separator character. This is done like this because the version number has a static size of exactly two chars.
+
As you can see, all the fields are stored without any separator character. This is done like this all the fields have a specific size:
 +
*''Version'': 1 byte
 +
*''Userhash'': 2 bytes
 +
*''Length'': 4 bytes
 +
*''Flags'': 4 bytes
 +
*''Showcmd'': 4 bytes
 +
*''Maxpositionx'': 4 bytes
 +
*''Maxpositiony'': 4 bytes
 +
*''Minpositionx'': 4 bytes
 +
*''Minpositiony'': 4 bytes
 +
*''Normalpositionleft'': 4 bytes
 +
*''Normalpositiontop'': 4 bytes
 +
*''Normalpositionright'': 4 bytes
 +
*''Normalpositionbottom'': 4 bytes
  
 
Once this data is put together, it is stored in little-endian.
 
Once this data is put together, it is stored in little-endian.
Line 21: Line 34:
 
The following is a hex dump of an hypothetic ''preferences-dat'' file:
 
The following is a hex dump of an hypothetic ''preferences-dat'' file:
  
''a3143e6f12dd445b12a0c3c6f7ca5b2d''
+
''a3143e6f12dd445b12a0c3c6f7ca5b2d00000000000000000000000000000000000000000000000000000000''
  
 
In the above example, the following data can be seen:
 
In the above example, the following data can be seen:
Line 27: Line 40:
 
*Configuration file version: ''20'' (In hex: ''0x14'')
 
*Configuration file version: ''20'' (In hex: ''0x14'')
 
*Userhash: ''A36F3EDD125B44A012C6C3CAF72D5B''
 
*Userhash: ''A36F3EDD125B44A012C6C3CAF72D5B''
 +
*Window position and size: ---
  
 
== Extra ==
 
== Extra ==
  
Version 20 format allows also to store the main window placement of the app right after the userhash, but [[aMule]] doesn't use it.
+
[[aMule]] ignores the main window position, main window size, showcmd, flags and length fields in this file. That's the reason why this fields aren't specified in this article.

Revision as of 08:19, 30 November 2004

Description

This file used to store eMule's configuration in it's earlier versions. Nowadays, it only stores the userhash and the configuration file version.

Data

The current configuration file version is 20 (in hex: 0x14).

Format

The file format is as follows:

VersionUserhashLengthFlagsShowcmdMaxpositionxMaxpositionyMinpositionxMinpositionyNormalpositionleftNormalpositiontopNormalpositionrightNormalpositionbottom

As you can see, all the fields are stored without any separator character. This is done like this all the fields have a specific size:

  • Version: 1 byte
  • Userhash: 2 bytes
  • Length: 4 bytes
  • Flags: 4 bytes
  • Showcmd: 4 bytes
  • Maxpositionx: 4 bytes
  • Maxpositiony: 4 bytes
  • Minpositionx: 4 bytes
  • Minpositiony: 4 bytes
  • Normalpositionleft: 4 bytes
  • Normalpositiontop: 4 bytes
  • Normalpositionright: 4 bytes
  • Normalpositionbottom: 4 bytes

Once this data is put together, it is stored in little-endian.

Example

The following is a hex dump of an hypothetic preferences-dat file:

a3143e6f12dd445b12a0c3c6f7ca5b2d00000000000000000000000000000000000000000000000000000000

In the above example, the following data can be seen:

  • Configuration file version: 20 (In hex: 0x14)
  • Userhash: A36F3EDD125B44A012C6C3CAF72D5B
  • Window position and size: ---

Extra

aMule ignores the main window position, main window size, showcmd, flags and length fields in this file. That's the reason why this fields aren't specified in this article.