[C#] Need help after captcha code is sent by packet

09/24/2012 23:43 iNiperx#1
Hi all,

Well im using drew's sro api and the simple proxy everything is working ok, i can log in manually but when i try to log in from the GUI i get C9.

I've been trying to make it work but nothing, sent manually i get this:

Code:
[S->C][2001][14 bytes]
0000000000   0B 00 41 67 65 6E 74 53 65 72 76 65 72 00         ..AgentServer...
   
[C->S][6103][31 bytes][Encrypted]
0000000000   97 00 00 00 09 00 67 55 23 34 12 6F 74 30 31 07   ......HIDING ID.
0000000016   00 33 33 33 33 33 33 61 16 00 00 0E FE 66 00      .HIDING PW....þf..
The 6103 sents what the a102 has, but with the GUI this is what i get:

Code:
[S->C][2001][14 bytes]
0000000000   0B 00 41 67 65 6E 74 53 65 72 76 65 72 00         ..AgentServer...
   
[C->S][6103][15 bytes][Encrypted]
0000000000   AC 00 00 00 00 00 00 00 16 00 00 BB C6 9D 00      ¬..........»Æ...
Any help ? i've tried sending the 6103 manually but then it will still send it messed up.
09/25/2012 00:21 kevin_owner#2
The packet is actually fine an there is nothing wrong with it.
The length of the Username and Password are 0 which is correct so you either forgot to write the ascii string or messed up the packet ascii writer:)

Btw next time change the hex values of the login packet too mr. goldbot1:)

While I wrote this I suddenly thought of another reason. You're using an UI so the Textboxes could be empty right? mabye that's the problem that you're not getting/setting the text right.
09/25/2012 01:12 iNiperx#3
xD i failed hard by not changing the hex, well its a pserver and a lv 1 acc so it doesnt matter.

anyways, sro_client opens, and i put id and pw in the UI and i click the button and it sends so the captcha appears when i put the captcha i get.. if i log in manually it doesnt give me the C9. im using this on the button:

Code:
Packet new_packet = new Packet(0x6102, true);
new_packet.WriteUInt8(22);
new_packet.WriteAscii(txt_UserID.Text);
new_packet.WriteAscii(txt_UserPW.Text);
new_packet.WriteUInt16(01);

Proxy.local_context.RelaySecurity.Send(new_packet);
when i tried putting the len of the id and pw the client wouldnt respond back, but if i dont use the lengths it does respond and when i see in the packet the length it was there already.
09/25/2012 10:22 cyberninjah#4
Packet new_packet = new Packet(0x6102, true);
new_packet.WriteUInt8(0x16);// for vsro
new_packet.WriteAscii(txt_UserID.Text);
new_packet.WriteAscii(txt_UserPW.Text);
new_packet.WriteUInt16(01); // is this the server ID ?
09/25/2012 11:09 pergian#5
i am not sure if its the same on that pserver, but on isro the packet looks like this:

Packet login = new Packet(0x6102, true);
login.WriteUInt8(Globals.locale);//isro locale login.WriteAscii(Login.Username);
login.WriteAscii(Login.Password);
login.WriteAscii("");//mobile vertification code
login.WriteUInt8(0xFF);
login.WriteUInt16(serverID);

and you dont need the mobile vertifaction code ofc then. so if its the same you forgot the 0xFF or/and the serverID is wrong

also C9 means ping timeout, did you start the Agent connection (connection after login)
when you received 0xA102 with the sessionID , ip, port?
09/25/2012 21:23 iNiperx#6
@cyber

locale is 22, why should it be 16 ?
and yes 01 is the ID (or at least thats what i think)

using 16 makes the client respond but still getting C9.

@pergian

If i add that 0xFF it shows C8.

Quote:
also C9 means ping timeout, did you start the Agent connection (connection after login)
when you received 0xA102 with the sessionID , ip, port?
Proxy does that when i log in manually on the sro it does send the packet a102.
but i still dont know why im still getting C9.
09/25/2012 22:15 lesderid#7
Quote:
Originally Posted by iNiperx View Post
locale is 22, why should it be 16 ?
16 hex is 22 dec.
09/26/2012 03:03 iNiperx#8
Ok, i've changed so many things idk what else to try, i added you lesderid on MSN maybe you could help me a bit
09/26/2012 09:41 cyberninjah#9
if you are not sure about the server id maybe its a idea to parse the serverlist packet first ? so you are 100% sure its the right ID ?

if they only have one server dosnt mean the id is automaticly 1 =)

To help you a bit here is my serverlist parse.
you only need to change it to Drews API code because i dont use his api :p

Code:
            try
            {
                packet.SkipBytes(2);
                string str = packet.ReadString(Encoding.ASCII);
                packet.SkipBytes(1);
                byte readnextserver= packet.Read<byte>();
                while (Convert.ToBoolean(totalservers))
                {
                    ushort ID = packet.Read<ushort>();
                    string ServerName = packet.ReadString(Encoding.ASCII);
                    ushort cusers = packet.Read<ushort>();
                    ushort musers = packet.Read<ushort>();
                    bool flag = Convert.ToBoolean(packet.Read<byte>());

                    packet.SkipBytes(1);
                    readnextserver= packet.Read<byte>();
                }
            }
            catch (Exception)
            {

            }