This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string CleanText(string Input) | |
{ | |
string res = Input.Replace("\r", "").Replace("\n", "").Replace("\t", "").Replace("\b", ""); | |
if (res.StartsWith(' ')) | |
res = res.Remove(0, 1); | |
if (res.EndsWith(' ')) | |
res = res.Remove(res.Length - 1, 1); | |
while (res.Contains(" ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<KeyValuePair<string, string>> Configurizer(string Path = "configs.conf") | |
{ | |
var Configs = new List<KeyValuePair<string, string>>(); | |
if (System.IO.File.Exists(Path)) | |
{ | |
string[] Lines = System.IO.File.ReadAllLines(Path); | |
foreach (string Line in Lines) | |
{ | |
if (Line.Contains("=")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string[] AddToArray(ref string[] Array, string Value) | |
{ | |
System.Array.Resize(ref Array, Array.Length + 1); | |
Array[Array.Length - 1] = Value; | |
return Array; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public TorrentMetadata ParseMagnet(string Magnet) | |
{ | |
var MD = new TorrentMetadata(); | |
MD.URI = Magnet; | |
Magnet = Magnet.Replace("magnet:?", ""); | |
var Parts = Magnet.Split('&'); | |
foreach (var RawPart in Parts) | |
{ | |
var Part = System.Net.WebUtility.UrlDecode(RawPart); | |
if (Part.StartsWith("xt=")) MD.InfoHash = Part.Split(':').Last().ToUpper(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static byte[] EncryptMessage(byte[] pMessage, ProtocolType pProtocolType) | |
{ | |
List<byte> byteList = new List<byte>(); | |
int num1 = 171; | |
if (pMessage != null && pMessage.Length != 0) | |
{ | |
if (pProtocolType == ProtocolType.Tcp) | |
{ | |
byteList.Add((byte)0); | |
byteList.Add((byte)0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string GoogleWhatsMyIP() | |
{ | |
var Response = new System.Net.WebClient() { Encoding = System.Text.Encoding.UTF8 }.DownloadString("https://www.google.am/search?q=whats+my+ip&hl=en"); | |
var m = new System.Text.RegularExpressions.Regex("((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(?![\\d])").Match(Response); | |
if (m.Success) | |
return m.Groups[1].ToString(); | |
return null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string Base64Encode(string plainText) | |
{ | |
Dictionary<char, int> Base64Table = new Dictionary<char, int>() | |
#region Table | |
{ | |
{'+',62}, | |
{'/',63}, | |
{'0',52}, | |
{'1',53}, | |
{'2',54}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string[] GetChildNodeTexts(HtmlNode Node) | |
{ | |
List<string> OutputNodes = new List<string>(); | |
var Nodes = Node.Descendants() | |
.Where(n => !n.HasChildNodes && n.InnerText != "\n" && !string.IsNullOrWhiteSpace(n.InnerText) && | |
n.InnerText != "*") | |
.Select(n => n.InnerText.Replace("\n", "")).ToArray(); | |
foreach (var InnerNode in Nodes) | |
{ | |
if (!string.IsNullOrWhiteSpace(InnerNode.Replace("*", ""))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public long BadRandom() | |
{ | |
List<char> Stack = new List<char>(); | |
char[] Array = DateTime.Now.Ticks.ToString().ToArray(); | |
Stack.Add(Array[int.Parse(Array.Last().ToString())]); | |
for (int i = 0; i < 17; i++) | |
{ | |
Array = DateTime.Now.Ticks.ToString().ToArray(); | |
Stack.Add(Array[int.Parse(Stack.ToArray().Last().ToString())]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IDatabase | |
{ | |
public DataTable ReadTable(SQLiteConnection Connection, string TableName) | |
{ | |
List<string> Data = new List<string>(); | |
string Command = $"SELECT * FROM {TableName}"; | |
SQLiteCommand SqliteCommand = new SQLiteCommand(Command, Connection); | |
SQLiteDataAdapter da = new SQLiteDataAdapter(SqliteCommand); | |
DataTable dt = new DataTable(); | |
da.Fill(dt); |