C#开发QQ农场外挂实践

来源:百度文库 编辑:神马文学网 时间:2024/05/01 17:09:29

前一篇文章我大致写了一下如何制作QQ农场外挂,最近我的外挂运行了一段时间,觉得还行,所以拿出来给大家下载试用试用

大致功能有:

1。我的资料,查看我的等级,经验,金钱等信息

2。我的农场:可以查看我的农场信息,种了哪些作物,什么时候成熟

3。我的仓库,可以浏览仓库里的物品,并可以卖掉

4。我的背包:可以浏览背包里的东西,并可以自动播铲(没用的种子种了马上铲掉又种获取经验)

5。我的装饰:查看我购买的所有装饰

6。商店:可以购买全部值得购买的装饰用品(没2点经验需要120块以内的装饰)

7。日志:偷窃日志,刷新日志,被狗咬日志等等

8。设置:可以按自己需要设置一些自动除草之类的东西

9。手机控制:可以利用手机短信警报你出入验证码,然后手机通过wap网站浏览验证码图片,输入验证码。(这样即使人不在电脑前,也可以用手机输入验证码了)

c#代码片段:

view plaincopy to clipboardprint? 
//得到所有好友列表的c#代码:    
public static int getFriendList()   
        {   
            string url = "http://happyfarm.qzone.qq.com/api.php?mod=friend"; 
            Program.allFriend.Clear();   
            Program.mainFrm.myFriendList.Items.Clear();   
            try  
            {   
                int curTime = com.sourceware.util.DateUtil.getCurTime();//得到当前时间;   
                String s = "sdoit78sdopig7w34057";   
                int yushu = curTime % 10;   
                s = s.Substring(yushu, 20 - yushu);   
                String farmKey = com.sourceware.util.MD5Util.MD5(curTime + s);   
//以上是生成farmKey   
                System.Net.WebClient wc = new System.Net.WebClient();   
                string uin = com.sourceware.util.IniProperties.getValue("login", "uin");   
                string skey = com.sourceware.util.IniProperties.getValue("login", "skey");  
                string login_time = com.sourceware.util.IniProperties.getValue("login", "login_time");   
                wc.Headers.Add(System.Net.HttpRequestHeader.Cookie, "uin=" + uin + ";skey=" + skey + ";login_time=" + login_time);   
//以上是session值,每次提交必须把这3个参数放到cookie当中提交。   
                System.Collections.Specialized.NameValueCollection coll = new System.Collections.Specialized.NameValueCollection();   
                coll.Add("user", "true");   
                coll.Add("farmTime", "" + curTime);   
                coll.Add("farmKey", farmKey.ToLower());   
                coll.Add("refresh", "true");   
//以上是得到好友列表必须post的参数   
                byte[] b = wc.UploadValues(url, coll);   
                ServerUtil.trickConnect2server();   
                String result = System.Text.Encoding.UTF8.GetString(b);   
//得到服务器返回的内容,为 json格式,可以用json4net分析它;   
                  return 0;   
}catch (Exception ex)   
{   
                log.Error(ex.Message + ex.StackTrace);   
                return -2;   
            }   
}  
//得到所有好友列表的c#代码: 
public static int getFriendList() 
        { 
            string url = "http://happyfarm.qzone.qq.com/api.php?mod=friend";

            Program.allFriend.Clear(); 
            Program.mainFrm.myFriendList.Items.Clear(); 
            try 
            { 
                int curTime = com.sourceware.util.DateUtil.getCurTime();//得到当前时间;

                String s = "sdoit78sdopig7w34057"; 
                int yushu = curTime % 10; 
                s = s.Substring(yushu, 20 - yushu); 
                String farmKey = com.sourceware.util.MD5Util.MD5(curTime + s); 
//以上是生成farmKey

                System.Net.WebClient wc = new System.Net.WebClient(); 
                string uin = com.sourceware.util.IniProperties.getValue("login", "uin"); 
                string skey = com.sourceware.util.IniProperties.getValue("login", "skey"); 
                string login_time = com.sourceware.util.IniProperties.getValue("login", "login_time");

                wc.Headers.Add(System.Net.HttpRequestHeader.Cookie, "uin=" + uin + ";skey=" + skey + ";login_time=" + login_time); 
//以上是session值,每次提交必须把这3个参数放到cookie当中提交。 
                System.Collections.Specialized.NameValueCollection coll = new System.Collections.Specialized.NameValueCollection(); 
                coll.Add("user", "true"); 
                coll.Add("farmTime", "" + curTime); 
                coll.Add("farmKey", farmKey.ToLower()); 
                coll.Add("refresh", "true"); 
//以上是得到好友列表必须post的参数

                byte[] b = wc.UploadValues(url, coll); 
                ServerUtil.trickConnect2server();

                String result = System.Text.Encoding.UTF8.GetString(b); 
//得到服务器返回的内容,为 json格式,可以用json4net分析它; 
                  return 0; 
}catch (Exception ex) 
{

                log.Error(ex.Message + ex.StackTrace); 
                return -2;

            }