[Help Explain] Packets and lengths!

09/26/2013 15:36 GameHackerPM#1
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 :

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 
Quantityamount of items to buy
Offset 32 
FlagCurrency. - 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 80buffer.Lengthi++, j++)
                
buffer[i] = TQClient[j];
            
Player.ToServer.SendData(buffer);
        }
        public 
void BuyShopBoundCPS(_Player Playerint npcidint itemtypeint amount)
        {
            
Game.ItemUsage usage = new Game.ItemUsage(true);
            
int size 92;
            
byte[] buffer = new byte[size 8];
            
Writer.WriteUInt16(920buffer);
            
Writer.WriteUInt16(10092buffer);
            
Writer.WriteUInt32(usage.TimeStamp14buffer);
            
Writer.WriteInt32(npcid8buffer);//2888 Shop!
            
Writer.WriteInt32(itemtype12buffer);
            
Writer.WriteUInt32(116buffer);
            
Writer.WriteUInt32(usage.TimeStamp220buffer);
            
Writer.WriteInt32(amount24buffer);
            
Writer.WriteUInt16(232buffer);// 1 for Normal Cps, 2 for Bound Cps!
            
SendServer(bufferPlayer);
        } 
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! :D :D
09/26/2013 18:26 Korvacs#2
Its called padding.
09/26/2013 20:08 abdoumatrix#3
(eny afhm kelma mafesh).
Translation: i don't get it :D
09/26/2013 22:15 pro4never#4
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 Super Aids#5
Quote:
Originally Posted by pro4never View Post
"Use it on your hairz!" (target UID)
But I am bald :(:(:(:(
09/27/2013 22:31 GameHackerPM#6
Quote:
Originally Posted by Korvacs View Post
Its called padding.
.... What's called ... ?!
Quote:
Originally Posted by abdoumatrix View Post
(eny afhm kelma mafesh).
Translation: i don't get it :D
Lol.. I don't know what i have to do to explain more than this! :pimp:
Quote:
Originally Posted by pro4never View Post
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
:handsdown::handsdown::handsdown::handsdown:
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! :rolleyes:

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)! :D
09/27/2013 22:36 Korvacs#7
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 GameHackerPM#8
Quote:
Originally Posted by Korvacs View Post
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?!:D
09/27/2013 23:36 Super Aids#9
Trial/Error or reversing the packets from the client.
09/28/2013 01:26 GameHackerPM#10
Quote:
Originally Posted by Super Aids View Post
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 CptSky#11
Quote:
Originally Posted by GameHacker-PM- View Post
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 GameHackerPM#12
Quote:
Originally Posted by CptSky View Post
Thanks, but that doesn't help at all! :rolleyes:
09/28/2013 20:15 CptSky#13
Quote:
Originally Posted by GameHacker-PM- View Post
Thanks, but that doesn't help at all! :rolleyes:
It explains why timestamps won't be equal :rolleyes:
09/28/2013 20:46 GameHackerPM#14
Quote:
Originally Posted by CptSky View Post
It explains why timestamps won't be equal :rolleyes:
That's good, but it still doesn't help! :)))
I'm asking, How to fix it?! :))
09/28/2013 20:49 Smallxmac#15
Your timestamps are off so the client disconnects you...