Hello!
I recently started playing on vsro servers and thought that a I need a clientless tool, so I started searching around. I found the guides which Drew Benton made (lot of thanks for that), so I believe that I understand the basics of the way silkroad handles the packets.
After this, I started experimenting. I found the AutoIT solution, but truth to be told, I don't like AutoIT at all, so I moved on.
Finally, I found
video, which showed me some possibilities in C# (I know the language), but I got stuck.
I wanted to make the program make my char sit down/stand up, so I changed the code in the Main[] section to this: ,
Code:
PacketWriter writer = new PacketWriter(0x704F, 1); // OpCode 0x3026, Security (2 -> to server, 1 -> to client) for SrProxy
writer.AppendByte(2);
Socket.Send(writer.GetPacket());
I use SrProxy - vsro (this is the name of the executable, don't know wether it matters, or not).
But after starting to debug, I get disconnected from the server, instead of sitting down / standing up. I'm sure that the opcode is correct (sniffed it multiple times using edxloader).
Yes, the client is redirected to use SrProxy. Yes, the IP is set correctly in the source to connect to srProxy. I believe that I'm handling the packet in a wrong way, yet I can't figure out what I am doing wrong.
My current source looks like this: (credits go to author,
ZeraPain)
Code:
using System;
using System.Collections;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace SendNotice
{
class Program
{
class ConnectedSocket
{
private Socket winSock;
public void Connect(string IP, int Port)
{
winSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPAddress IPA = IPAddress.Parse(IP);
IPEndPoint IPEP = new IPEndPoint(IPA, Port);
try
{
winSock.Connect(IPEP);
}
catch (SocketException se)
{
Console.WriteLine(se.Message);
}
}
public void Send(byte[] data)
{
if (winSock.Connected)
winSock.Send(data);
}
}
private static ConnectedSocket Socket = new ConnectedSocket();
static void Main(string[] args)
{
Socket.Connect("127.0.0.1", 15778);
PacketWriter writer = new PacketWriter(0x704F, 1); // OpCode 0x3026, Security (2 -> to server, 1 -> to client) for SrProxy
writer.AppendByte(2);
Socket.Send(writer.GetPacket());
}
private static void SendNotice(string notice)
{
PacketWriter writer = new PacketWriter(0x7025, 1); // OpCode 0x3026, Security (2 -> to server, 1 -> to client) for SrProxy
writer.AppendByte(7); //Chat type
writer.AppendUnicodeString(notice); //Message
Socket.Send(writer.GetPacket());
}
}
class PacketWriter
{
private ArrayList Data;
private ArrayList Packet;
private int Size;
public PacketWriter(ushort opcode, byte security)
{
Size = 0;
Data = new ArrayList();
Packet = new ArrayList();
Data.AddRange(BitConverter.GetBytes(opcode));
Data.Add((byte)security);
Data.Add((byte)0);
}
public byte[] GetPacket()
{
Packet.AddRange(BitConverter.GetBytes((ushort)Size));
Packet.AddRange(Data);
return (byte[])Packet.ToArray(typeof(byte));
}
public void AppendByte(byte value)
{
Data.Add((byte)value);
Size += 1;
}
public void AppendUnicodeString(string message)
{
AppendWord((ushort)message.Length);
Data.AddRange(Encoding.Unicode.GetBytes(message));
Size += message.Length * 2;
}
public void AppendWord(ushort value)
{
Data.AddRange(BitConverter.GetBytes(value));
Size += 2;
}
}
}
Best regards,
Levela