Difference between revisions of "Preferences.dat file"

From AMule Project FAQ
Jump to: navigation, search
(Updated to current usage.)
Line 7: Line 7:
 
== Description ==
 
== Description ==
  
This file stores the userhash and the configuration file version for your client in the [[FAQ_ed2k|ed2k network]].
+
This file used to store [[eMule]]'s configuration in it's earlier versions. Nowadays, it only stores the userhash and the configuration file version.
In old times, this file used to store [[eMule]]'s configuration.
+
  
 
== Data ==
 
== Data ==
Line 16: Line 15:
 
== Format ==
 
== Format ==
  
All the fields are stored without any separator character. This is done like this because all the fields have a specific size:
+
The file format is as follows:
*''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
+
  
The relevant fields are the following:
+
'''Version Userhash'''
*''Version'': Specifies the configuration file version (the format defined in this articles corresponds to version 20).
+
*''Userhash'': The userhash.
+
*''Length'': Length in bytes of the file not counting th Version and Userhash fields (should be 38 bytes).
+
  
Once this data is put together, it is stored in little-endian.
+
Size of each field is as follows:
 +
*''Version'': 1 byte
 +
*''Userhash'': 16 bytes, stored as a big-endian 128-bit value.
  
 
== Example ==
 
== Example ==
Line 42: Line 27:
 
The following is a hex dump of an hypothetic ''preferences.dat'' file:
 
The following is a hex dump of an hypothetic ''preferences.dat'' file:
  
''a3143e6f12dd445b12a0c3c6f7ca5b2d00230000000000000000000000000000000000000000000000000000''
+
''14 2C 16 62 17 9C 0E CE 02 45 55 A8 5A 56 6C 6F 49''
  
 
In the above example, the following data can be seen:
 
In the above example, the following data can be seen:
  
 
*Configuration file version: ''20'' (In hex: ''0x14'')
 
*Configuration file version: ''20'' (In hex: ''0x14'')
*Userhash: ''A36F3EDD125B44A012C6C3CAF72D5B23''
+
*Userhash: ''2C1662179C0ECE024555A85A566C6F49''
*Other fields: Set to zero (''0'')
+
 
+
== Extra ==
+
 
+
[[aMule]] ignores the ''main window position'', ''main window size'', ''length'', ''flags'' and ''showcmd'' fields in this file. That's the reason why this fields aren't explained in this article.
+
 
+
All this ignored fields are set to zero by [[aMule]]. Even if they were set to some other value, [[aMule]] will never read those values. Instead, it uses the preferences set in ''~/.eMule''
+

Revision as of 10:46, 25 September 2008

File

Name: preferences.dat

Location: ~/.aMule/

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:

Version Userhash

Size of each field is as follows:

  • Version: 1 byte
  • Userhash: 16 bytes, stored as a big-endian 128-bit value.

Example

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

14 2C 16 62 17 9C 0E CE 02 45 55 A8 5A 56 6C 6F 49

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

  • Configuration file version: 20 (In hex: 0x14)
  • Userhash: 2C1662179C0ECE024555A85A566C6F49