So im trying to upgrade p4n's alchemy proxy to work with the 5700+ pservers everything works fine until the client's DH pack is received its encrypted into bullshit by the proxy and i really have no idea why is that happening
i did both but after some research i found out the the problem isn't in the cryptography anyway its possibly in the way the proxy handles the client DHkey pack not the structure itself ill try and figure this out now thnx anywayQuote:
If it's getting to game server then you have everything working as far as login server is concerned.
You simply need to upgrade the dhkey exchange packets (client and server) as well as the encryption itself.
Quote:
i did both but after some research i found out the the problem isn't in the cryptography anyway its possibly in the way the proxy handles the client DHkey pack not the structure itself ill try and figure this out now thnx anyway
Edit:everything seems to work fine even after the DHkey exchange but then the Packets sent from the server are fucked up don't know what's wrong i logged the lengths of the game packets identified in them they are always like 12252 and some random big numbers
before i started this i tested a pserver source on the client and it worked i have been using that source as a reference for cryptography and packet structures and i checked the DHkey packs in the proxy multiple times and im also logging the keys to see if it works every time i run the proxy and till now every time it worked correctly so i don't think that the packet structures are the problem but i'll check again thnx for your help :)Quote:
This means you've not structured the DHKey packet structures properly. Their packet structures are not obvious as they are trying to hide data inside of them.
Look at an updated pserver source to get an idea for how the packets should be structured. Much of it is 'junk' data just there to hide the real information you're looking for.
well since i log all the keys and they always return meaningful strings then i don't think there is a problem with the cryptography or the packet structQuote:
The first packets you receive are the exchange keys. You need to read the correect offsets to pull the key from them and if you are not getting the correct key then either.
A: You are not using the correct encryption (which you should have already updated)
B: You are not reading the packet structure properly
Once you have the key you need to generate your own custom client exchange packet and server exchange packet using the proper structures to complete the man in the middle attack and finalize both sets of encryption.
So yes.. the only things that CAN go wrong assuming you've hit the game server is the game encryption or the exchange process.
static void SetUpCrypto(Client C)
{
try
{
BigNumber RealClientPublicKey = BigNumber.FromHexString(C.ClientDataDHP.Client_PubKey);
BigNumber RealServerPublicKey = BigNumber.FromHexString(C.ServerDataDHP.Server_PubKey);
GameCrypto ClientCrypto = new GameCrypto((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey));
GameCrypto ServerCrypto = new GameCrypto((C.ServerCrypt).DH.ComputeKey(RealClientPublicKey));
ClientCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ClientIV;
ClientCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ClientIV;
C.ClientCrypt = ClientCrypto;
C.ServerCrypt = ServerCrypto;
C.Exchanging = false;
}
catch { }
}
static void SetUpCrypto(Client C)
{
try
{
BigNumber RealClientPublicKey = BigNumber.FromHexString(C.ClientDataDHP.Client_PubKey);
BigNumber RealServerPublicKey = BigNumber.FromHexString(C.ServerDataDHP.Server_PubKey);
GameCrypto ClientCrypto = new GameCrypto((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey));
GameCrypto ServerCrypto = new GameCrypto(C.ClientDataDHP.DHKey((C.ServerCrypt).DH.ComputeKey(RealClientPublicKey)));
ClientCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ClientIV;
ClientCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ClientIV;
C.ClientCrypt = ClientCrypto;
C.ServerCrypt = ServerCrypto;
C.Exchanging = false;
}
catch { }
}
GameCrypto ClientCrypto = new GameCrypto((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey));
GameCrypto ClientCrypto = new GameCrypto(C.ServerDataDHP.DHKey((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey)));