Quote:
Originally Posted by Korvacs
....to decrypt a message you use the decrypt method, to encrypt a message you use the encrypt method...
Maybe you should google basic cryptography terms before you try anything to do with it.
|
I got my guidlines

(Links to C@de Xpl0sion). The author suggested encrypt and decrypt functions were designed to operate between client and proxy. "Encrypt() also decrypts encrypted packets from Server, while decrypt encrypts the decrypted packet".
I realized i made a mistake while coding and thus suspected that his guide is wrong or out dated. But yes he is right. The above codes unknownone supplied indeed works as described by the author of the guide. This is the proof
Codes are written in java
Code:
//get AuthPasswordSeed
System.out.print(place+ " Obtain password seed :");
numRead = fromServer.read(packetBuf);
packet = trimPacket(packetBuf, numRead);
apc.[B]Encrypt[/B](packet);
printPacket(packet,packet.length);
apc.[B]Decrypt[/B](packet);
toClient.write(packetBuf, 0, numRead);
System.out.println("complete");
Code:
//get AuthResponse
System.out.print(place+" Authorization response :");
numRead = fromServer.read(packetBuf);
System.out.println("obtained, length = "+numRead);
packet = trimPacket(packetBuf, numRead);//resize packet to real packet size (note: packetBuf is 512!!!)
apc.[B]Encrypt[/B](packet);
//System.out.println(place+" Decrypted Auth Response packet length :"+packet.length);
printPacket(packet,packet.length);
System.out.print(place+" Extracting game server info :");
obtainGameServerInfo(packet);
System.out.println(server_info_buffer.ip + ":"+ server_info_buffer.port);
//editGameServerInfo(packet);
displayAuthResponse(packet);
apc.Decrypt(packet);
toClient.write(packetBuf, 0, numRead);
This is the output: Logged into capricon with a noob account.
Code:
@Auth Proxy : Client connected
[GameProxy] : Thread started
[AuthProxy] Connecting to :208.96.34.46 on port 9959
[AuthProxy] Obtain password seed :8 0 35 4 118 82 120 10
complete
[AuthProxy] Sending authorization request :complete
[AuthProxy] Authorization response :obtained, length = 52
52 0 31 4 -84 54 85 0 35 20 8 18 -72 22 0 0 -68 93 85 0 54 57 46 53 57 46 49 53 53 46 50 49 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[AuthProxy] Extracting game server info :69.59.155.212
However, i do have one question regarding forward packets to client.
In order to make my client connect to proxy instead of game server. I need to edit the IP blocks in the Auth Response packet. For example. I received this Auth Response Packet
Code:
52 0 31 4 -84 54 85 0 -28 126 -127 75 [COLOR="Blue"]-72 22 0 0[/COLOR] -68 93 85 0 [COLOR="Red"]54 57 46 53 57 46 49 53 53 46 50 49 50 0 0 0[/COLOR] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Highlighted in blue is the port number, and Red is the IP = 69.59.155.212
So, I should edit the IP field of this packet to 127.0.0.1, as follows.
Code:
52 0 31 4 -84 54 85 0 -117 87 -78 104 [COLOR="Blue"]-72 22 0 0[/COLOR] -68 93 85 0 [COLOR="Red"]49 50 55 46 48 46 48 46 49 0 0 0 0 0 0 0[/COLOR] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Even after so ... the client still logs into the actual game server rather than logging into my proxy. Did i get somewhere wrong?
[EDIT]: F&ck ... i realized my problem. I gave client the packet instead of giving it the edited packet. Thanks for bothering to reply korvac