|
You last visited: Today at 22:16
Advertisement
[Help Explain] Packets and lengths!
Discussion on [Help Explain] Packets and lengths! within the CO2 Private Server forum part of the Conquer Online 2 category.
09/26/2013, 15:36
|
#1
|
elite*gold: 153
Join Date: Mar 2011
Posts: 634
Received Thanks: 489
|
[Help Explain] Packets and lengths!
Hey All, i understand something in them, but i still need to know more! 
As example we will work on sending packet to Conquer Online Server to buy an item from the shop (with Bound/Normal CPs).
The Packets received :
PHP Code:
5C 00 F1 03 97 2F A4 02 48 0B 00 00 01 9A 10 00 01 00 00 00 FA D4 BB 02 11 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 51 43 6C 69 65 6E 74
After Analyzing.. :
PHP Code:
ID : 1009
Size : 92
Full Size at offset 0 = 100 (+8)
It's okay! Now for the offsets :
| Offset | Value | | 0 | 5C | | 1 | 00 | | 2 | F1 | | 3 | 03 | | 4 | 97 | | 5 | 2F | | 6 | A4 | | 7 | 02 | | 8 | 48 | | 9 | 0B | | 10 | 00 | | 11 | 00 | | 12 | 01 | | 13 | 9A | | 14 | 10 | | 15 | 00 | | 16 | 01 | | 17 | 00 | | 18 | 00 | | 19 | 00 | | 20 | FA | | 21 | D4 | | 22 | BB | | 23 | 02 | | 24 | 11 | | 25 | 00 | | 26 | 00 | | 27 | 00 | | 28 | 00 | | 29 | 00 | | 30 | 00 | | 31 | 00 | | 32 | 02 | | 33 | 00 | | 34 | 00 | | 35 | 00 | | 36 | 00 | | 37 | 00 | | 38 | 00 | | 39 | 00 | | 40 | 00 | | 41 | 00 | | 42 | 00 | | 43 | 00 | | 44 | 00 | | 45 | 00 | | 46 | 00 | | 47 | 00 | | 48 | 00 | | 49 | 00 | | 50 | 00 | | 51 | 00 | | 52 | 00 | | 53 | 00 | | 54 | 00 | | 55 | 00 | | 56 | 00 | | 57 | 00 | | 58 | 00 | | 59 | 00 | | 60 | 00 | | 61 | 00 | | 62 | 00 | | 63 | 00 | | 64 | 00 | | 65 | 00 | | 66 | 00 | | 67 | 00 | | 68 | 00 | | 69 | 00 | | 70 | 00 | | 71 | 00 | | 72 | 00 | | 73 | 00 | | 74 | 00 | | 75 | 00 | | 76 | 00 | | 77 | 00 | | 78 | 00 | | 79 | 00 | | 80 | 00 | | 81 | 00 | | 82 | 00 | | 83 | 00 | | 84 | 00 | | 85 | 00 | | 86 | 00 | | 87 | 00 | | 88 | 00 | | 89 | 00 | | 90 | 00 | | 91 | 00 | | 92 | 54 | | 93 | 51 | | 94 | 43 | | 95 | 6C | | 96 | 69 | | 97 | 65 | | 98 | 6E | | 99 | 74 |
That's okay! Friend told me that :
PHP Code:
Offset 0 - 0x5C
Offset 2 - 0x3F1
Offset 4 - timestamp
Offset 8 - NpcID
Offset 12 - Itemtype
Offset 16 - Flag - 0x1 to buy an item.
Offset 20 - timestamp
Offset 24 - Quantity/ amount of items to buy
Offset 32 - Flag/ Currency. - 0x2 For boundCPs
Then i knew which offsets i will need, so i created this :
PHP Code:
public static byte[] TQClient = System.Text.ASCIIEncoding.ASCII.GetBytes("TQClient");
public void SendServer(byte[] buffer, _Player Player)
{
for (int i = buffer.Length - 8, j = 0; i < buffer.Length; i++, j++)
buffer[i] = TQClient[j];
Player.ToServer.SendData(buffer);
}
public void BuyShopBoundCPS(_Player Player, int npcid, int itemtype, int amount)
{
Game.ItemUsage usage = new Game.ItemUsage(true);
int size = 92;
byte[] buffer = new byte[size + 8];
Writer.WriteUInt16(92, 0, buffer);
Writer.WriteUInt16(1009, 2, buffer);
Writer.WriteUInt32(usage.TimeStamp1, 4, buffer);
Writer.WriteInt32(npcid, 8, buffer);//2888 Shop!
Writer.WriteInt32(itemtype, 12, buffer);
Writer.WriteUInt32(1, 16, buffer);
Writer.WriteUInt32(usage.TimeStamp2, 20, buffer);
Writer.WriteInt32(amount, 24, buffer);
Writer.WriteUInt16(2, 32, buffer);// 1 for Normal Cps, 2 for Bound Cps!
SendServer(buffer, Player);
}
And it works.. That's not the problem.. The problem is i got 92 offsets! most of them value is 0! what about the others. I used just 9 offsets! "0,2,4,8,12,16,20,24,32" what about the others?!!! If my friend didn't tell me that i have to use these! I wouldn't be able to make this!
That's for Sending packets to Conquer Online Server. And i need you to explain it for Conquer Online Private Server Source too! 
What makes me choose which Packet i need.
and for other thing.. I got the packet for compose in Conquer Online Source (Packet : 2036) It works okay! but if i want to make "Quick (+)" To work or "Batch", how to get there length?!
Thanks a lot!
|
|
|
09/26/2013, 18:26
|
#2
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Its called padding.
|
|
|
09/26/2013, 20:08
|
#3
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
|
(eny afhm kelma mafesh).
Translation: i don't get it
|
|
|
09/26/2013, 22:15
|
#4
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Each packet type is often used for many different purposes (subtypes). Many of the values will not be used in certain subtypes but the packet length remains the same simply because it's simpler that way.
EG: Here's usage instructions written in plain english.
"I'm going to tell you how to use something" (packet type)
"I'm going to give you up to 20 steps" (packet length)
"I'm telling you how to use a comb" (subtype)
"Use your fancy comb" (item UID)
"Use it on your hairz!" (target UID)
The rest of the steps are still there but are blank simply because you've done your task. They may be needed if the task is more complicated (different subtype) and so they are still there as part of the packet.
In your example it's because when you equip items the server will reply by filling in those un-used offsets with all of the item uid's you currently have equipped (updates your visible character)
So yes, hope that helps
|
|
|
09/27/2013, 22:14
|
#5
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Quote:
Originally Posted by pro4never
"Use it on your hairz!" (target UID)
|
But I am bald   
|
|
|
09/27/2013, 22:31
|
#6
|
elite*gold: 153
Join Date: Mar 2011
Posts: 634
Received Thanks: 489
|
Quote:
Originally Posted by Korvacs
Its called padding.
|
.... What's called ... ?!
Quote:
Originally Posted by abdoumatrix
(eny afhm kelma mafesh).
Translation: i don't get it 
|
Lol.. I don't know what i have to do to explain more than this!
Quote:
Originally Posted by pro4never
Each packet type is often used for many different purposes (subtypes). Many of the values will not be used in certain subtypes but the packet length remains the same simply because it's simpler that way.
EG: Here's usage instructions written in plain english.
"I'm going to tell you how to use something" (packet type)
"I'm going to give you up to 20 steps" (packet length)
"I'm telling you how to use a comb" (subtype)
"Use your fancy comb" (item UID)
"Use it on your hairz!" (target UID)
The rest of the steps are still there but are blank simply because you've done your task. They may be needed if the task is more complicated (different subtype) and so they are still there as part of the packet.
In your example it's because when you equip items the server will reply by filling in those un-used offsets with all of the item uid's you currently have equipped (updates your visible character)
So yes, hope that helps
|
   
Thanks for explaining this part.. But that's not exactly what i want! Yes i benefit from these! But still don't understand what i want to understand!  )
I guess you still didn't get it clear!  And i don't know what should i do to explain it more!
About subtypes, How to know the offset of the subtype that i want (As example as i said about Quick and Batch for composing packet)!
|
|
|
09/27/2013, 22:36
|
#7
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
The empty fields/offsets are called padding. In alot of cases with Conquer Pro is correct, however in some cases they are literally empty fields, there will never be any data there.
|
|
|
09/27/2013, 23:14
|
#8
|
elite*gold: 153
Join Date: Mar 2011
Posts: 634
Received Thanks: 489
|
Quote:
Originally Posted by Korvacs
The empty fields/offsets are called padding. In alot of cases with Conquer Pro is correct, however in some cases they are literally empty fields, there will never be any data there.
|
How to compare between them and the needed offsets to make the packet work?! 
How to know which offsets needed to make it work?!  I guess that's the right question?!
|
|
|
09/27/2013, 23:36
|
#9
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Trial/Error or reversing the packets from the client.
|
|
|
09/28/2013, 01:26
|
#10
|
elite*gold: 153
Join Date: Mar 2011
Posts: 634
Received Thanks: 489
|
Quote:
Originally Posted by Super Aids
Trial/Error or reversing the packets from the client.
|
Okay, fine. The packet that i created up!! Working but i get DC after buying the items if the amount is more than 1! if i buy with amount 1, it's working!
And i used the Packet Logger again and got the packets the same and i realized that TimeStamp1's value is not equal TimeStamp2's 2 .. I don't know.. it could be something missing?!  )
|
|
|
09/28/2013, 15:57
|
#11
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
|
Quote:
Originally Posted by GameHacker-PM-
Okay, fine. The packet that i created up!! Working but i get DC after buying the items if the amount is more than 1! if i buy with amount 1, it's working!
And i used the Packet Logger again and got the packets the same and i realized that TimeStamp1's value is not equal TimeStamp2's 2 .. I don't know.. it could be something missing?!  )
|
Timestamp - Wikipedia, the free encyclopedia
|
|
|
09/28/2013, 20:07
|
#12
|
elite*gold: 153
Join Date: Mar 2011
Posts: 634
Received Thanks: 489
|
Quote:
Originally Posted by CptSky
|
Thanks, but that doesn't help at all!
|
|
|
09/28/2013, 20:15
|
#13
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
|
Quote:
Originally Posted by GameHacker-PM-
Thanks, but that doesn't help at all! 
|
It explains why timestamps won't be equal
|
|
|
09/28/2013, 20:46
|
#14
|
elite*gold: 153
Join Date: Mar 2011
Posts: 634
Received Thanks: 489
|
Quote:
Originally Posted by CptSky
It explains why timestamps won't be equal 
|
That's good, but it still doesn't help!  ))
I'm asking, How to fix it?!  )
|
|
|
09/28/2013, 20:49
|
#15
|
elite*gold: 0
Join Date: Dec 2010
Posts: 105
Received Thanks: 13
|
Your timestamps are off so the client disconnects you...
|
|
|
 |
|
Similar Threads
|
[Release] +5500 Packets structure , client/packets constants
10/07/2012 - CO2 PServer Guides & Releases - 10 Replies
edit : if u know nothing about packets go to this post first
explaining what is packets , and explaining a packet with details and everything
http://www.elitepvpers.com/forum/co2-pserver-disc ussions-questions/2162344-packets-packets-packets. html#post19074533
i start making my very own packet structure to use them on my new proxy but i thought of ripping them from the source
so yeah the following packets is ripped of trinity base source
right now im just providing the packets structure...
|
[REQUEST] packets send list , or anyway to sniff send packets
08/10/2012 - Kal Online - 16 Replies
hey everyone , as mentioned , i wanna know if anyone got a complete send packets lists or anyway i can sniff send packets , thanks in advance
|
Anyone can explain this?
01/12/2012 - 9Dragons - 2 Replies
Ok so i'm trying to find the Casting Time & Recast CE adresses for D9 TH...
I actually found them but this is what happens:
- If I activate no Recast. The first charge does dmg, the 2nd does not, and then suddenly it starts "cool downing" allthough it says Recast 0 Seconds.
- If I activate No Casting-Time. It just does no damage to the mobs...
Anyone can explain this?
|
Can someone explain and help me
01/06/2012 - CO2 Private Server - 7 Replies
How can I allow the character † to be in a guild name as it comes up as ? currently. Is there anyway?
|
[Packets] Wie änder ich flyff packets?
07/16/2011 - Flyff Private Server - 19 Replies
HeyHo,
Ich würde sehr gerne wissen wie man die Flyff Packets ändert...
ich denke mal Zahlen ändern werden nicht ausreichen oder?
|
All times are GMT +1. The time now is 22:16.
|
|