Register for your free account! | Forgot your password?

You last visited: Today at 21:17

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

Advertisement



bot connection/packets

Discussion on bot connection/packets within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
bot connection/packets

i'm tryin to send a packet to sro to make my character sit, and its not working.
i know that the packet is sent when i moniter it with a packet sniffer but sro dosen't do anything with it.
Code:
#define silk_IP "121.128.133.59" //64
#define silk_PORT 15779
Code:
	char buffer[256];
	/*-------------------some first **** nonsense---------*/
	WSADATA wsaData;
	if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) {
	fprintf(stderr, "WSAStartup fail");
	exit(1);
	}
	/*----------------------now the bot--------------------*/
	SOCKET nuconnector;	
	struct sockaddr_in silkroad;
	nuconnector = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);  //making the socket  //maybe raw
	if (nuconnector < 0)
	{
		timestamp();
		printf("cannot establish connection socket creation error");
		cin.get();
		return nuconnector;
	}
	else
	{
		timestamp();
		printf("socket created");
	}
	silkroad.sin_family = AF_INET;
	silkroad.sin_port = htons (silk_PORT);
	silkroad.sin_addr.s_addr = inet_addr(silk_IP);
	memset(silkroad.sin_zero, '\0', sizeof(silkroad.sin_zero));
	int chk = connect(nuconnector,(struct sockaddr *)&silkroad,sizeof silkroad);
	if(chk == -1)
	{
		timestamp();
		printf("connection fail");
		cin.get();
		return chk;
	}
	timestamp();
	printf("connection successful");
	ZeroMemory(buffer, 256);
	strcpy(buffer, "01 00 4F 70 F9 89 04");
	send(nuconnector, buffer, strlen(buffer), 0);
	timestamp();
	printf("test packet sent");
kibbles18 is offline  
Old 11/26/2011, 03:12   #2
 
theoneofgod's Avatar
 
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
Sit opcode is 704F (for vSRO110 based servers)
You should only send byte "0x04" to sit.
theoneofgod is offline  
Old 11/26/2011, 11:34   #3
 
Schickl's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,064
Received Thanks: 539
You're sending it as a String
01 00 4F 70 F9 89 04 this are byte values in hex

Code:
BYTE pack[7] = {
    0x01, 0x00,  //packet length
    0x4F, 0x70,  //opcode
    0x20, 0x00,  //I didn't use nuconnector for quite some time now so make sure that this is the right direction to send it to
    0x04    //Packet data
};

send(nuconnector, pack, sizeof(pack), 0);
If the opcode you wrote is right and I used the right direction(else just replace the 2 bytes) it should work with the code i wrote above

Note: NEVER send the packets as a string(char array).
The only time you'll see strings in packets is when text is sent.
everything else are raw values(meaning that when you e.g. want to send an int value you really need to send the bytes of an int variable)

Oh and BYTE is defined as unsigned char

EDIT: Looks like you don't use nuconnector
You must connect to it and not to the Silkroad server(IP isn't even right i guess)
If you want to write a program that is similar to nuconnector you'll need some more time
Security Bytes aren't static as far as i know and packets are encrypted(you won't be able to decrypt it w/o knowing the blowfish key)

It's best you just use nuconnector or srproxy
Schickl is offline  
Old 11/27/2011, 20:36   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
FIXED
close please
kibbles18 is offline  
Old 11/28/2011, 08:32   #5
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,748
Received Thanks: 2,010
Here it's seen as a part of the 'ettiquete' that you actually thank peoples post if they helped you. If nobody helped you in this thread, then please share your solution. If everybody would keep things to themselves there wouldn't be a point in having this forum, would it?
Nezekan is offline  
Thanks
1 User
Old 11/29/2011, 03:07   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
solution: connecting to nuconnector port rather then sro (22581) at localhost
kibbles18 is offline  
Thanks
1 User
Old 06/25/2012, 22:19   #7
 
elite*gold: 0
Join Date: Nov 2007
Posts: 23
Received Thanks: 1
can u send me the cpp file plz ?? coz i made kinda the same code and it doesnt work and when i use the pack BYTE array thing it tells me cant convert from byte to unsinged char*
dragonsword1 is offline  
Reply


Similar Threads Similar Threads
[Packets] Wie änder ich flyff packets?
07/16/2011 - Flyff Private Server - 19 Replies
HeyHo, Ich würde sehr gerne wissen wie man die Flyff Packets ändert... ich denke mal Zahlen ändern werden nicht ausreichen oder?
Mix on packets
01/07/2011 - Kal Online - 2 Replies
k thx
ERROR: Connection failed. Host 'Mcncc.com' is blocked because of many connection erro
04/10/2010 - Metin2 Private Server - 8 Replies
Hab ein Problem mit meinem DynDns Server nach einiger Zeit kommt bei der DB und Regi immer olgendes "ERROR: Connection failed. Host 'Mcncc.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" kann mir jemand sagen woran das liegt?
connection: Connection refused
11/21/2009 - Metin2 Private Server - 16 Replies
Hi Leute, ich wollte meinen server neu starten und dann kam etwas wie das hier. http://www2.pic-upload.de/thumb/05.10.09/ug5fybhq f9b.jpg Dann habe ich es neu versucht und dann kamen manchmal Core Fehler!! Weiß jemand wie man diese Fehler beheben kann?
help in +4 ore packets
04/09/2008 - RF Online - 5 Replies
can you please tell me what packet to look into if i am going to alter the packet for ore mining, is it the send or the receive part? please just what to look into and then from that on ill make my way through.



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


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.