Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Dekaron > Dekaron Private Server
You last visited: Today at 16:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]Proxy / PacketSniffer

Discussion on [Release]Proxy / PacketSniffer within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
GrandSlam's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 121
Received Thanks: 39
[Release]Proxy / PacketSniffer

Ok well here is a little project I have been working on. It does what it needs to do. This is for anyone who is into developing like packet based stuff.

This is my first project I've worked on dealing with C# and sockets from the ground up.




How to use
1. Get IP of the server of you're choosing (Except DK Evolution).
2. You can either change the usual places for IP's to 127.0.0.1:7880 or IP of you're choosing and ports 50005 for the game server.
3. Use a dll to redirect the connect function to 127.0.0.1 or IP of you're choosing for the authentication.
4. In the Config.ini the ExternalIP is the Server IP, and the ProxyIP is the IP for the client to connect to.

Bugs:
  • Packets does not send properly, Even though I encrypt it. (I cannot figure out why)
If you find any quirks, or things that don't work well let me know.

For those looking for packet structure. (-Credits- Nebular)
Code:
0 - Packet CRC (calculated/checked by upon encryption/decryption)
4 - Number (starts from 0; synchronization,GG’s CSA are not counted)
6 - Size (header+data => 16bytes minimum )
8 - Timestamp (used to distinguish between requests/responces in some commnads)
12 - Command (Describes what action to take)
16 - Data (optional; varies in size and not all areas of it are always used)
I believe the problem with sending a packet to either Server or Client is because of the first 4 bytes which is the crc, the Packet counter, and the Timestamp which I have no idea how to handle or even go about. I've read stuff based on Environment.Tick for a timestamp but yeaaaaa. I'm stuck on that part.


If anyone knows how to send a packet correctly PM me
If you have ideas on bigger packet based projects or would like to help me out My MSN is



UPDATE:
I have fixed the reconnection issue. You can now log out, log in, change character without the proxy crashing etc. I have taken out Send functionality till I can resolve that issue DCing when sending a packet to either Server or Client.
Attached Files
File Type: zip Update-1-DKProxy.zip (48.0 KB, 82 views)
GrandSlam is offline  
Thanks
9 Users
Old 09/05/2011, 01:04   #2
 
Zektor's Avatar
 
elite*gold: 40
Join Date: Aug 2007
Posts: 618
Received Thanks: 441
Why don't you catch the exception to find out why it's crashing?
Zektor is offline  
Old 09/05/2011, 01:09   #3
 
GrandSlam's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 121
Received Thanks: 39
Quote:
Originally Posted by Zektor View Post
Why don't you catch the exception to find out why it's crashing?
I have exception handling there, but it just crashes no matter what. I'll probably just log it to a file to get around that.

EDIT: Yea it closes before the exception can be logged or displayed. Logging it to a file didn't work either, So i used SmartAssembly's Self-Diagnostic to check the programs crashes.
GrandSlam is offline  
Old 09/05/2011, 20:11   #4
 
MaGNoX's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 109
Received Thanks: 13
i'm not a player of DK but may i just ask if i can use this to bypass north american IP for the game i'm playing??
MaGNoX is offline  
Old 09/05/2011, 23:36   #5
 
Zektor's Avatar
 
elite*gold: 40
Join Date: Aug 2007
Posts: 618
Received Thanks: 441
Quote:
Originally Posted by GrandSlam View Post
I have exception handling there, but it just crashes no matter what. I'll probably just log it to a file to get around that.

EDIT: Yea it closes before the exception can be logged or displayed. Logging it to a file didn't work either, So i used SmartAssembly's Self-Diagnostic to check the programs crashes.
Wrap the entire code section with a try{catch{}}
And show the messagebox like this
MessageBox.Show(exception.ToString());
Zektor is offline  
Thanks
1 User
Old 09/06/2011, 00:41   #6
 
GrandSlam's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 121
Received Thanks: 39
Quote:
Originally Posted by Zektor View Post
Wrap the entire code section with a try{catch{}}
And show the messagebox like this
MessageBox.Show(exception.ToString());
Yea I found out my problem. Since I'm using a dll to redirect my connection, I forgot that I kept forcing the client to use port 7880 instead of redirecting the IP I was doing both. So I was working based on the idea that the client was connecting to 50005 while being redirected.

But I've fixed both my problems with the logging out issue.
GrandSlam is offline  
Old 09/13/2011, 10:49   #7
 
elite*gold: 0
Join Date: Dec 2007
Posts: 1,238
Received Thanks: 387
CryptKey does change when you connect to any channels.
CryptKey = buffer[24] ^ buffer[28]; from handshake reply (server packet).

buffer[24] = cryptkeyLowbyte
buffer[28] = cryptkeyHigbyte

CryptKey is used to encrypt packets.

You can change the packet timestamp to 0. Server doesn't check time on packet when u send it.
EliteDKTrader is offline  
Thanks
1 User
Old 09/15/2011, 07:28   #8
 
GrandSlam's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 121
Received Thanks: 39
Quote:
Originally Posted by EliteDKTrader View Post
CryptKey does change when you connect to any channels.
CryptKey = buffer[24] ^ buffer[28]; from handshake reply (server packet).

buffer[24] = cryptkeyLowbyte
buffer[28] = cryptkeyHigbyte

CryptKey is used to encrypt packets.

You can change the packet timestamp to 0. Server doesn't check time on packet when u send it.
Thanks, I get the crypt key no problem but the problem is still how the packet encrypts. Either I'm completely missing something, or my buffer gets messed up on the encryption or something. I'm trying to resolve it now. With a Flagbyte of 0x16, Cryptkey = 0x0F.

When I get the cryptkey from 20081 (8100200) *Handshake Reply*

and I use that, It still doesn't work.
GrandSlam is offline  
Old 09/15/2011, 17:55   #9
 
Zektor's Avatar
 
elite*gold: 40
Join Date: Aug 2007
Posts: 618
Received Thanks: 441
You should take a look at my threads, it's just one byte in the packet that represents the XOR key (I can't remember which byte but it's in my thread)

Strings are null terminated, so if you see your name and then a bunch of random strings ignore them (they don't get parsed by the client/server).
edit:
Code:
        public static byte[] CryptBody(byte[] PacketData, int len)
        {
            if (len <= 14 || PacketData[14] == 0x00)
            {
                return PacketData;
            }
            byte[] DecryptedData = new byte[len];
            ulong key = PacketData[14];
            for (int i = 0; i < 12; i++)
            {
//We leave the checksum/timestamp alone
                DecryptedData[i] = (byte)(PacketData[i]);
            }
            for (int i = 12; i < len; i++)
            {
//XOR the value to it self 
                DecryptedData[i] = (byte)(PacketData[i] ^ key);
            }
            return DecryptedData;
        }
Zektor is offline  
Thanks
1 User
Old 09/16/2011, 03:05   #10
 
GrandSlam's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 121
Received Thanks: 39
I got it now, Gonna post up a video soon.

Using what EliteDKTrader of getting buffer[24] and buffer[28] Gives the flagbyte and the XOR'ing that value by 0x19 gives be the crypt key for the session.

I was looking through the decryption routine and was like hmmmm let me test it out and it worked! So i can now send a packet correctly to client and server! Going to keep on testing just to make sure it doesn't weird out or so something funky before I update the thread.

So yes thank you for the help guys i REALLY appreciate it, as I am learning how to code and how everything works as I go along, and the help from ya'll have gotten me to figure it out. So thank you!

Edit: Looks like you can't send just anything to the server, like a chat packet, you can send it back to the client though, but not to the server
GrandSlam is offline  
Old 12/28/2015, 15:05   #11
 
Naniooooo's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 1,042
Received Thanks: 149
what im doing wrong
do i need proxy program ?



System.Net.Sockets.SocketException (0x80004005): Only one usage of each socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at (Object , EndPoint )
at A.cea78dd7300b5ee57add85aba47ea738d.cf130e3c72e649 c16b5ded18e0bec6ca8(Object , EndPoint )
at A.c3a9cd10b73bc9ab90eb81bc5421c35be..ctor(Int32 , Int32 , cffddba850fd5ad588615b8e57cbea576 )
at A.c5fe356fd1e36f2a7bc2d13bbe59f9761..ctor()
[DekaronProxy]Start Listening on 192.168.1.4
[DekaronProxy]GameIP = 51.254.211.176
[DekaronProxy]AuthPort = 50905 GamePort = 50005
[DekaronProxy]Setup Complete. Ready for Connections..
Naniooooo is online now  
Old 01/04/2016, 15:25   #12
 
elite*gold: 0
Join Date: Apr 2007
Posts: 316
Received Thanks: 94
Interesting. This may help in my strive for an Emulator of Dekaron.
ADHDKiD is offline  
Old 02/02/2016, 21:46   #13
 
LogLife's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 260
Received Thanks: 17
can give me source code ?
LogLife is offline  
Reply


Similar Threads Similar Threads
job as PacketSniffer
06/30/2010 - Silkroad Online - 3 Replies
hello i want join to any project "bot or other program thet need packet" as packet sniffer.
[Source] PacketSniffer
12/28/2009 - Kal Hacks, Bots, Cheats & Exploits - 11 Replies
Well, another little Christmas present for you :p Not posting the whole thing, just important parts, you can probably find the rest in ZeroTen's pserver source. Some of this stuff is from Hijax source, which he released here a few month ago. Removed for some reasons. PM me for some tipps ;D You need MS detours 1.5 to use this. And before anyone(bloodx :p ) starts flaming, I know it's ugly written :p
Packetsniffer
12/24/2009 - Kal Online - 3 Replies
Hello guys, pls no offense this gonna be a nub question :p is there any working packetsniffer for kalonline?
Shaiya DE Packetsniffer
12/13/2009 - Shaiya Hacks, Bots, Cheats & Exploits - 6 Replies
outdated
Packetsniffer
10/12/2006 - General Coding - 2 Replies
Hi Can someone give me a packetsniffer ? Because i can't find one.



All times are GMT +1. The time now is 16:23.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.