packets after auth response

03/22/2011 09:14 TomasLT#1
After sending edited authrespond paacket to the client, client still send 80 bytes packet to auth ? and after that client connects to to IP from authresponse? And 1 more question. Why when i send edited authresponde with 127.0.0.1 ip inside, client just closes. Maybe in conquer check it and dont allow to connect to local host ?
03/22/2011 10:29 Korvacs#2
Your correct the client will not connect to 127.0.0.1 without modifications and will close immediately.

What version is the client?
03/22/2011 14:15 iStefan#3
I Don't get it, Why is this important?..
You can use 192.168.1.2 tho.
03/22/2011 14:34 TomasLT#4
I`m using newest client
03/22/2011 15:12 shitboi#5
Quote:
Originally Posted by TomasLT View Post
I`m using newest client
Looking at where you are at, i suppose you got past the auth packet decryptions. Congratz.

If you have added this question in your first post, "how do i solve the client close problem" then korvacs would definitely have given you the answer :). But that doesn't matter since iStefan also mentioned how to do it.

Solution:
Instead of sending 127.0.0.1 to your client, you need to send over your current IP address. You can easily obtain your IPv4 by entering "ipconfig" under command prompt.

If my memory didn't fail me, when i looked at your code from 3 months ago, it's single threaded (just the main). If you have not learnt multi threading yet, don't be afraid, since the basic proxy can be achieved in a single thread.
03/22/2011 16:29 TomasLT#6
but i try what he said and its still closing.
03/22/2011 19:56 iStefan#7
Use 192.168.1.2 instead of 127.0.0.1 you jerk.
03/22/2011 20:14 shitboi#8
Quote:
Originally Posted by TomasLT View Post
but i try what he said and its still closing.
Well... clearly istefan's router's default IP is 192.168.1.XXX. But yours may not be the same. I have used routers which default IP is 192.168.0.XXX, and 192.168.2.XXX.

What ever is the case. I told you to open up your cmd prompt, and enter "ipconfig".

Dude, out of the many threads you started, your questions are usually answered in the first couple replies. You really need to read again and again, understand what people said before asking again.
03/22/2011 20:23 iStefan#9
Quote:
Originally Posted by shitboi View Post
Well... clearly istefan's router's default IP is 192.168.1.XXX. But yours may not be the same. I have used routers which default IP is 192.168.0.XXX, and 192.168.2.XXX.

What ever is the case. I told you to open up your cmd prompt, and enter "ipconfig".

Dude, out of the many threads you started, your questions are usually answered in the first couple replies. You really need to read again and again, understand what people said before asking again.
Talkin' to me?
03/22/2011 20:26 shitboi#10
Quote:
Originally Posted by iStefan View Post
Talkin' to me?
no, i was telling thomas to re-read. Looking through his posts, most of his questions are answered in the first few replies. He need to read harder

Besides, youre not the one asking question
03/22/2011 20:32 TomasLT#11
Quote:
Originally Posted by iStefan View Post
Use 192.168.1.2 instead of 127.0.0.1 you jerk.
jerk ? Maybe and u need to read what i wrote. I said that i tryed to change ip to 192.168.1.2 but it still closes !!

And i`m using mobile network (usb modem), and there is no such as 192.168.X.X . (Checket in cmd -> ping 192.168.x.x = request time out).

And i try to write a proxy only for better java undestanding, but not for selling/releasing it !!!
And thx for help. I believe that everything what u guys wrote works out from first time. Ok Anyway now i know that best friend in this case is google !!!

Thanks for attention.
03/22/2011 21:44 iStefan#12
It closes cuz you are sending wrong packet.
03/23/2011 00:52 TomasLT#13
No. I`m sending the right packets just i use loader with 127.0.0.1 ip. And even after sending authresponse packet with edited ip (not 127.0.0.1) it close.

1 more question :
(wpepro)
what is this packet ? Do i really still send it to authserver after auth response? I thought that after auth responsei start communicate with game server. And does it still use auth crypto ? after that i start receiving bytes from game server.

myipaddress:49985 208.96.34.46:9960 80 Send
02 94 E0 71 76 59 40 60 C5 16 AA B3 84 50 6D F9
40 91 27 82 0B D7 E7 79 C4 16 AD BF 84 55 68 F2
44 9E 2A 33 02 D5 E2 72 C3 10 A0 60 82 5A 63 FB
4E 92 2D 39 C8 D1 2C 3B 80 9A 0F B1 29 5F 6E F4
6A CE 17 D7 46 C0 AF 74 C1 1A A6 B2 80 54 69 FD
03/23/2011 03:47 shitboi#14
ok tomas, i'll take the time to explain this to you one more time, just because you are doing this in java, and there are not that much support around.

Before i begin, i'll restate that what ever i am going to tell you now has been mentioned, but better organized. But i'll be pissed off if you are NOT going to read and understand EVERY word.

1. client detects if the IP in the auth msg is 127.0.0.1, that is a clear sign of proxy usage. So, 127.0.0.1 cannot be used; you know this already through testing.

2. You have to feedback an ip to your client so that it knows what to connect to. All you need to do is to find what your current IP is. Start cmd prompt, type in "ipconfig" without the qoutation marks. Look for [IPv4 address]. If you do not know how to do cmd prompt, go to Control Panel -> Network and Internet -> Network Connections, double click the network adapter you are using -> details, check for IPv4 address. It does not matter what kind of network you are connected to, it will give you a xx.xx.xx.xx address.

Now you know what your IPv4 address is, you have what you want to send to the client.

With this, all your previous questions have been FULLY answered. If you have any doubts, just re-read all my posts.

Regarding the extra packet that client is sending to login server. I do not know what it is, but i have observed that this packet do exist. I have done tests with it, and i found out that this packet is not always sent. and does not matter if you dont send it to auth server. Probably is just some double checking packet only. This is only my perception.

So, this is probably what you should have done.

connect to auth server,
obtain password seed from server, relay to client
get auth request from client, relay to server
get auth msg from server, edit IP (and port depending on your implementation), start a socketlistener game connection, relay auth msg to client.
Then your Log in is complete. ( the last packet that you just detect can be ignored completely)

As for the game packet relay part. Since you already know from auth msg where your game server is, AND you have already set up your socket listener for client connection, simply upon client connect, relay this connection to actual game server. Ignore all the packet encryption for a start.. just concentrate on getting the packets going.

Here is an example
Code:
byte[] packetBuffer = byte[6000]; // some times if you log in on a map with too many players, there will be a huge packet coming.
if (clientGameSocket.available() > 0)//packet buffer has data
{
    int packetSize = clientGameSocket.read(packetBuffer);
    serverGameSocket.write(packetBuffer, packetSize);
}
Just a sample snippet for handling unprocessed packets going from client to server.

Last but not least, I really suggest you sit down with a piece of paper and a pen, sort out your logic before going back to your codes.
That is really all my input, and i do not believe this can be simplified any further.
03/23/2011 12:13 TomasLT#15
Really thx for ur amazing answer. It explains alot. Now time to rewrite it as non-blocking socket.