I am sorry for asking about packets again but...

10/13/2012 01:28 badguy4you#1
I think i got an explanation for you to understand what i need well

if a game sends a packet like this

22 00 11 00 6D 79 75 73 65 72 6E 61 6D 65 00 00 00 00 00 00 6D 79 70 61 73 73 77 6F 72 64 00 00 00 00 00 00

Length , Header, Username, Password

How actually was something like this written in the client code ?

i think it is not just Encoding.ASCII.GetByte("Of some string values");!!!

assuming i want to create and send a packet like the above given those credentials

Username : Test
Password : Test

how could i generate a packet with the same structure as the above but with the given data ?

I am sorry if my question is weird.
10/13/2012 02:05 go for it#2
i think it's simply a login button method
it takes the acc/pass strings
then it calls another method which maybe we will call it do_login
do_login takes (acc,pass) as parameters
it convert them to bytes , add to them length and type
then call send method , send method add a seal maybe ? then send it by calling the networking class ?

if im about to create a client ill do tho , but what about another programming ? prolly may not do the same thing but in the end we will get the same result
so it's not a rule , it's completely up to you on how to generate a packet with a pre-made packet structure

you really need to look at pro4never proxy tutorial of unit 3 (as far as i remember it was unit 3)
he really did explain alot of methods of how to generate a packet with 3 different ways (including warper which i personally use , but it sometimes takes alot of parameters) , others using class for each packet to getvariable/create it , there is so many ways , check out good sources for better methods

wish that answer what you asking for
10/13/2012 14:05 badguy4you#3
Quote:
Originally Posted by go for it View Post
i think it's simply a login button method
it takes the acc/pass strings
then it calls another method which maybe we will call it do_login
do_login takes (acc,pass) as parameters
it convert them to bytes , add to them length and type
then call send method , send method add a seal maybe ? then send it by calling the networking class ?

if im about to create a client ill do tho , but what about another programming ? prolly may not do the same thing but in the end we will get the same result
so it's not a rule , it's completely up to you on how to generate a packet with a pre-made packet structure

you really need to look at pro4never proxy tutorial of unit 3 (as far as i remember it was unit 3)
he really did explain alot of methods of how to generate a packet with 3 different ways (including warper which i personally use , but it sometimes takes alot of parameters) , others using class for each packet to getvariable/create it , there is so many ways , check out good sources for better methods

wish that answer what you asking for
You nearly hit the point yeah i want to know how could i add the username and password after converting them to bytes to the length and the type to form a full packet ! that's it
10/13/2012 17:34 go for it#4
i think i got your point
there is many ways like block copy , for example copying all bytes u need in one big byte then send them
but my fav way is the warrper (duno why but i really like this way)
well lets create a byte array in the very first
lets call it packet__17 ?
okay now we need to create methods to write stuff in the packet with certain array with all types
what i mean with all types ? to be able to write strings and ints/uints/short/ushort/long/pla/pla/pla
(ill copy this from the trinity source/ pro4never proxy , same at both)
for better understanding you should really learn from pro4never proxy (it's small so it's less scary than trinity source , but both will give u the same amount of information)

read/write to byte array

example of me sending a packet

that was the whole read write class , this is an example of generaldata/jumping packet , added to it ReadWrite.WriteString(string string , int offset , byte[] byte_array) for better understanding

you may type in hex with 0x or in dec like coordx and coordy

wish that is what you searching for , but i really want you to read , just read , pro4never proxy or trinity base , it will answer all your questions , enjoy mate

umm was to forget , about the block copy , here is an example
Buffer.BlockCopy(byte[] source_array , int source_offset , byte[] destination , int destination_offset , int count(the number of bytes to copy) );

here is an example in action at splitting packets
Code:
                byte[] Packet = new byte[(Length + 8)];
                Buffer.BlockCopy(data, 0, Packet, 0, (Length + 8));
                byte[] _buffer = new byte[(data.Length - (Length + 8))];
                Buffer.BlockCopy(data, (Length + 8), _buffer, 0, (data.Length - (Length + 8)));
                data = _buffer;
                ReadWrite.WriteString("TQClient", (Packet.Length - 8), Packet);
                HandleClient(Packet);
10/13/2012 17:57 Spirited#5
I'm not sure how well I explained it, but you can always check the thread I made about packets.
[Only registered and activated users can see links. Click Here To Register...]