Class Proxy Issues

01/25/2018 06:06 .Kinshi#1
I'm attempting to write a simple packet logging proxy for Classic Conquer servers (~4280).

Here are the steps I've gotten so far:
  • The client connects to the proxy, then connects to the authentication server.
  • I am decrypting the server packet 1055 and injecting the proxy IP and port, and forwarding that back to the client.
  • The client then sends 1052 to the auth server.
  • Once it connects to the game server, it doesn't send anything. So this is where I'm stuck.
Do I need to initiate something when the proxy connects to the game server?


Solved. I was not sending the local proxy IP correctly.
01/26/2018 03:21 Spirited#2
Is it possible that you're not starting the receive loop after accepting the client for the game server?
01/26/2018 03:57 .Kinshi#3
I'm pretty positive I am. I'm using the same class for both auth and game servers.

I've attached what I've got so far.

Edit:
Maybe this is a client issue? I was testing this out on a server that has a modified Conquer.exe (sorry, I hope they don't mind!). Maybe they've modified packets or some sort of flow?

I'll see if I can find a vanilla server to test this on.
01/26/2018 05:20 Spirited#4
Yeah, it seems fine to me. You might need to try an unmodified example server.
01/26/2018 05:56 JaniQ#5
Actually I am having the same issue , the proxy seems to work fine for everyone except this one person.
01/28/2018 19:00 .Kinshi#6
So my issue was I was cutting off part of the IP address, using a length of 13 instead of 16, when handling packet 1055.

Thanks for your help everyone.
04/13/2018 14:02 Super Aids#7
Quote:
Originally Posted by .Kinshi View Post
So my issue was I was cutting off part of the IP address, using a length of 13 instead of 16, when handling packet 1055.

Thanks for your help everyone.
13 instead of 16?

What?

An IP Address is 15 bytes at most. Unless you're not talking about the IP address?

Code:
1 2
2 5
3 5
4 .
5 2
6 5
7 5
8 .
9 2
10 5
11 5
12 .
13 2
14 5
15 5
IPV4 obviously.

If it's stored as 16 bytes then the last byte is just padding most likely.
04/14/2018 23:14 CptSky#8
Quote:
Originally Posted by Super Aids View Post
[...] If it's stored as 16 bytes then the last byte is just padding most likely.
The client is implemented in C++. The Info field, containing the IP address, is passed to other functions as a string, as such, it must be terminated by a NUL character. An IPv4 address can takes at most 16 bytes when represented in a C-string. It's important to put the NUL character to avoid an unexpected behaviour in the client. It's not "padding", it's part of the data format.
04/17/2018 09:58 Super Aids#9
Quote:
Originally Posted by CptSky View Post
The client is implemented in C++. The Info field, containing the IP address, is passed to other functions as a string, as such, it must be terminated by a NUL character. An IPv4 address can takes at most 16 bytes when represented in a C-string. It's important to put the NUL character to avoid an unexpected behaviour in the client. It's not "padding", it's part of the data format.
Ah yeah of course.