Register for your free account! | Forgot your password?

You last visited: Today at 14:00

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

Advertisement



Packet 0x6103 need help

Discussion on Packet 0x6103 need help within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2012
Posts: 2
Received Thanks: 1
Packet 0x6103 need help

Is there any errors in this packet ?

Code:
procedure DoRequestLogin();
begin
  Pku.Clear();
  Pku.SetOpCode($6103);
  Pku.SetWriteIndex(6);                [COLOR="Green"]//skip header[/COLOR]
  Pku.AppendDWord(WsId);               [COLOR="Green"]//Session Id from responce[/COLOR]
  Pku.AppendWord(Length(LoginId));     [COLOR="Green"]//length of User Name[/COLOR]
  Pku.AppendString(LoginId);           [COLOR="Green"]//User Name[/COLOR]
  Pku.AppendWord(Length(LoginPass));   [COLOR="Green"]//length of User password[/COLOR]
  Pku.AppendString(LoginPass);         [COLOR="Green"]//User password[/COLOR]
  Pku.AppendByte(ClientLocal);         [COLOR="Green"]//0x12[/COLOR]
  pku.AppendBuffer(@MacAddress, 6);    [COLOR="Green"]//MAC Address eg. 00 00 00 C9 F2 94[/COLOR]

  Pku.PrepareAndSend(Socket, True);    [COLOR="Green"] //Send with encryption[/COLOR]
end;
the server answers me with
Code:
S->C [600D]
05 00 0D 60 00 00 01 01 00 05 20 0B 00 0D 60 00 
00 00 01 00 01 11 0D 05 00 00 00 02 05 00 0D 60 
00 00 01 01 00 05 60 06 00 0D 60 00 00 00 03 00 
02 00 02 

S->C [0000] Enc
02 00 00 00 00 00 00 00
so I closed the socket. When I traces the client packet, the server answers the client with [0xA103] and the value is 01

Where is my mistack ?
Ehab.Hamed is offline  
Old 08/26/2012, 15:03   #2
 
GoneUp's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 201
Received Thanks: 73
Did you sent it encrypted?
GoneUp is offline  
Old 08/27/2012, 08:30   #3
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
Code:
            PacketWriter packet = new PacketWriter(Opcodes.CLIENT_LOGINREQUEST, true);
            packet.Append<byte>(0x16);
            packet.AppendString(id, Encoding.ASCII);
            packet.AppendString(pw, Encoding.ASCII);
            packet.Append<ushort>(serverID);
            this.InjectServerPacket(packet);
Edit: Hmm this is the packet for vSRO and its look like you need it for isro sorry!
cyberninjah is offline  
Old 08/27/2012, 17:52   #4
 
GoneUp's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 201
Received Thanks: 73
Quote:
Originally Posted by cyberninjah View Post
Code:
            PacketWriter packet = new PacketWriter(Opcodes.CLIENT_LOGINREQUEST, true);
            packet.Append<byte>(0x16);
            packet.AppendString(id, Encoding.ASCII);
            packet.AppendString(pw, Encoding.ASCII);
            packet.Append<ushort>(serverID);
            this.InjectServerPacket(packet);
Edit: Hmm this is the packet for vSRO and its look like you need it for isro sorry!
+ that's the 0x6102 packet.

EDIT:
Just an example from rSRO, should be equal to iSRO
[27.08.2012 17:56:39] C --> S (6103)01-00-00-00-01-00-69-01-00-69-28-00-00-00-00-00-00

01-00-00-00 #SessionID
01-00 #ID Len
69 #ID
01-00 #PW Len
69 #PW
28 #Locale (40=rSRO)
00-00-00-00-00-00 (Empty Mac)

They way the thread starter done it should work. Maybe you need to long to get to this step and the server gives your SessionID a timeout?
GoneUp is offline  
Old 08/27/2012, 21:40   #5
 
elite*gold: 0
Join Date: Feb 2008
Posts: 73
Received Thanks: 18
if its isro he forgot the mobile phone service (also string), which is added after the pw

even if you dont have it you must sent it empty

but i think this is the same guy which posted on other site, and i told him that already.
pergian is offline  
Old 08/28/2012, 15:15   #6
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
Oops yea im wrong sorry opcodes are diffrent so i made a mistake with the packet my fault.

i dont know if you need it more i just use random bytes for the macaddress.

Code:
                            Random random = new Random(Environment.TickCount);
                            for (int i = 0; i < 6; i++)
                            {
                                writer2.Append<byte>((byte)random.Next(0, 0xff));
                            }
cyberninjah is offline  
Old 08/29/2012, 11:03   #7
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by cyberninjah View Post
Oops yea im wrong sorry opcodes are diffrent so i made a mistake with the packet my fault.

i dont know if you need it more i just use random bytes for the macaddress.

Code:
                            Random random = new Random(Environment.TickCount);
                            for (int i = 0; i < 6; i++)
                            {
                                writer2.Append<byte>((byte)random.Next(0, 0xff));
                            }
Note that this is not guaranteed to work (i.e. the server may not accept some randomly generated sequences).

It's also to manually seed System.Random with the tick count.
lesderid is offline  
Old 08/29/2012, 12:04   #8
 
elite*gold: 0
Join Date: Jun 2007
Posts: 79
Received Thanks: 19
Quote:
Originally Posted by lesderid View Post
Note that this is not guaranteed to work (i.e. the server may not accept some randomly generated sequences).

It's also to manually seed System.Random with the tick count.
I know ticket counter is not necessary.

I tested with it more with the ticket counter i get more random numbers then without it so thats why i choice to use it =)
cyberninjah is offline  
Old 08/30/2012, 00:30   #9
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by cyberninjah View Post
I know ticket counter is not necessary.

I tested with it more with the ticket counter i get more random numbers then without it so thats why i choice to use it =)
Unless you using a third party .Net implementation (i.e. one that isn't developed by Microsoft), that is actually impossible. If you use an IL decompiler like dotPeek or .Net Reflector to look at System.Random's implementation, you'll see that when you construct System.Random with the parameterless constructor, it will call the one with the seed parameter using Environment.TickCount as the seed.

You are manually supplying a seed to the random-number generator without any (valid) reason. There's no reason to do this unless you want it to always give you the same sequence of 'randomly' generated numbers. In that case, you should always use the same seed and not Environment.TickCount.

tl;dr: By using Environment.TickCount, you're doing exactly the same thing Microsoft does internally. It will not produce numbers that are 'more random' than when using the parameterless constructor.
lesderid is offline  
Reply




All times are GMT +1. The time now is 14:00.


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.