Descentforum.DE Forum Index Descentforum.DE
Search | FAQ | Memberlist | Usergroups | Newsfeed Newsfeed  Register
Profile | Log in to check your private messages | Log in 
Chat | D3-Tactics | Downloads | Map | Links | Serverlist | Teamspeak 

Small utility to remap listening ports (GNU/Linux)

 
Post new topic   Reply to topic    Descentforum.DE Forum Index -> English Embassy / International Descenters Forum
View previous topic :: View next topic  
Author Message
The Lion
Forum-Nutzer


Joined: 23 Jul 2006
Posts: 55
Location: The Netherlands

PostPosted: 21.04.2007, 17:59    Post subject: Small utility to remap listening ports (GNU/Linux) Reply with quote

I just made a small utility library which can be LD_PRELOADed to
change the port(s) which a program binds to.

Someone mentioned that you can't change the default port from
2092 in the Loki version of Descent 3. This is why I wrote it,
although it can of course be useful for some other programs too.

Note that this will only work if the program isn't statically linked; it
must be using the bind() wrapper from the C library and not perform
the syscall directly. Otherwise, it can't be intercepted in this way.

Further information is provided in the README file.



port_hack-1.0.tar.gz
 Description:
port_hack 1.0

Download
 Filename:  port_hack-1.0.tar.gz
 Filesize:  2.5 KB
 Downloaded:  694 Time(s)


_________________
Back to top
View user's profile Send private message
D.Cent
Forum-Nutzer


Joined: 05 Mar 2006
Posts: 507
Location: Stuttgart

PostPosted: 23.04.2007, 19:34    Post subject: Reply with quote

Not bad, but you can change the port with the server-version of Loki D3 I think...
Back to top
View user's profile Send private message
Munk
Forum-Nutzer


Joined: 30 Jun 2001
Posts: 2140
Location: Herzogenrath

PostPosted: 23.04.2007, 19:48    Post subject: Reply with quote

There is no "Server version" of Loki.

So changing ports by Lions Lib is the only option at hand.
Back to top
View user's profile Send private message Send e-mail
D.Cent
Forum-Nutzer


Joined: 05 Mar 2006
Posts: 507
Location: Stuttgart

PostPosted: 25.04.2007, 13:53    Post subject: Reply with quote

There is a server-version on www.descent3.com
Back to top
View user's profile Send private message
Munk
Forum-Nutzer


Joined: 30 Jun 2001
Posts: 2140
Location: Herzogenrath

PostPosted: 25.04.2007, 16:56    Post subject: Reply with quote

This server is from Outrage, not from Loki.

The Outrage server lacks of Support for higher CPU frequencies.
Back to top
View user's profile Send private message Send e-mail
Munk
Forum-Nutzer


Joined: 30 Jun 2001
Posts: 2140
Location: Herzogenrath

PostPosted: 25.04.2007, 18:29    Post subject: Re: Small utility to remap listening ports (GNU/Linux) Reply with quote

The Lion wrote:

Someone mentioned that you can't change the default port from
2092 in the Loki version of Descent 3. This is why I wrote it,
although it can of course be useful for some other programs too.


Thank you Lion! This works great.

For anyone to try:
Code:

env LD_PRELOAD=/usr/local/games/Descent3/port_hack-1.0/port_hack.so PORT_HACK=2092:2093,20142:20143 ./descent3 --dedicated Dedicated.cfg -P /usr/local/games/Descent3/custom/cache.2093


Last edited by Munk on 25.04.2007, 21:03; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
King Lo
Forum-Nutzer


Joined: 14 Mar 2006
Posts: 320
Location: Stuttgart, BW

PostPosted: 25.04.2007, 20:24    Post subject: Reply with quote

really nice that someone does so much for loki descent3.

anyway it wout be nice if we wouldn't gave to use the kernel modulse (LD_PRELOAD). can we not use it another way?
Back to top
View user's profile Send private message
Munk
Forum-Nutzer


Joined: 30 Jun 2001
Posts: 2140
Location: Herzogenrath

PostPosted: 25.04.2007, 21:02    Post subject: Reply with quote

LD_PRELOAD is no kernel module.

It is just an environment variable telling the dynamic linker (part of the kernel) which dynamic libs to load. Otherwise the linker would inspect the executable for the libs referenced in there.

You do not modify any kernel, since they should be able to run programs with shared libraries.

I think it's the cleanest way to modify the execution of a third program right after modifing the program itself (which is of course impossible here).


Last edited by Munk on 25.04.2007, 21:07; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Descentforum.DE Forum Index -> English Embassy / International Descenters Forum All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
PayPal


Descent is a trademark of Interplay Productions.
Descent, Descent II are © Parallax Software Corporation.
Descent III is © Outrage Entertainment.
Descentforum.DE and Descentforum.NET is © by Martin "Do_Checkor" Timmermann.
Powered by phpBB © 2001-2008 phpBB Group