The point of this topic is I want to create a Trivia Event Bot and make it public including source codes.
The steps of the bot is;
- Create proxy and redirect packets to it.
- Read packets and find packets with chatting opcode (0x3026).
- Check the type of the packet (It must be global chat).
- Check if the user is [Bot]System or counterpart.
- Try to find the question in saved questions.
- If bot has the question in its database, send the answer via PM to [Bot]System.
Creating question database, how to store questions in database (in a file or DB, table rows etc.), when to save/update database or searching for answer (hash questions to find faster or string comparison for all the questions) etc. is not mentioned above. This is just some kind of pseudo code.
The first of all, I did some digging in this forum and I have found pushedx's guides.
Firstly, I read

As far as I understood, the logic is simply create a proxy then use it like a man-in-the-middle to sniff/drop/send packets.Quote:
When the client connects to the proxy, the proxy then creates its own client to connect to the server. The reason for this is because the proxy must establish a connection to the server to be able to pass the data from the server back to the client and from the client to the server. The setup looks like this in ASCII art: Client <-> Proxy <-> Server.
My system is Windows 10 x64 and my IDE is Visual Studio 2015.
I downloaded the Silkroad Security API and tried to build
When I run the code with the parameters in
, it doesn't go any further after this line near 62.Code:
//Check image for how did I set parameters. //My parameters are, //127.0.0.1 16000 37.156.246.19 15779 local_context.Socket = server.Accept();
that mentioned in
, created by Devsome.All I wanted to do with that application was to run it and see if it sends any message to the [BOT]System.
The application extracted the server IP wrong (I checked IP, port and division from mBot 1.12b), so I hardcoded the IP, port and division.
Code:
private void fMain_Load(object sender, EventArgs e)
{
//The following 3 lines are my code.
Framework.Global.ProxyGlobal.Server_Address = "37.156.246.19";
Framework.Global.ProxyGlobal.Server_Gateway_Port = 15779;
Framework.Global.ProxyGlobal.Server_Division = "DIV01";
coBoLoginServer.Items.Insert(0, Framework.Global.ProxyGlobal.Server_Address);
coBoLoginServer.SelectedIndex = 0;
onLogMsg("* Successfully started VEGA");
}
I opened it in debug mode and I found out that I had the similar problem with pushedx's program. The program doesn't go any further from the last line that is shown below.
Code:
//In Main.cs
ag_local_server = new TcpListener(IPAddress.Parse(Global.ProxyGlobal.Proxy_IPAddress), Global.ProxyGlobal.Proxy_Agent_Port);
//ag_local_server = new TcpListener(IPAddress.Any, Global.ProxyGlobal.Proxy_Agent_Port);
ag_local_server.Start();
Console.WriteLine("* Waiting for a connection... ");
OnLogMsg("* Waiting for a connection... ");
ag_local_client = ag_local_server.AcceptTcpClient(); //Line 433, doesn't go further after this line.
. I ran .exe, set the .pk2 and proxy as in
.I have a strange error and have no idea about why this error occurs.

I checked the forum a little about this problem and saw
. I gave it a shot.I set the config file and ran it.
HTML Code:
[phConnector] GatewayIP=37.156.246.19 GatewayPort=15779 BindPort=16000 BotBind=22580 DataMaxSize=16384
and launched. I had no error and was able to login to the server.Now I wonder what is wrong with the codes/programs that was unable to work fully functional. To more be specific,
- Why did pushedx's "Simplest Proxy" get stuck at that line?
- Why did Devsome's program get stuck at that line?
- Why did edxSilkroadLoader5 throw error?
- Why did my last attempt (phConnector + edxSilkroadLoader5) work?
Also, can I send/receive packets with proxy without injecting to sro_client and launch it?
For example, if I put these lines of code to Simplest Proxy and compile-and-run it, does it work when I connect to the game?
Or should I do some injection to the game and open it then use proxy?

Code:
if (packet.Opcode == 0x3026)
{
int chat = packet.ReadUInt8();
switch (chat)
{
case 6: //Global
string name = packet.ReadAscii();
string message = packet.ReadAscii();
if(name == "XXX" && message.StartsWith("WTB"))
{
Packet pm = new Packet(0x7025);
pm.WriteUInt16(02);
pm.WriteAscii(name);
pm.WriteAscii("AutoMessage");
//Send(pm);
context.Security.Send(pm);
}
break;
}
}
Any kind of help is appreciated.



.gif)



