dreamstalker / rehlds

Reverse-engineered HLDS
GNU General Public License v3.0
653 stars 167 forks source link

Change the "BOT" name in status cmd, server crashes #936

Closed gary00k closed 2 years ago

gary00k commented 2 years ago

Hello. I tried to fake steam id of bots on server, only when player type "status" command in the console. I found two places in host_cmd.cpp and replaces val = "BOT" and szIDString = "BOT" with this:

if ( (rand() % 2) == 0 )
    sprintf(val, "STEAM_1:0:%d", (1 + rand() % 9));
else
    sprintf(val, "STEAM_0:1:%d", (1 + rand() % 9));

for ( int x = 1; x < ( 8 + rand() % 3 ); x++ )
    sprintf(val, "%s%d", val, (rand() % 10));
if ( (rand() % 2) == 0 )
    sprintf(szIDString, "STEAM_1:0:%d", (1 + rand() % 9));
else
    sprintf(szIDString, "STEAM_0:1:%d", (1 + rand() % 9));

for ( int x = 1; x < ( 8 + rand() % 3 ); x++ )
    sprintf(szIDString, "%s%d", szIDString, (rand() % 10));

It mainly works, but sometimes when someone typed "status" cmd, server crashed :/ I know this code is mess, but what's the problem in?

Garey27 commented 2 years ago

Hello. This issue not related to ReHLDS functionality. There something wrong with your fork.

gary00k commented 2 years ago

Yes, but how to modify it?

gary00k commented 2 years ago

So? I think it's easy to implement.