View previous topic :: View next topic |
Author |
Message |
The Lion Forum-Nutzer

Joined: 23 Jul 2006 Posts: 55
Location: The Netherlands
|
Posted: 21.04.2007, 17:59 Post subject: Small utility to remap listening ports (GNU/Linux) |
|
|
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.
Description: |
|
 Download |
Filename: |
port_hack-1.0.tar.gz |
Filesize: |
2.5 KB |
Downloaded: |
712 Time(s) |
_________________ ☕ |
|
Back to top |
|
 |
D.Cent Forum-Nutzer
Joined: 05 Mar 2006 Posts: 508
Location: Stuttgart
|
Posted: 23.04.2007, 19:34 Post subject: |
|
|
Not bad, but you can change the port with the server-version of Loki D3 I think...
|
|
Back to top |
|
 |
Munk Forum-Nutzer

Joined: 30 Jun 2001 Posts: 2140
Location: Herzogenrath
|
Posted: 23.04.2007, 19:48 Post subject: |
|
|
There is no "Server version" of Loki.
So changing ports by Lions Lib is the only option at hand.
|
|
Back to top |
|
 |
D.Cent Forum-Nutzer
Joined: 05 Mar 2006 Posts: 508
Location: Stuttgart
|
Posted: 25.04.2007, 13:53 Post subject: |
|
|
There is a server-version on www.descent3.com
|
|
Back to top |
|
 |
Munk Forum-Nutzer

Joined: 30 Jun 2001 Posts: 2140
Location: Herzogenrath
|
Posted: 25.04.2007, 16:56 Post subject: |
|
|
This server is from Outrage, not from Loki.
The Outrage server lacks of Support for higher CPU frequencies.
|
|
Back to top |
|
 |
Munk Forum-Nutzer

Joined: 30 Jun 2001 Posts: 2140
Location: Herzogenrath
|
Posted: 25.04.2007, 18:29 Post subject: Re: Small utility to remap listening ports (GNU/Linux) |
|
|
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 |
|
 |
King Lo Forum-Nutzer

Joined: 14 Mar 2006 Posts: 320
Location: Stuttgart, BW
|
Posted: 25.04.2007, 20:24 Post subject: |
|
|
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 |
|
 |
Munk Forum-Nutzer

Joined: 30 Jun 2001 Posts: 2140
Location: Herzogenrath
|
Posted: 25.04.2007, 21:02 Post subject: |
|
|
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 |
|
 |
|