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: New file format support - how to? (Read 4317 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

New file format support - how to?

Hello my fellow developers , it is my first post here and I ashamed it is a request of help...

I'm trying to write a simple plugin for foobar...

I use foobar at my work as dev to simply relax myself while working. I find it quite plausible . Anyways, lately my boss made my and my fellows to sign a paper that disallows us to use ANY content that he does not have legal rights to: mainly - I cant legally listen to my mp3 files since he does not possess rights to them (only I do).

So as a result I came up with rather simple solution - writing a plugin for foobar to allow it to read encrypted files.

It should work as follows:
1. On each run of foobar, plugin should ask for a master password to special txt file. Mentioned file would possess sets of following data: random_mp3_or_flac_file_name;original_mp3_or_flac_file_name;file_format;encryption_key_for_that_file
;\n.
2. After decrypting that special txt file (decrypted file should exist only in RAM) foobar would normally load a playlist, while changing encrypted file names (random names) to their original form according to previously mentioned txt file.
3. If user asked foobar to play encrypted file, foobar would decrypt as much of file as needed into the buffer (files would be encrypted in CBC mode to allow buffering) and play it.

And so I ask you: could anyone post a blank vc project with all sdk methods that I need to overload? I ask for this since your sdk documentation simply is... bad.
Also small comment at each method beginning; telling what it does would be highly valued .

Thanks in advance .

PS.
Remember that such a blank project would be useful to many people - not just silly my .

New file format support - how to?

Reply #1
1. Your described approach does not solve your legal issues
2. If you want to have your files still to be encrpyted, put them into a truecrypt container
3. Your complicated "solution" is not possible with the foobar SDK anyway
4. If you want to develop a component you should do your homework and learn using the SDK instead of asking other people to do it for you.

New file format support - how to?

Reply #2
1. Your described approach does not solve your legal issues
2. If you want to have your files still to be encrpyted, put them into a truecrypt container
3. Your complicated "solution" is not possible with the foobar SDK anyway
4. If you want to develop a component you should do your homework and learn using the SDK instead of asking other people to do it for you.

That is quite harsh for you to say... It solves my legal issues - If only I'm able to use those file, and to other they are just a bunch of random bits, then It is fine. You can not take legal actions against someone based on files which content you cannot interpret.

I do not find my solution complicated... I can skip the part of that special txt file and use same encryption key to all files... All I truly need is to overload a part where buffer reads file and decrypt it there. For me it sounds really simple.

May I ask you to simply point my directions instead of just being rude? I do not want to waste time reading bunch of irrelevant documentation, when possibly I need to overload 1-2 functions.

New file format support - how to?

Reply #3
1. Your described approach does not solve your legal issues
That is quite harsh for you to say... It solves my legal issues - If only I'm able to use those file, and to other they are just a bunch of random bits, then It is fine. You can not take legal actions against someone based on files which content you cannot interpret.
The files would be decrypted to audio that your boss does not own the rights to. How would that solve anything? Not only do the legal issues remain, but you may be creating new ones by breaching your contract.

New file format support - how to?

Reply #4
1. Your described approach does not solve your legal issues
That is quite harsh for you to say... It solves my legal issues - If only I'm able to use those file, and to other they are just a bunch of random bits, then It is fine. You can not take legal actions against someone based on files which content you cannot interpret.
The files would be decrypted to audio that your boss does not own the rights to. How would that solve anything? Not only do the legal issues remain, but you may be creating new ones by breaching your contract.

I simplified (by a lot!) what the papers between my and my boss where about - I did not want to get into details about that, since its irrelevant to writing a plugin for foobar.
But If you want to know that badly, I guess I may write it down.

The thing is that I work using a network station and as so, If I want to use any personal files on that network station, I need to ensure that they can be read only by me. If I leave a mp3 from my favorite Witcher soundtrack on that pc (basicaly at network disk drive), than few people, who do not have right to, can read it. The agreement between my and my boss states that I am able to use only legal software/files, and I will be put into responsibly if any illegal files are found on my hard drive. All would be fine If I were the only one who have access to my disk drive space - but my co-workers have access to it to; and that shows legal issues, since they may read files that they are not suppose to.

But, If I may ask, lets get back into the topic of writing a plugin, instead of wondering about my legal issues .

PS After reading quite a bit I find the Truecrypt solution a bit more flexible - It would allow my to put more of my personal files into use on my working station. Thank you fbuser for that (I though you did not have anything usable to say and you were just a flamer - sorry about that). Anyways, question remains: what things from sdk should I use (what part of doc should I read) to ensure such a functionality?

New file format support - how to?

Reply #5
not an answer I realize, but why not just use an ipod or other mp3 player instead of putting files on your work computer?

New file format support - how to?

Reply #6
not an answer I realize, but why not just use an ipod or other mp3 player instead of putting files on your work computer?


1. My mp3 player can not play flac files... I would need to change batteries each day (lets thing a bit about our natural enviorment - batteries are really harsh for enviorment and their recykling is fairly expensive).
2. I have very nice sound card at work ^.^.
3. Your answer is another one irrelevant to my question.

Atm I'm satisfied with using truecrypt - thx fbuser, yet I would like to know how to write such a plugin  thx in advance and please restrain from writing thing irrelevant to this topic.


New file format support - how to?

Reply #8
If it's only about reading from encrypted files you might have a look at input_raw.cpp in the foo_sample folder of the SDK and also to the input*.* files from the SDK.

 

New file format support - how to?

Reply #10
A better idea would be a unpacker service.
Devise a format based on some encryption, make a archiver for files, write a FB2K unpacker component for said format.

Done.