Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode entry IDs? #1

Open
klonuo opened this issue Sep 6, 2012 · 7 comments
Open

Decode entry IDs? #1

klonuo opened this issue Sep 6, 2012 · 7 comments
Labels

Comments

@klonuo
Copy link

klonuo commented Sep 6, 2012

Can you decode hashes from playback statistics component (entry IDs from exported statistics XML file)?

I tried some time ago, suspecting that it's halved (or some 16 digits extract) MD5 hex digest from 5 fields that playback statistics component uses to identify track, but perhaps it's not anything like that, as I tried various combination without success

@tfriedel
Copy link
Owner

tfriedel commented Sep 6, 2012

No, I don't use this component. I just had a look, but you can only guess how he calculates these hashes. Have you tried asking the author?

@klonuo
Copy link
Author

klonuo commented Sep 7, 2012

Thanks Thomas for your reply

Yes, couple of times this question was asked in playback statistics thread on HA, and ignored any times was asked. It's obvious expected feature when import/export is provided, but stubbornly ignored.
I can export playback statistics data to XML/CSV... with text tools in any scheme, but then can't import it back because of these hash IDs

Brute force rapid ID guessing did not give me clue. I suspected MD5 because of availability and common use. I looped 5 fields used to determine unique track, with various combinations of separators and arrangements, and produced 32 digit hex digests w/o success in determining 16 digit hash.
He could have used anything to salt it, even if he uses this algorithm

There is a binary file that stores all statistics data in profile folder, with some UUID name that's same for any installation %APPDATA%\foobar2000\index-data\C653739F-14B3-4EF2-819B-A3E2883230AE. Maybe it has similar format to formats you deduce with your code.
(Same UUID is also used as Mapping attribute in root node of exported XML file)

Cheers

@tfriedel
Copy link
Owner

tfriedel commented Sep 7, 2012

ok I had a look at that data file. there are no strings in there. it just contains records where each is 60 bytes long.
the first 4 bytes is an integer and always seems to be 40. I don't know what the next bytes mean, but the playback statistics, ratings etc, must be in there. byte 48..55 is the filetime (gregorian calender, 100 nanosecond units since 1601 or something, standard windows FILETIME). I assume the filetime is the date of the last access. the next 4 byte is an integer which always seems to be -1. next is another integer which i don't understand. then it repeats like that.

so what you could do is follows: make a separate foobar installation with a very small database (like 5 files for the beginning). use my program to output the database. just convert it to m3u for example.
write a program to output the list of the records in the playback statistics file. also you need to know the last access times of some of the files. then try to figure out how to map from the m3u file to the records file. I assume they might be in the same order, if not you are probably out of luck. however I already noticed, that the database contains more entries then the playback statistics file. these could be duplicates (because apparently he uses not the filename but a combination of artist, title, tracknumber, album name to generate his hash). also the database contains (in my case) tracks stored in zip files and such. maybe they are skipped.
so it could be, if you just skip duplicate files, that it maps perflectly just because they hopefully have the same order.
then you have to find out what those unknown fields mean. for that save your old playback stats file, change only one variable in one file, make a diff and use a hex editor to analyse it. a good hex editor i'm using is 010 editor.

you could also go the route of debugging the whole thing with ollydbg, but this will be more difficult.

good luck!

@klonuo
Copy link
Author

klonuo commented Sep 7, 2012

Hi Thomas,

I'll try something similar to your suggestion. Component uses 5 fields for track identification: 4 you mentioned plus %discnumber%, which equals to "1" if not set.
When I was playing with it, I focused on one track then changed one field by adding one character, then deleting one character, or changing dicsnumber from 1 to 2 - it always resulted in avalanche effect, which I assume is a feature of any hush algorithm.

a good hex editor i'm using is 010 editor.

yeah, I know what you mean, I've seen it in action, it's really great hex editor, and helper for tasks like this. I however don't know C (as I remember it offers space for interesting customizations if user can code in C) so I use simpler HxD ;)

ollydbg if far above my skills

Thanks for your help, I'll let you know if I manage something out of the problem, thou I doubt.
Cheers

@roded
Copy link

roded commented Jan 6, 2014

Hi,
I'm looking to manage the same thing..
Any development regarding this issue since this conversation took place?
Thanks

@klonuo
Copy link
Author

klonuo commented Jan 6, 2014

Not on my side.
I noticed XSLT sheet which claims to work for tracks that have been played at least once.

@roded
Copy link

roded commented Jan 6, 2014

Ah, thats a nice roundabout..
Thanks, could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants