AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Metamod:Source Plugins (https://forums.alliedmods.net/forumdisplay.php?f=76)
-   -   L4DToolZ Metamod plugin (l4d1 & l4d2) (https://forums.alliedmods.net/showthread.php?t=93600)

epzminion 07-25-2018 13:17

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Quote:

Originally Posted by Spirit_12 (Post 2604982)
Some of the minor stuff in this extension isn't working. I was trying to verify the signatures to eliminate that possibility, but I couldn't figure out what library they belong to. These are the ones I'm taking about. Most probably they are from Engine.so or server_srv.so, but I had no success upon searching in my disassembly.

Would anyone be able to point me in the right direction.

The first byte of each of these signatures refers to the length of the signature to follow. Also \xC3 in the signature represents a wildcard.

PHP Code:

const charlobby_sux "\x13\xFF\x50\xC3\x84\xC0\x0F\x84\xC3\xC3\xC3\xC3\x8B\xB3\xC3\x01\x00\x00\x85\xF6";
const 
charlobby_sux_new "\x06\x0B\xBE\x01\x00\x00\x00\x90";
void *lobby_sux_org NULL

Engine in CBaseServer::ConnectClient



PHP Code:

const charmax_players "\x16\x89\xC6\x8B\x03\x89\x1C\x24\xFF\x50\xC3\x29\xC6\x03\x75\xC3\x3B\xB3\xC3\x01\x00\x00\x0F";
char max_players_new[]= {0x060x0F0x830xFE0x3C0x900x900x90};
void *max_players_org NULL

Engine in CBaseServer::ConnectClient



PHP Code:

const charserver_bplayers "\x16\x55\x89\xE5\x83\xEC\x08\xE8\xC3\xC3\xC3\xC3\xC9\x3C\x01\x19\xC0\x83\xE0\xFC\x83\xC0\x08";
unsigned char server_bplayers_new[] = {0x060x000xB80x3C0x000x000x000xC3};
void *server_bplayers_org NULL

Server in CTerrorGameRules::GetMaxHumanPlayers



PHP Code:

const charplayers "\x13\x83\x3D\xC3\xC3\xC3\xC3\x01\x7F\xC3\x8B\x80\xC3\xC3\x00\x00\x89\x04\x24\xE8";
const 
charplayers_new "\x02\x07\x90\x90";
void *players_org NULL

Engine in _ZL10maxplayersRK8CCommand



PHP Code:

const charplayers2 "\x23\x55\x89\xE5\x53\x83\xEC\xC3\x8B\x5D\x08\x8B\x55\x0C\x8B\x83\xC3\xC3\x00\x00\x39\xD0\x7C\x0B\x8B\x83\xC3\xC3\x00\x00\x39\xC2\x0F\x4D\xC2\x8B";
const 
charplayers_new2 "\x01\x13\x89\xD0\xEB";
void *players_org2 NULL

Engine in CGameServer::SetMaxClients



PHP Code:

const charunreserved "\x1D\x55\x89\xE5\x81\xEC\xC3\xC3\x00\x00\x89\x5D\xF4\x8B\x5D\x08\x89\x75\xF8\x8B\x55\x10\x89\x7D\xFC\x8B\x75\xC3\x8B\x8B";
const 
charunreserved_new "\x01\x00\xC3";
void *unreserved_org NULL

Engine in CBaseServer::SetReservationCookie



PHP Code:

const charlobby_match "\x0A\x55\xB8\x08\x00\x00\x00\x89\xE5\x5D\xC3";
unsigned char lobby_match_new[] = {0x010x020xC3};
void *lobby_match_org NULL

Matchmaking_DS in CMatchTitle::GetTotalNumPlayersSupported

Spirit_12 07-25-2018 20:47

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
I was able to find about the wildcard, but the length threw me off. Havn't seen that in any of the other extensions.

Thanks for the help.

CrazyZoey 07-26-2018 11:06

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Hello Spirit_12,

I have a Left 4 Dead 1 server and I am having trouble installing the l4dtoolz plugin compiled from your branch.

I was able to compile the plugin successfully, but I do not know how to proceed with the installation :cry:

The files generated after compilation are as follows:

Code:

$ ls -lha /home/dartz/alliedmodders/l4dtoolz/build2/l4dtoolz_mm
total 2.1M
drwxrwxr-x 2 dartz dartz 4.0K Jul 26 09:28.
drwxrwxr-x 5 dartz dartz 4.0K Jul 26 09:28 ..
-rw-rw-r-- 1 dartz dartz 92K  Jul 26 09:28 _home_dartz_alliedmodders_sourcemod_public_asm_asm.o
-rw-rw-r-- 1 dartz dartz 793K Jul 26 09:28 l4dtoolz_mm.o
-rwxrwxr-x 1 dartz dartz 958K Jul 26 09:28 l4dtoolz_mm.so
lrwxrwxrwx 1 dartz dartz 63  Jul 26 09:28 libtier0_srv.so -> /home/dartz/alliedmodders/hl2sdk-l4d2/lib/linux/libtier0_srv.so
lrwxrwxrwx 1 dartz dartz 65  Jul 26 09:28 libvstdlib_srv.so -> /home/dartz/alliedmodders/hl2sdk-l4d2/lib/linux/libvstdlib_srv.so
-rw-rw-r-- 1 dartz dartz 195K Jul 26 09:28 signature.o

I copied the l4dtoolz_mm.so library to the left4dead/addons/l4dtoolz/ directory, but the metamod (v1.10.7) generates error when loading it.

And instead of using a vdf file, I set up the file left4dead/addons/metamod/metaplugins.ini by putting this line at the end:

Code:

l4dtoolz addons/l4dtoolz/l4dtoolz_mm
The output of the meta list command is this:

Code:

meta list
Listing 1 plugin:
  [01] <ERROR>

And the meta load is this:

Code:

meta load l4dtoolz
Failed to load plugin addons/l4dtoolz/l4dtoolz_mm (libvstdlib_srv.so: can not open shared object file: No such file or directory).

Can you help me, please?

Thanks.

Spirit_12 07-26-2018 17:37

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Correct me, if I'm wrong, but your extension is being linked with l4d2 libraries, while you are trying to run it on l4d1.

PHP Code:

lrwxrwxrwx 1 dartz dartz 63   Jul 26 09:28 libtier0_srv.so -> /home/dartz/alliedmodders/hl2sdk-l4d2/lib/linux/libtier0_srv.so
lrwxrwxrwx 1 dartz dartz 65   Jul 26 09
:28 libvstdlib_srv.so -> /home/dartz/alliedmodders/hl2sdk-l4d2/lib/linux/libvstdlib_srv.so 

What are the parameters being used to compile?

Try the following and let me know if it works.

PHP Code:

python ../configure.py --symbol-files --enable-optimize -s l4d 


CrazyZoey 07-26-2018 18:51

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Hey man

Thanks for your response.

Yes, I'm trying to run this extension on Left 4 Dead 1 (Ubuntu Server 18.04 x86_64).

I was not passing any parameters (I'm new in AMBuild). My command was like this:

Code:

python ../configure.py
Anyway, I tested the command you passed me, and the output was this:

Code:

dartz@dartz-X450CA:~/alliedmodders/l4dtoolz/build3$ python ../configure.py --symbol-files --enable-optimize -s l4d
Checking CC compiler (vendor test gcc) ... ['cc', 'test.c', '-o', 'test']
found gcc version 5.5
Checking CXX compiler (vendor test gcc) ... ['c ++', 'test.cpp', '-o', 'testp']
found gcc version 5.5

So far so good.

On the other hand, the output of AMBuild was this:

Code:

[create] mkdir -p l4dtoolz_mm
[create] mkdir -p package
[create] mkdir -p package/addons
[create] mkdir -p package/addons/l4dtoolz
[create] mkdir -p package/addons/metamod
Spawned taskmaster (pid: 16221)
Spawned worker (pid: 16225)
[16225] cp "/home/dartz/alliedmodders/l4dtoolz/l4dtoolz.vdf" "./package/addons/metamod/l4dtoolz.vdf"
Spawned worker (pid: 16227)
Spawned worker (pid: 16226)
Spawned worker (pid: 16228)
[16228] ln -s /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/libtier0.so l4dtoolz_mm/libtier0.so
[16228] ln -s /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/libvstdlib.so l4dtoolz_mm/libvstdlib.so
Spawned worker (pid: 16229)
[16225] cc -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -g3 -ggdb3 -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSE_LEFT4DEAD2=15 -DSE_LEFT4DEAD=12 -DSOURCE_ENGINE=12 -DCOMPILER_GCC -DNO_HOOK_MALLOC -DNO_MALLOC_OVERRIDE -I /home/dartz/alliedmodders/sourcemod/public -H -c /home/dartz/alliedmodders/sourcemod/public/asm/asm.c -o _home_dartz_alliedmodders_sourcemod_public_asm_asm.o
[16227] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSE_LEFT4DEAD2=15 -DSE_LEFT4DEAD=12 -DSOURCE_ENGINE=12 -DCOMPILER_GCC -DNO_HOOK_MALLOC -DNO_MALLOC_OVERRIDE -I /home/dartz/alliedmodders/sourcemod/public -I /home/dartz/alliedmodders/l4dtoolz -I /home/dartz/alliedmodders/l4dtoolz/sdk -I /home/dartz/alliedmodders/sourcemod/public -I /home/dartz/alliedmodders/sourcemod/public/extensions -I /home/dartz/alliedmodders/sourcemod/sourcepawn/include -I /home/dartz/alliedmodders/sourcemod/public/amtl/amtl -I /home/dartz/alliedmodders/sourcemod/public/amtl -I /home/dartz/alliedmodders/mmsource-1.10/core -I /home/dartz/alliedmodders/mmsource-1.10/core/sourcehook -I /home/dartz/alliedmodders/hl2sdk-l4d/public -I /home/dartz/alliedmodders/hl2sdk-l4d/public/engine -I /home/dartz/alliedmodders/hl2sdk-l4d/public/mathlib -I /home/dartz/alliedmodders/hl2sdk-l4d/public/vstdlib -I /home/dartz/alliedmodders/hl2sdk-l4d/public/tier0 -I /home/dartz/alliedmodders/hl2sdk-l4d/public/tier1 -I /home/dartz/alliedmodders/hl2sdk-l4d/public/game/server -I /home/dartz/alliedmodders/hl2sdk-l4d/public/toolframework -I /home/dartz/alliedmodders/hl2sdk-l4d/game/shared -I /home/dartz/alliedmodders/hl2sdk-l4d/common -H -c /home/dartz/alliedmodders/l4dtoolz/signature.cpp -o signature.o
[16226] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -g3 -ggdb3 -std=c++11 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DSE_LEFT4DEAD2=15 -DSE_LEFT4DEAD=12 -DSOURCE_ENGINE=12 -DCOMPILER_GCC -DNO_HOOK_MALLOC -DNO_MALLOC_OVERRIDE -I /home/dartz/alliedmodders/sourcemod/public -I /home/dartz/alliedmodders/l4dtoolz -I /home/dartz/alliedmodders/l4dtoolz/sdk -I /home/dartz/alliedmodders/sourcemod/public -I /home/dartz/alliedmodders/sourcemod/public/extensions -I /home/dartz/alliedmodders/sourcemod/sourcepawn/include -I /home/dartz/alliedmodders/sourcemod/public/amtl/amtl -I /home/dartz/alliedmodders/sourcemod/public/amtl -I /home/dartz/alliedmodders/mmsource-1.10/core -I /home/dartz/alliedmodders/mmsource-1.10/core/sourcehook -I /home/dartz/alliedmodders/hl2sdk-l4d/public -I /home/dartz/alliedmodders/hl2sdk-l4d/public/engine -I /home/dartz/alliedmodders/hl2sdk-l4d/public/mathlib -I /home/dartz/alliedmodders/hl2sdk-l4d/public/vstdlib -I /home/dartz/alliedmodders/hl2sdk-l4d/public/tier0 -I /home/dartz/alliedmodders/hl2sdk-l4d/public/tier1 -I /home/dartz/alliedmodders/hl2sdk-l4d/public/game/server -I /home/dartz/alliedmodders/hl2sdk-l4d/public/toolframework -I /home/dartz/alliedmodders/hl2sdk-l4d/game/shared -I /home/dartz/alliedmodders/hl2sdk-l4d/common -H -c /home/dartz/alliedmodders/l4dtoolz/l4dtoolz_mm.cpp -o l4dtoolz_mm.o
[16226] ambuild_objcopy_wrapper.sh l4dtoolz_mm.so c++ l4dtoolz_mm.o signature.o _home_dartz_alliedmodders_sourcemod_public_asm_asm.o libvstdlib.so libtier0.so -m32 -Wl,--exclude-libs,ALL -lm -static-libgcc /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/tier1_i486.a /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/mathlib_i486.a -shared -o l4dtoolz_mm.so
[Errno 2] No such file or directory
Build failed.

Specifically (the error message was marked in red on the terminal):

Code:

[16226] ambuild_objcopy_wrapper.sh l4dtoolz_mm.so c++ l4dtoolz_mm.o signature.o _home_dartz_alliedmodders_sourcemod_public_asm_asm.o libvstdlib.so libtier0.so -m32 -Wl,--exclude-libs,ALL -lm -static-libgcc /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/tier1_i486.a /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/mathlib_i486.a -shared -o l4dtoolz_mm.so
[Errno 2] No such file or directory
Build failed.

Looks like there's some missing file, I do not know.

I checked whether the static libraries mentioned in the error message existed. And yes, they exist. Here is the listing:

Code:

dartz@dartz-X450CA:~/alliedmodders/l4dtoolz/build3$ ls -lha /home/dartz/alliedmodders/hl2sdk-l4d/lib/linux/
total 3,4M
drwxrwxr-x 2 dartz dartz 4,0K jul 25 18:49 .
drwxrwxr-x 5 dartz dartz 4,0K jul 25 18:49 ..
-rw-rw-r-- 1 dartz dartz 346K jul 25 18:49 choreoobjects_i486.a
-rw-rw-r-- 1 dartz dartz 337K jul 25 18:49 dmxloader_i486.a
-rw-rw-r-- 1 dartz dartz 324K jul 25 18:49 libtier0.so
-rw-rw-r-- 1 dartz dartz 255K jul 25 18:49 libvstdlib.so
-rw-rw-r-- 1 dartz dartz 216K jul 25 18:49 mathlib_i486.a
-rw-rw-r-- 1 dartz dartz 1,4M jul 25 18:49 particles_i486.a
-rw-rw-r-- 1 dartz dartz 338K jul 25 18:49 tier1_i486.a
-rw-rw-r-- 1 dartz dartz 184K jul 25 18:49 tier2_i486.a
-rw-rw-r-- 1 dartz dartz  54K jul 25 18:49 tier3_i486.a

Then I decided to do a new test. I ran the command below again (without the --symbol-files parameter):

Code:

python ../configure.py --enable-optimize -s l4d
And AMBuild generated the extension without errors. But Metamod could not load the extension:

Code:

meta load l4dtoolz
Failed to load plugin addons/l4dtoolz/l4dtoolz_mm (/home/steam/.steam/steamcmd/srvl4d/left4dead/addons/l4dtoolz/l4dtoolz_mm.so: undefined symbol: ud_init).

Clearly, it seems to me that the error is indeed in the linking (the --symbol-files parammeter is important), but something else is missing for everything to work.

Spirit_12 07-26-2018 19:34

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Sourcemod was recently updated and due to that it requires the new libraries. Here is the fix for the error you seem to have. I have yet to update it in my repo, so you can follow the solution straight from AM repo.

https://github.com/alliedmodders/sourcemod/issues/853

As for symbol files. That's optional and wouldn't be a priority.

You can always check the available parameters to configure by following command.

PHP Code:

python ../configure.py -


CrazyZoey 07-26-2018 20:00

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Hi Spirit_12,

Thank you for your support.

Tomorrow I'm going to test this solution, because the computer I am using for testing is not with me at the moment.

Anyway thank you. I'll report the results here for sure.

CrazyZoey 07-27-2018 10:37

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
OK, let's go.

I downloaded the source code of the Udis86 library available on Sourceforge:

http://sourceforge.net/projects/udis...ar.gz/download

I compiled the library (tutorial at http://udis86.sourceforge.net/doc.html):
Code:

./configure
make
sudo make install

Then I opened the AMBuildScript file, and I edited line 245:

Before:

Code:

cxx.linkflags += ['-Wl,--exclude-libs,ALL', '-lm']
After:
Code:

cxx.linkflags += ['-lm', '-ludis86']
I compiled the extension:

Code:

python ../configure.py --enable-optimize -s l4d
amdbuid

Finally, I uploaded the extension to my server:

Code:

meta list
Listing 2 plugins:
  [01] SourceMod (1.9.0.6245) by AlliedModders LLC
  [02] L4DToolZ (1.0.0.9h-unknown) by Ivailosp

I have not yet set up the CVARs to get the extra slots, but I think it will work.

Spirit_12 07-27-2018 14:00

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
I’ll update the source code in my repo soon.

CrazyZoey 07-30-2018 13:11

Re: L4DToolZ Metamod plugin (l4d1 & l4d2)
 
Hey Spirit,

Have you updated the source code in your repository?

When I try to compile it, I get this error:

Code:

[2661] cc -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -O3 -g3 -ggdb3 -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -DNDEBUG -D_LINUX -DPOSIX -DSE_LEFT4DEAD2=15 -DSE_LEFT4DEAD=12 -DSOURCE_ENGINE=12 -DCOMPILER_GCC -DNO_HOOK_MALLOC -DNO_MALLOC_OVERRIDE -I /home/dartz/alliedmodders3/sourcemod/public -H -c /home/dartz/alliedmodders3/sourcemod/public/libudis86/udis86.c -o _home_dartz_alliedmodders3_sourcemod_public_libudis86_udis86.o
/home/dartz/alliedmodders3/sourcemod/public/libudis86/udis86.c: In function ‘ud_init’:
/home/dartz/alliedmodders3/sourcemod/public/libudis86/udis86.c:47:3: error: implicit declaration of function ‘memset’ [-Werror=implicit-function-declaration]
  memset((void*)u, 0, sizeof(struct ud));
  ^
/home/dartz/alliedmodders3/sourcemod/public/libudis86/udis86.c:47:3: error: incompatible implicit declaration of built-in function ‘memset’ [-Werror]
/home/dartz/alliedmodders3/sourcemod/public/libudis86/udis86.c:47:3: note: include ‘<string.h>’ or provide a declaration of ‘memset’
cc1: all warnings being treated as errors
Build failed.



All times are GMT -4. The time now is 19:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.