Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 14:15

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

Advertisement



How can I make a packet bot?

Discussion on How can I make a packet bot? within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 26
Received Thanks: 8
How can I make a packet bot?

Hi guys, I know C# well and now I want to try to create a bot for ikariam. What I need to learn for making the bot?
Cheers,
Tinwor
Tinwor is offline  
Old 08/13/2013, 12:13   #2
 
elite*gold: 0
Join Date: Aug 2013
Posts: 26
Received Thanks: 8
No one can help me?
Tinwor is offline  
Old 08/13/2013, 12:25   #3
 
Ludder231's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 880
Received Thanks: 113
Google for "HttpWebRequest"
Ludder231 is offline  
Old 08/13/2013, 13:10   #4
 
elite*gold: 100
Join Date: Aug 2005
Posts: 595
Received Thanks: 208
Which has nothing todo with a packetbot :P

Reverse the Client, rebuild encryption and authentication
Gather and analyse packets.

Rebuild the Client.
dready is offline  
Old 08/13/2013, 17:10   #5


 
Requi's Avatar
 
elite*gold: 3800
The Black Market: 244/0/0
Join Date: Dec 2012
Posts: 13,039
Received Thanks: 8,243
Quote:
Originally Posted by dready View Post
Which has nothing todo with a packetbot :P

Reverse the Client, rebuild encryption and authentication
Gather and analyse packets.

Rebuild the Client.
Or just HttpWebRequests, because it's a browsergame and I think it's without any real client, except the browser itself.
Requi is offline  
Thanks
1 User
Old 08/13/2013, 21:29   #6
 
elite*gold: 0
Join Date: Aug 2013
Posts: 26
Received Thanks: 8
Ok thanks. I have this problem now, i use the httpwebrequest but after one request the server close the connection. I try to set keepalive=true but nothing, someone can help me?
Tinwor is offline  
Old 08/13/2013, 21:32   #7
 
Ludder231's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 880
Received Thanks: 113
Quote:
Originally Posted by Tinwor View Post
Ok thanks. I have this problem now, i use the httpwebrequest but after one request the server close the connection. I try to set keepalive=true but nothing, someone can help me?
try cookiecontainer...if you dont save the cookies the server will think you are not logged in
Ludder231 is offline  
Old 08/13/2013, 22:32   #8
 
slayerman31's Avatar
 
elite*gold: 0
Join Date: Sep 2011
Posts: 6
Received Thanks: 0
i have sample project for travian , but coded in vbnet. (with webbrowser)

its not good choice but coding a very simple

source :

picture :
slayerman31 is offline  
Old 08/14/2013, 19:19   #9
 
elite*gold: 0
Join Date: Aug 2013
Posts: 26
Received Thanks: 8
this is my get method:
Code:
public string get(string uri)
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri);
            webRequest.ContentType = "application/x-www-form-urlencoded";
            webRequest.Method = "GET";
            webRequest.UserAgent = "Mozilla/5.0 (Windows NT 5.0; rv:5.0) Gecko/20100101 Firefox/5.0";
            try
            {
                WebResponse webResponse = webRequest.GetResponse();
                if (webResponse == null)
                    return null;
                StreamReader sr = new StreamReader(webResponse.GetResponseStream());
                return sr.ReadToEnd().Trim(); 
            }
            catch (WebException ex) 
            {
                HttpWebResponse response = (HttpWebResponse)ex.Response;
                StreamReader sr = new StreamReader(response.GetResponseStream());
                HTTPRequests.requests++;
                return sr.ReadToEnd().Trim(); 
            }
            catch (Exception)
            {
                throw;
            }
        }
and this is the post:
Code:
public string post(string uri, string parameters)
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri);
            webRequest.ContentType = "application/x-www-form-urlencoded";
            webRequest.Method = "POST";
            webRequest.UserAgent = "Mozilla/5.0 (Windows NT 5.0; rv:5.0) Gecko/20100101 Firefox/5.0";
            byte[] bytes = Encoding.ASCII.GetBytes(parameters); 
            Stream sendstream = null;
            try
            {
                webRequest.ContentLength = bytes.Length;   
                sendstream  = webRequest.GetRequestStream();  
                sendstream.Write(bytes, 0, bytes.Length);   
                sendstream.Close(); 
            }
            catch (Exception)
            { 
                throw;
            }

            try
            {
                WebResponse webResponse = webRequest.GetResponse();
                if (webResponse == null)
                    return null;
                StreamReader sr = new StreamReader(webResponse.GetResponseStream());
                return sr.ReadToEnd().Trim();
            }
            catch (WebException ex) 
            {
                HttpWebResponse response = (HttpWebResponse)ex.Response;
                StreamReader sr = new StreamReader(response.GetResponseStream());
                HTTPRequests.requests++;
                return sr.ReadToEnd().Trim(); 
            }
            catch (Exception)
            {
                throw;
            }
        }
Now I have to add and use the cookiecontainer but i don't know how to do it. Can someone help?Thanks
Tinwor is offline  
Old 08/19/2013, 07:43   #10
 
BlackHybrid's Avatar
 
elite*gold: 52
The Black Market: 101/0/0
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
Insert the variable:
PHP Code:
private CookieContainer CookieContainer
and add this to your request:
PHP Code:
webRequest.CookieContainer CookieContainer
In the best case you needn't to manage the cookies by yourself

You can also have the problem, that your header isn't similar to the "original" header and you do a bad request.
BlackHybrid is offline  
Reply


Similar Threads Similar Threads
Make a packet bot
07/23/2011 - DarkOrbit - 13 Replies
Hello, i have recently started programing in vb 2010, i have searched but cannot find, can someone please give me a link on a tutorial on how to start coding a packet bot for online games. I have not made any bots yet that comunicate with online servers, just simple bots like youtube refreshers and such. Help is much appreciated thanks,
anyone know what WPE packet to make closed/crash server
03/31/2009 - RF Online - 8 Replies
wanna to make crash RF-ID.. if anyone know whats packets on WPE to make official server (RF-ID) crash plz pm me



All times are GMT +2. The time now is 14:15.


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