[HELP] Dragon Source PacketHandler

Newbie Spellweaver
Joined
Aug 10, 2005
Messages
11
Reaction score
1
Hello,
i was tryieng to understand how Dragon FlyFF Sources handles the PAckets.

So at i could see the HEADER_LEN sait where to start to read the Header .
You can see it with a packet sniffer that the first 13 DataBytes E2 INT etc. are skipped.

So my idea was to build an universal emulator or a good source for future development on other pserver Projects (the original was from TitanMS).

For my test, i have a project wher i must read out at the 2. Byte at the Header (in Flyff : directly after the 0x5E).

So this are my Data Header from my client where i have to reakt :

00 41 00 26 10 00 74 65 73 74
00 00 00 00 6F 9A 80 7C 20 00 00 00 00 00 00 00
02 74 65 73 74 00 12 00 00 00 00 00


I thought "ok just changing HEADER_LEN will be solved", but i must set the header len on 1 or 2 , and if i set the header len under 8 or 9, the server didnt accept the packet.

The rest would be easy : Player.cpp , there is the Handler for the Header, and what the Server should execute / send as packet.

but i need to know how this works ...is there someone who nows that / can help?
 
first of all do not change the packet handler. it is set up in a way that it receives all the packets the client sends.

most of the packets sent to the server when in game start with "FF FF FF FF".

You send from the server to the client "5E 00 00 00 00" <---- Length of packet.

after the "FF FF FF FF" int bytes is where the headers begin. now you need to read the next 4 bytes but they are interpreted backwards, meaning if you have something like "01 00 FF FF" it will be read by the handler this way "FF FF 00 01". Remember that the handler can read different header sizes and not just 4 bytes depending on the nature of the packet.

Is what i explained what you are looking for?
 
Okay that explains some things ;)

For my project (its not flyff or maple relatet), i need to change the packet handling.

It is for an old chat client (very unknown, WhoRU), where the packets are not encrypted or have a hard structure ..you only need to read the second byte (after 5E , in FlyFF it would be 5E 00), and then maximal the next 2 bytes to make a decision what to do with this request.

Another Question : the maple story Titan MS files, are there working on the same way as flyff or a "look like way" to read the packets backwards (i only have see that maple uses a decoder and AES decryption).

To better Explain : what i only want, is to read the packet from the first or second Header Byte , cause there stands for what the packet is (41 is for example login/charakter , 50-53 are the Lobbys and so on).

I had tested it with eAthena (just reply static packets on a request), but i think the Dragon FlyFF sources has more possiblitys (cause you can easily create a packet with the packet creator).

Can you short explain where the packethandler turns the reading of the byte ? (if it is short to explain, else i will try to find it out by myself ..i know that you only supports FlyFF Server:)).
 
I haven't really changed or messed with the packet handler, but i believe the code lies in the connection folder under packethandler.cpp i think. Other than that the switch lies in the player.cpp file. check both of those and see which one works better for you.
 
great thanks to you...i have know get it working (but dont ask me how lol, i have changed many things yesterday ), and now i have the only problem of the packet creator , that it creates the packet, but starts with 4 CC bytes (CC CC CC CC), but i think this should be easy to solve ;) if this is solved i will post the files here :)

many thanks to you glaphan.
 
Back