Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Quake 3 server modify incoming packet

Featured Replies

  • Author
  • Localization

navgg, posted Thu Sep 21, 2017 12:01 pm (26671)


I was trying to modify name parameter in incoming connection packet to server of quake 3 protocol 43 with proxocket in myrecvfrom method.
Here is my code of myrecvfrom:

Code:
int __cdecl myrecvfrom(SOCKET s, u_char *buf, int len, int flags, struct sockaddr *from, int *fromlen) {             

   if (buf[0] == 0xFF && buf[1] == 0xFF &&
      buf[4] == 'c' && buf[7] == 'n') {      
      buf = find_replace_string(buf, &len, "name\\TEST1", "name\\TEST2");
   }

    return(len);
}

But it seems server still receiving original packet. I wonder is it even possible, or maybe I'm doing something wrong? :?
  • Author
  • Localization

aluigi, posted Thu Sep 21, 2017 4:21 pm (26679)


First you must be 100% sure that proxocket is loaded, if I remember correctly you have to set a registry key on Windows 7 and above.

Then the find_replace_string function reallocate the buffer if the new string is bigger than the original one, so "buf" will not be updated and there are probably also other downsides because the original buffer is freed as far as I remember.
  • Author
  • Localization

navgg, posted Thu Sep 21, 2017 6:17 pm (26690)


I double checked and it seems proxocket works good. I think I understand what's the problem.
According to server log it received modified packet, however after connection it seems received once more info from client and changed it back.
Server log:
Code:
ClientUserinfoChanged: 0 n\TEST2\t\2\model\sarge/blue\c1\4\hc\300\w\0\l\0
broadcast: print "TEST2 connected\n"
ClientUserinfoChanged: 0 n\TEST1\t\2\model\sarge/blue\c1\4\hc\300\w\0\l\0
broadcast: print "TEST1 entered the game\n"

Unfortunately after connection all info is not simply readable and encoded.
  • Author
  • Localization

aluigi, posted Thu Sep 21, 2017 6:53 pm (26693)


Ah right the game commands. The name of the player is "updated" with the cl->userinfo string sent via SV_UpdateUserinfo_f, SV_DirectConnect and SV_UserinfoChanged.
Things that you can't change by using a raw socket solution.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.