Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Net;
- using System.Text;
- namespace TriUtils
- {
- // Token: 0x02000002 RID: 2
- public class Program
- {
- // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
- private string GetLocalIPAddress()
- {
- return new WebClient().DownloadString("http://icanhazip.com").Trim();
- }
- // Token: 0x06000002 RID: 2 RVA: 0x00002078 File Offset: 0x00000278
- public Program.changeIPResult changeIP(string licensekey, string product)
- {
- string localIPAddress = this.GetLocalIPAddress();
- Program.changeIPResult result;
- try
- {
- HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://tridentplugins.me/licensekeys/changeip.php");
- httpWebRequest.Method = "POST";
- httpWebRequest.ContentType = "application/x-www-form-urlencoded";
- using (Stream requestStream = httpWebRequest.GetRequestStream())
- {
- byte[] bytes = Encoding.UTF8.GetBytes(string.Concat(new string[]
- {
- "keyt=",
- licensekey,
- "&productt=",
- product,
- "&ipt=",
- localIPAddress,
- "&btn=Submit+Query"
- }));
- requestStream.Write(bytes, 0, bytes.Length);
- }
- HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
- string text = string.Empty;
- using (StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream()))
- {
- text = streamReader.ReadToEnd();
- }
- switch (text[text.Length - 1])
- {
- case '0':
- result = Program.changeIPResult.succesfull;
- break;
- case '1':
- result = Program.changeIPResult.notfound;
- break;
- case '2':
- result = Program.changeIPResult.already;
- break;
- default:
- result = Program.changeIPResult.notfound;
- break;
- }
- }
- catch
- {
- result = Program.changeIPResult.error;
- }
- return result;
- }
- // Token: 0x06000003 RID: 3 RVA: 0x000021E8 File Offset: 0x000003E8
- public Program.lkeyresult check(string licensekey, string product)
- {
- string localIPAddress = this.GetLocalIPAddress();
- bool flag = localIPAddress == "0";
- Program.lkeyresult result;
- if (flag)
- {
- result = Program.lkeyresult.error;
- }
- else
- {
- Program.Instance = this;
- try
- {
- HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://tridentplugins.me/licensekeys/check.php");
- httpWebRequest.Method = "POST";
- httpWebRequest.ContentType = "application/x-www-form-urlencoded";
- using (Stream requestStream = httpWebRequest.GetRequestStream())
- {
- byte[] bytes = Encoding.UTF8.GetBytes(string.Concat(new string[]
- {
- "keyt=",
- licensekey,
- "&productt=",
- product,
- "&ipt=",
- localIPAddress,
- "&btn=Submit+Query"
- }));
- requestStream.Write(bytes, 0, bytes.Length);
- }
- HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
- string text = string.Empty;
- using (StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream()))
- {
- text = streamReader.ReadToEnd();
- }
- switch (text[text.Length - 1])
- {
- case '0':
- return Program.lkeyresult.match;
- case '1':
- return Program.lkeyresult.not_whitelised;
- case '2':
- return Program.lkeyresult.no_match;
- default:
- return Program.lkeyresult.no_match;
- }
- }
- catch
- {
- }
- result = Program.lkeyresult.error;
- }
- return result;
- }
- // Token: 0x04000001 RID: 1
- public static Program Instance = new Program();
- // Token: 0x02000003 RID: 3
- public enum lkeyresult
- {
- // Token: 0x04000003 RID: 3
- match,
- // Token: 0x04000004 RID: 4
- not_whitelised,
- // Token: 0x04000005 RID: 5
- no_match,
- // Token: 0x04000006 RID: 6
- error
- }
- // Token: 0x02000004 RID: 4
- public enum changeIPResult
- {
- // Token: 0x04000008 RID: 8
- succesfull,
- // Token: 0x04000009 RID: 9
- notfound,
- // Token: 0x0400000A RID: 10
- already,
- // Token: 0x0400000B RID: 11
- error
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement