Register for your free account! | Forgot your password?

You last visited: Today at 22:03

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

Advertisement



My Packet Build

Discussion on My Packet Build within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
My Packet Build

Well i Was Learning about Constrcuting packets So here my example of nameChange packet Building

Heres My Code

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Conquer_Online_Server.Network.GamePackets
{
    class NameChange : Writer, Interfaces.IPacket
    {
        byte[] Buffer;
        public NameChange(bool Create)
        {
            if (Create)
            {
                Buffer = new byte[26 + 8];
                WriteUInt16(26, 0, Buffer);
                WriteUInt16(2080, 2, Buffer);
            }
        }
        public byte[] ToArray()
        {
            return Buffer;
        }
        public void Deserialize(byte[] buffer)
        {
            Buffer = buffer;
        }
        public void Send(Client.GameState client)
        {
            client.Send(Buffer);
        }
    }
}
So my question now is it built Right or smthing should be added ?
shadowman123 is offline  
Old 01/14/2012, 03:30   #2
 
Arco.'s Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
Considering there are 26 bytes in the packet, I'm sure there must be something else to the packet.
Arco. is offline  
Old 01/14/2012, 14:55   #3
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by Arco. View Post
Considering there are 26 bytes in the packet, I'm sure there must be something else to the packet.
what do u mean by that i dont understand u really ..Could u explain ?
shadowman123 is offline  
Old 01/14/2012, 15:18   #4

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
It could be me but it looks like you're not sending any data.
Kiyono is offline  
Old 01/14/2012, 15:25   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Your only sending the packet's header.

Ie. Length and Type.

The packet should then have a body which contains fields...
Korvacs is offline  
Old 01/14/2012, 18:39   #6
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by Korvacs View Post
Your only sending the packet's header.

Ie. Length and Type.

The packet should then have a body which contains fields...
u mean using smthing like that ?? if so how to know the right offsets and how to know the number of public uint which should be made ?

Code:
public uint Attacker
        {
            get { return BitConverter.ToUInt32(Buffer, 8); }
            set { Writer.WriteUInt32(value, 8, Buffer); }
        }

        public uint Attacked
        {
            get { return BitConverter.ToUInt32(Buffer, 12); }
            set { Writer.WriteUInt32(value, 12, Buffer); }
        }
        public Conquer_Online_Server.Network.GamePackets.SpellUse.EffectValue FirstEffect
        {
            get { return (Conquer_Online_Server.Network.GamePackets.SpellUse.EffectValue)Buffer[32]; }
            set { Writer.WriteByte((byte)value, 32, Buffer); }
        }
shadowman123 is offline  
Old 01/14/2012, 19:25   #7

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by shadowman123 View Post
u mean using smthing like that ?? if so how to know the right offsets and how to know the number of public uint which should be made ?

Code:
public uint Attacker
        {
            get { return BitConverter.ToUInt32(Buffer, 8); }
            set { Writer.WriteUInt32(value, 8, Buffer); }
        }

        public uint Attacked
        {
            get { return BitConverter.ToUInt32(Buffer, 12); }
            set { Writer.WriteUInt32(value, 12, Buffer); }
        }
        public Conquer_Online_Server.Network.GamePackets.SpellUse.EffectValue FirstEffect
        {
            get { return (Conquer_Online_Server.Network.GamePackets.SpellUse.EffectValue)Buffer[32]; }
            set { Writer.WriteByte((byte)value, 32, Buffer); }
        }
How do you know for sure that only ints are used? You have 26 bytes so it's very well possible for the packet to have other things such as:
byte = 1 byte
short = 2 bytes
int = 4 bytes
long = 8 bytes
And you can get offsets from trial and error/take them from other sources/packetlogging.
Kiyono is offline  
Old 01/14/2012, 19:27   #8


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Sure thats one way of doing it. You need to research the correct offsets which each packet contains, my packet wiki is one source of info, other server sources also contain packet structures, and you can find them out yourself by packet sniffing.
Korvacs is offline  
Old 01/14/2012, 20:06   #9
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by Kiyono View Post
How do you know for sure that only ints are used? You have 26 bytes so it's very well possible for the packet to have other things such as:
byte = 1 byte
short = 2 bytes
int = 4 bytes
long = 8 bytes
And you can get offsets from trial and error/take them from other sources/packetlogging.
How to Packet logging beside the total bytes is 15 so there is missing bites or what ?? and how to know that my offsets r right when i use trial and error

Quote:
Originally Posted by Korvacs View Post
Sure thats one way of doing it. You need to research the correct offsets which each packet contains, my packet wiki is one source of info, other server sources also contain packet structures, and you can find them out yourself by packet sniffing.
Sure ill take alook at it ...but is the example of body i mentioned is good way to build like that or there is better ways ??
shadowman123 is offline  
Old 01/14/2012, 20:29   #10

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by shadowman123 View Post
How to Packet logging beside the total bytes is 15 so there is missing bites or what ?? and how to know that my offsets r right when i use trial and error
Uhm yeah? You're obviously missing stuff and what do you mean by 15 bytes? Your post says Buffer = new byte[26 + 8]; so it's obviously 26.
Kiyono is offline  
Old 01/14/2012, 21:41   #11
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
He cant get the window to spawn (window to change your name..?) because as I know it's 10010 and not 2080. 2080 only handles when you click ok after you filled up the data.
-impulse- is offline  
Old 01/14/2012, 21:47   #12
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Quote:
Originally Posted by -impulse- View Post
He cant get the window to spawn (window to change your name..?) because as I know it's 10010 and not 2080. 2080 only handles when you click ok after you filled up the data.
And also cause he's not writing any data to the packet even if it was right for what he wanted.

Please this is like your fourth thread on packets and you still haven't learned the basics on how they work! Take some time to read the links and watch the videos we already posted for you...
pro4never is offline  
Old 01/14/2012, 23:19   #13
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by -impulse- View Post
He cant get the window to spawn (window to change your name..?) because as I know it's 10010 and not 2080. 2080 only handles when you click ok after you filled up the data.
dude it Openwindow parameter but when i tried to enter my name it gave me unhandled packet 2080 with leght 26 so i started making the packet ..its in Alberto source i've seen it but its way of building packet weird or idk ..

but all i have to become is Strcutring the Packet in right way and knowing how to bring right offsets but surely i cant do that excpet by ur help Guyz

what i need to know now ..is How to packet Log as alot of ppls said to me and idk understand whats that means or how i do that ..and by trial and error i could create a command but how do i know that im using right offset by using this way

third what i need to know is how to Handle the packet and this cant be done even i asked you guyz cuz i have to Try my best to handle them and see examples from source ..really i became much interested and enjoying in coding and testing

Quote:
Originally Posted by pro4never View Post
And also cause he's not writing any data to the packet even if it was right for what he wanted.

Please this is like your fourth thread on packets and you still haven't learned the basics on how they work! Take some time to read the links and watch the videos we already posted for you...
well i checked many of posts u gave to me and i've watched vedios that fang posted here about how the internet works in 5 mins but my point guyz is i wont find any vedios which learn me how to code packets in co or smthing like that ..thats y iam learning from you guyz ..it would be bad if i kept repeting the same question over and over..i've posted ways of buidling packets and i asked what the best way would be so what i mean my question Aims at learning exact smthing not just Spaming ..i wish you get the message and thx for your Help dude you and others that try to help me
shadowman123 is offline  
Old 01/14/2012, 23:26   #14

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
If you want to know the offsets for this packet, just look at albetros.
ushort 0 26+8
ushort 2 2080
ushort 4 namechangeaction
ushort 6 editcount
ushort 8 editallowed
string (16 bytes) 10 name

Used with dialog 489.
Kiyono is offline  
Old 01/14/2012, 23:51   #15
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by Kiyono View Post
If you want to know the offsets for this packet, just look at albetros.
ushort 0 26+8
ushort 2 2080
ushort 4 namechangeaction
ushort 6 editcount
ushort 8 editallowed
string (16 bytes) 10 name

Used with dialog 489.
thx alot for that but as well its a simple solution not efficient one cuz i wont find every offsets i want in sources so i have to learn creating them..so the question would be how can i get these values ? and i do know what dialog is cuz i created a command which allows me to test open window ids and i found the NameChange window dialog beside Degrade wep
shadowman123 is offline  
Reply


Similar Threads Similar Threads
Black Lung Mining [Bukkit] Multi Worlds (Guest Build, Survival, World 1 loose build,
04/24/2011 - Minecraft Server Advertising - 0 Replies
Are you up for the challenge? Come play at Black Lung Mining Corp. ip address of the server 69.197.191.47:25565 Starting off at BLM you are a guest. Guests only have access to the guest world 2 the start. As soon as you rank up to Builder you then have free roam of our many worlds. http://i.imgur.com/L37uW.jpg
WTT lvl 74(lvling everyday) dual build wierd build read details
11/14/2010 - Silkroad Online Trading - 2 Replies
im trading my lvl 74(lvling atm) dual build on iris has 1.2mill sp fire 74 ff blader is 74 ff bow is 74 ff force 71 ff easy to dlvl the force asking for any account any servers good account leave msg here



All times are GMT +1. The time now is 22:04.


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.