ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a way in perl or c++ I can list a link to an internet site, and a specific link to a song on that site so that A game(pirates of the carribean) will play that link? I don't think you can but maybe I'm wrong.
You run a proxy service that acts as man in middle to http requests. When the program sees http://piratesofthecarribean.com instead of connecting to the site it launches an executable.
You target a specific browser, find the memory location that stores the site address and exec the app when the variable matches the link.
You hack the web site itself.
Option 1 might be the easiest and most reliable, since it is browser independent.
And ofcourse option 3 is just plain wrong and illegal.
Hey, you wouldn't happen to be making a trojan horse would you?
EDIT: Oh, I almost forgot about option 4. Lying to the OS itself. You can simply edit the hosts file. No programming required. it'll be something like http://linktothesite.com file://use/less/app
Last edited by slantoflight; 02-24-2006 at 04:42 AM.
I'm not sure what you mean, but it sounds like you'd like to create something in the filesystem that looks like a file, but is actually a link to a website? So if you tell something to open ~/somefile.mp3 it is actually getting some file from an internet site, and not your hard drive. If this is the case, a simple solution may be using named pipes. You'd have to write a program (in C or C++ or whatever) that creates the name pipe (or you can create w/ mkfifo, either way). Then the C program would start downloading the file and write it to the named pipe. There may be some problems w/ read blocking or something else, but it may be worth a try.
There was also a module created a while back called lufs that would let you mount an ftp site as a file system, then you could treat the files on the server as any other files, I know this isn't HTTP, but it may do the trick as well. It doesn't appear to be maintained anymore though, and I never successfully compiled it.
Edit: Also, Dan, do you live in Toronto by any chance?
i maybe wrong. but i think he wants to play the sound in game. kinda' like playing mp3's in 'gta3'.
it depends on how the sounds are stored on the hard drive. and what methods are used to access it. there may be checks like crc, or filesize/ date to deter this.
the easiest thing to try would be to download the file to the sounds/ wav's directory and rename it to something already existing in that dir.
I don't want to make a trojan horse, and I don't live in toronto. I live in Seattle, Washington. However, I was just wanting a program that I could put in the music folder of the game, that when the game tried to access it, it would instead be accessing a web site, and streaming the file listed. That way I would get different music every time. Is there a site that I can go to that they won't throw me in jail for looking at that will tell me how to do this?
PS: Never thought of the trojan horse thing - don't worry I'm not an idiot who likes wrecking other peoples computers. This is for personal use only(the same music get's old after a while).
It depends on what type of file structure the game is using. On some games the files are bundled into on big file, like a PAK file. Or some cases the individual files are in plain view. You're lucky if the files are mp3s, in which you can just download the song and replace it.
BTW, which music will you be using to corrupt your gaming experience?
ok, like slant was suggesting if the files reside on the hard drive as wav's/ mp3's (like vampire the masquerade bloodlines) then it is a matter of renaming your music file to something already existing.
e.g.- the game is thinking it is playing lecherbitch.wav but the song is actually nothin' but a 'g' thang.
my suggestion is as a 'proof of concept' to see if it is possible for your specific game is to rename a file locally. if that works i would use cron to schedule a download-rename of a file every few hours.
Edit: Replace /path/to/dir/music/file.mp3 w/ the path to the mp3 (or wav) file that the game plays as music. And make sure you can download the mp3 fast enough to keep up w/ the music.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.