LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2006, 11:23 PM   #1
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Rep: Reputation: 30
lying to programs


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.
 
Old 02-24-2006, 04:36 AM   #2
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
Well there's 3 possible ways.

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.
 
Old 02-24-2006, 12:06 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
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?
 
Old 02-24-2006, 02:09 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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.
 
Old 02-24-2006, 11:55 PM   #5
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Original Poster
Rep: Reputation: 30
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).
 
Old 02-25-2006, 01:09 AM   #6
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
Wouldn't it be easier to disable the music in the game and run some mp3 player on the background while playing?
 
Old 02-26-2006, 12:24 AM   #7
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Original Poster
Rep: Reputation: 30
I would have to take the time to get to the site and then run the program - would take longer, and I am lazy.
 
Old 02-26-2006, 01:11 AM   #8
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
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?
 
Old 02-26-2006, 12:35 PM   #9
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Did you try the named pipe method yet? Did it work?

Edit: I was just asking about your location because I have a friend w/ the same name.
 
Old 02-27-2006, 10:10 AM   #10
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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.

Last edited by schneidz; 03-01-2006 at 10:51 AM.
 
Old 02-28-2006, 11:32 AM   #11
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Try this....

mkfifo /path/to/dir/music/file.mp3
wget http://www.someurl.com/somedir/somefile.mp3 -q -O - > /path/to/dir/music/file.mp3 &

Now load up the game and see if it works.

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.

Last edited by 95se; 02-28-2006 at 11:34 AM.
 
Old 02-28-2006, 08:25 PM   #12
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Original Poster
Rep: Reputation: 30
Wink

The last suggestion looks good - thanks for the help

BTW: Techno played in Civ4 sounds good.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT- cfdisk or df are lying to me! TGWDNGHN Linux From Scratch 3 10-14-2005 08:53 AM
mii-tool apparently lying about 3COM cards MensaWater Linux - Networking 4 09-29-2005 10:13 AM
is apt-get buggy or is aptitude lying!? Daveb3 Debian 14 07-26-2005 03:55 PM
who is lying??? yenonn General 30 01-02-2004 02:35 AM
df -h .. Lying? mikeshn Linux - General 2 07-08-2002 08:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration