Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: library manager without database.dat (Read 2532 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

library manager without database.dat

Hello all develepers,

I'm new to this forum, so please forgive me potentially stupid question..

I'm trying to prepare plugin that will read library data from file other than database.dat.

The goal is to keep songs information encrypted.

Please suggest me a direction I should follow. I spent few hours analyzing code (library_manager, library_callback, file_info and other classes) but still don't have the solution.

I think it could be something like this:

pfc::list_t<metadb_handle_ptr> library;
static_api_ptr_t<library_manager>()->get_all_items(library);
library.remove_all();

FILE OPEN

library.add_item(file_item1);
library.add_item(file_item2);

....

but library is a copy and it will not remove items from original library list.


/////// alternative solution ????


my first try with this was to catch all file input/output operations to make this on filesystem layer and encrypt/decrypt data on the fly. But I hadn't seen file operation callbacks (/service pointers) that concern database.dat.
Is this possible? If yes it would be the best solution...


Thank you in advance!








library manager without database.dat

Reply #1
Have you tried to use NTFS encryption with database.dat? The SDK does not provide hooks to intercept or redirect access to database.dat.

 

library manager without database.dat

Reply #2
As far as I remember whole "foobar2000" directory (the one with settings) needs to be encrypted with built-in NTFS encryption. If only file is encrypted it may become unencrypted after editing (like updating database.dat file due to library contents change. If you try to encrypt single file you get such warning, and yes, in case of Word and Notepad files it is true - after editing them they become unencrypted. So it's bit problematic - I don't know how encryption of whole settings directory may interfere with overall functionality of foobar...