Register for your free account! | Forgot your password?

You last visited: Today at 16:18

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

Advertisement



Silkroad 0x7021 packet

Discussion on Silkroad 0x7021 packet within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2010
Posts: 41
Received Thanks: 3
Silkroad 0x7021 packet

i got 3 packets like
Code:
[C->S] [9] [0x7021] [E] 
01 99 66 de 02 98 ff b9 01                        

[C->S] [9] [0x7021] [E] 
01 99 66 57 03 98 ff bd 01                        

[C->S] [9] [0x7021] [E] 
01 99 66 28 03 98 ff 1a 02
if i wanna send those packets from my C# program how i`m supposed
to do that ?

cause i tried this one and not working i get always DC

Code:
public void triangle()
        {
            Packet p1 = new Packet(0x7021);
            p1.WriteInt8(0x01);
            p1.WriteInt16(0x9966);
            p1.WriteInt16(0xde02);
            p1.WriteInt16(0x98ff);
            p1.WriteInt16(0xb901);
            
            Packet p2 = new Packet(0x7021);
            p2.WriteInt8(0x01);
            p2.WriteInt16(0x9966);
            p2.WriteInt16(0x5703);
            p2.WriteInt16(0x98ff);
            p2.WriteInt16(0xbd01);

            Packet p3 = new Packet(0x7021);
            p3.WriteInt8(0x01);
            p3.WriteInt16(0x9966);
            p3.WriteInt16(0x2803);
            p3.WriteInt16(0x98ff);
            p3.WriteInt16(0x1a02);


            while (true)
            {
                Thread.Sleep(1500);
                Agent.Send(p1);
                Thread.Sleep(1500);
                Agent.Send(p2);
                Thread.Sleep(1500);
                Agent.Send(p3);
            }
        }
medolife20 is offline  
Old 12/01/2015, 02:57   #2
 
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
Doesn't [E] mean they are encrypted?
So you should encrypt the packet you're trying to send.
DaxterSoul is offline  
Thanks
1 User
Old 12/01/2015, 07:50   #3
 
elite*gold: 0
Join Date: Oct 2014
Posts: 34
Received Thanks: 16
I think its not nessesary to Encrypt the walking packet, already done it without..
But maybe depends on server?!

Heres an example WITH encryption enabled:

Code:
public static byte GetSectorY(int y)
{
	return (byte)Math.Floor((double)y / 192 + 92);
}

public static byte GetSectorX(int x)
{
	return (byte)Math.Floor((double)x / 192 + 135);
}

public static void WalkTo(Bot bot, int X, int Y)
{
	if (bot == null || bot.Proxy == null) return;

	int xPos = 0;
	int yPos = 0;
	
	byte xSector = DlgMiniMap.GetSectorX(X);
	byte ySector = DlgMiniMap.GetSectorY(Y);

	Packet packet;

	if (bot.Char.Ridepet == null)
	{
		packet = new Packet(0x7021, true);
		packet.WriteUInt8(0x01);
	}
	else
	{
		packet = new Packet(0x70C5, true);
		packet.WriteUInt32(bot.Char.Ridepet.UID);
		packet.WriteUInt8(1);
		packet.WriteUInt8(1);
	}

	packet.WriteUInt8(xSector);
	packet.WriteUInt8(ySector);

	if (bot.Char.IsInCave)
	{
		xSector = bot.Char.CaveFloor;
		ySector = 0x80;
		
		xPos = ((X - ((xSector - 135) * 192)) * 10);
		yPos = ((Y - ((ySector - 92) * 192)) * 10);
	}
	else
	{
		xPos = (ushort)((X - (xSector - 135) * 192) * 10);
		yPos = (ushort)((Y - (ySector - 92) * 192) * 10);
	}

	packet.WriteUInt16(xPos);
	packet.WriteUInt16(0);
	packet.WriteUInt16(yPos);
	
	bot.Proxy.SendToSilkroadServer(packet);
}
mxii is offline  
Thanks
1 User
Old 12/03/2015, 18:54   #4
 
elite*gold: 8
Join Date: Sep 2014
Posts: 625
Received Thanks: 178
It depends on the packet. Some packets require an encryption.
qqdev is offline  
Old 12/06/2015, 21:12   #5
 
elite*gold: 0
Join Date: Feb 2009
Posts: 46
Received Thanks: 5
first :- 0x7021 is not encrypted .

second :-u must use
p1.WriteUInt8(0x01); Not
p1.WriteInt8(0x01);
it is unsigned integers not signed .

Third and your problem source :-
u must reverse the bytes order when u read or write from a stream that's how streams works .example lets build sit down packet 0x704f
its opcode is =0x704f
its security bytes =xxxx (dont care about those bytes for now)
its data is =0x04
its data size = 0001 byte
packet build = data size + opcode +security bytes +data
packet = 0x 0100 4f70 xxxx 04

so in your case the code is :-
Code:
Packet p1 = new Packet(0x7021,false,false);
            p1.WriteUInt8(0x01);
            p1.WriteUInt16(0x6699);
            p1.WriteUInt16(0x02de);
            p1.WriteUInt16(0xff98);
            p1.WriteUInt16(0x01b9);
theking200051 is offline  
Thanks
1 User
Old 12/10/2015, 01:38   #6
 
elite*gold: 0
Join Date: Aug 2010
Posts: 41
Received Thanks: 3
Quote:
Originally Posted by theking200051 View Post
first :- 0x7021 is not encrypted .

second :-u must use
p1.WriteUInt8(0x01); Not
p1.WriteInt8(0x01);
it is unsigned integers not signed .

Third and your problem source :-
u must reverse the bytes order when u read or write from a stream that's how streams works .example lets build sit down packet 0x704f
its opcode is =0x704f
its security bytes =xxxx (dont care about those bytes for now)
its data is =0x04
its data size = 0001 byte
packet build = data size + opcode +security bytes +data
packet = 0x 0100 4f70 xxxx 04

so in your case the code is :-
Code:
Packet p1 = new Packet(0x7021,false,false);
            p1.WriteUInt8(0x01);
            p1.WriteUInt16(0x6699);
            p1.WriteUInt16(0x02de);
            p1.WriteUInt16(0xff98);
            p1.WriteUInt16(0x01b9);
first of all thanks so much bro <3
also
how i know if packet encrypted or not ?
also the same way u did with that packet happen with all packets >?
medolife20 is offline  
Old 12/10/2015, 20:35   #7
 
elite*gold: 8
Join Date: Sep 2014
Posts: 625
Received Thanks: 178
Your packet analyzer should show it. edxLoader for instance.
qqdev is offline  
Reply




All times are GMT +1. The time now is 16:21.


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.