Official eMule-Board: Preferences.dat - Official eMule-Board

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Preferences.dat

#21 User is offline   loverboy 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 218
  • Joined: 17-September 06

Posted 01 November 2009 - 04:50 PM

View Posttorpon, on 01 November 2009 - 03:46 PM, said:

User hash is 16 bytes long, whilw preferences.dat is 56 bytes long. So is clear that it stores something more than user hash.

Cheers :D+-


And in fact Nissenice already said that

View PostNissenice, on 01 November 2009 - 01:11 PM, said:

A value named PREFFILE_VERSION (which currently (v0.49c) equals 0x14), the position of eMule's window on the screen and the userhash is saved in preferences.dat each time eMule is closed.


But from an "engineering" point of view... what's the reason to mix such different things into an important file (that first of all stores your hash)?
0

#22 User is offline   Nissenice 

  • Good ol' me
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3877
  • Joined: 05-January 06

Posted 01 November 2009 - 08:50 PM

struct Preferences_Ext_Struct{
	uint8	version;
	uchar	userhash[16];
	WINDOWPLACEMENT EmuleWindowPlacement;
};
where WINDOWPLACEMENT is defined by
typedef struct tagWINDOWPLACEMENT {
    UINT  length;
    UINT  flags;
    UINT  showCmd;
    POINT ptMinPosition;
    POINT ptMaxPosition;
    RECT  rcNormalPosition;
#ifdef _MAC
    RECT  rcDevice;
#endif
} WINDOWPLACEMENT;

That's what's saved in preferences.dat. And it was much more stored in it in the past like in v0.20.

I also found this in the changelog

Quote

----------------------
- Oktober 10th, 2002-
----------------------
Unk: Fixed a bug with when you cancel multiple downloads.. (CML)
Ornis: main-preferences are now stored in an .ini -file. -> more compatibility for coming versions
Ornis: localized emule-output of messages. Thanks to various translators for translating the text itself:)

which suggest to me that in the beginning there was no preference.ini, but only the preference.dat. Then it was decided to have an .ini file. Perhaps for editable reason, but e.g. the userhash was kept in the .dat file in binary form to make it harder to change it manually. Perhaps there was an aspect of backward compatibility too.

View Postloverboy, on 01 November 2009 - 05:50 PM, said:

what's the reason to mix such different things into an important file (that first of all stores your hash)?

If you think about it, does it really matter much? Imo it doesn't, the userhash just needs to be stored somewhere. ;)

This post has been edited by Nissenice: 01 November 2009 - 08:53 PM

Posted Image
0

#23 User is offline   loverboy 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 218
  • Joined: 17-September 06

Posted 01 November 2009 - 09:13 PM

View PostNissenice, on 01 November 2009 - 09:50 PM, said:

View Postloverboy, on 01 November 2009 - 05:50 PM, said:

what's the reason to mix such different things into an important file (that first of all stores your hash)?

If you think about it, does it really matter much? Imo it doesn't, the userhash just needs to be stored somewhere. ;)


I meant that it would have been better if (like cryptkey.dat) the file where the userhash is stored should be saved once and for all, and it shouldn't be "exposed" to possible corruption while saving everytime that I close eMule :flowers:
0

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users