[Question] How do you know what packet what is?

11/28/2010 22:13 JobvdH#1
Im still learning for C#.
But how do i know if i get an Unknown packet error what i need to add?

Thanks in advance!
JobvdH
11/29/2010 13:22 .Beatz#2
Well for example... If you trade someone and you get the Unknown main ID or whatever it is on your server then that is the packet you need to add...

Search on the WIKI I think most of the packets for 5165 (guessing you use that) have been logged.

If you don't know what your doing I would suggest some C# tuts before you try and go any further.
11/29/2010 13:32 JobvdH#3
Quote:
Originally Posted by .Beatz View Post
Well for example... If you trade someone and you get the Unknown main ID or whatever it is on your server then that is the packet you need to add...

Search on the WIKI I think most of the packets for 5165 (guessing you use that) have been logged.

If you don't know what your doing I would suggest some C# tuts before you try and go any further.
Hey thanks for your reply,
im making a 4276 source based on CoFuture.
my problem is when i login or teleport from Npc to map it says
Unknown Type 1010: Packet 139
11/29/2010 14:18 Basser#4
1010 -> General Data

How do you know the packet type?
Every packet the CO client sends should start with a specific header.
int16 - size
int16 - type
after this there are multiple possibilities.
The type is used to recognize the structure and to correctly process the data.

Hope this helps.
11/29/2010 14:33 JobvdH#5
Quote:
Originally Posted by Basser View Post
1010 -> General Data

How do you know the packet type?
Every packet the CO client sends should start with a specific header.
int16 - size
int16 - type
after this there are multiple possibilities.
The type is used to recognize the structure and to correctly process the data.

Hope this helps.
Thanks for this post,
its usefull only could you give an example code for packet 139?

Thanks in advance!
11/29/2010 15:06 |NeoX#6
Gerneral Data Enum on the wiki shows you what it triggers.
11/29/2010 19:40 Basser#7
Packet 139?
Is that the packet count or what?
In case you mean the 'sub type', I don't know what sub type matches 139 (or 0x8B), sorry.
11/30/2010 07:05 pro4never#8
You're looking at a general data subtype.

There are a large number of things it could mean.... Simply figure out what is activating it and look at the actual structure of the packet.

Simple way to do this source independent would be something like...

string Out = "";
for(int I = 0; I < Data.Length; I++)
Out+= Convert.ToString(Data[I], 16) + " ";
Console.WriteLine(Out);

And that will dump the contents of the packet to console. Ideally I'd do it to a text file but that would require me to dig around in sources to find examples lol.

I'd suggest looking at this thread for info on figuring out packets... it's a great resource.

[Only registered and activated users can see links. Click Here To Register...]


Packets are really not complicated to figure out in most cases. You have a few main things to look for in 90 pct of packets...

Length (all packets)
Type (all packets)
Subtype (mostly attack, general data, itemuse/ping)
UID (self, target or item)
Location info (map, x, y)
Timestamp (attack, gendat, itemuse/ping, walk)
Strings (EASY to find... Console.WriteLine(Encoding.ASCII.GetString(Data)) will convert the entire thing and give you an idea if there is reliant unencrypted string info in the packet.)

Outside of those main things which you can EASILY track down there is very little you need to worry about finding in most packets.

Only other things that could be 'hard to find' things are those which are less obvious... Most of the times though you can just figure out what triggers it to find what its used for (IE: same packet every time you loot an item... it's prob either the loot packet or the item info packet coming from server) and then you just need to worry about offsets once you get the base structure (trial and error/using a cmd to change offsets is best way imo). Takes very little time to find almost all of the required stuff for most packets such as item info/spawn entity.
11/30/2010 15:44 JobvdH#9
Quote:
Originally Posted by pro4never View Post
You're looking at a general data subtype.

There are a large number of things it could mean.... Simply figure out what is activating it and look at the actual structure of the packet.

Simple way to do this source independent would be something like...

string Out = "";
for(int I = 0; I < Data.Length; I++)
Out+= Convert.ToString(Data[I], 16) + " ";
Console.WriteLine(Out);

And that will dump the contents of the packet to console. Ideally I'd do it to a text file but that would require me to dig around in sources to find examples lol.

I'd suggest looking at this thread for info on figuring out packets... it's a great resource.

[Only registered and activated users can see links. Click Here To Register...]


Packets are really not complicated to figure out in most cases. You have a few main things to look for in 90 pct of packets...

Length (all packets)
Type (all packets)
Subtype (mostly attack, general data, itemuse/ping)
UID (self, target or item)
Location info (map, x, y)
Timestamp (attack, gendat, itemuse/ping, walk)
Strings (EASY to find... Console.WriteLine(Encoding.ASCII.GetString(Data)) will convert the entire thing and give you an idea if there is reliant unencrypted string info in the packet.)

Outside of those main things which you can EASILY track down there is very little you need to worry about finding in most packets.

Only other things that could be 'hard to find' things are those which are less obvious... Most of the times though you can just figure out what triggers it to find what its used for (IE: same packet every time you loot an item... it's prob either the loot packet or the item info packet coming from server) and then you just need to worry about offsets once you get the base structure (trial and error/using a cmd to change offsets is best way imo). Takes very little time to find almost all of the required stuff for most packets such as item info/spawn entity.
Thanks for ur reply, it helped me allot!
Getting more stuff inside my head about how C# works etc.

#Request Close