Packet 0x6103 need help

08/24/2012 21:30 Ehab.Hamed#1
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 ?
08/26/2012 15:03 GoneUp#2
Did you sent it encrypted?
08/27/2012 08:30 cyberninjah#3
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!
08/27/2012 17:52 GoneUp#4
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?
08/27/2012 21:40 pergian#5
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.
08/28/2012 15:15 cyberninjah#6
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));
                            }
08/29/2012 11:03 lesderid#7
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 [Only registered and activated users can see links. Click Here To Register...] to manually seed System.Random with the tick count.
08/29/2012 12:04 cyberninjah#8
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 [Only registered and activated users can see links. Click Here To Register...] 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 =)
08/30/2012 00:30 lesderid#9
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.