Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.IO;
  5. using System.Net;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace OLDownload
  9. {
  10. class Program
  11. {
  12. const string UserAgent = "Mozilla / 5.0(Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1";
  13. const string NumbersJs = "https://openload.co/assets/js/obfuscator/n.js";
  14.  
  15. static void Main(string[] args)
  16. {
  17. Console.WriteLine("OpenLoad Stream URL Extractor by gdkchan");
  18. Console.WriteLine("This is basically just a small test and not guaranteed to work");
  19.  
  20. Console.Write(Environment.NewLine);
  21.  
  22. Console.WriteLine("Type or paste the URL of the file below:");
  23.  
  24. string URL = Console.ReadLine();
  25.  
  26. URL = GetStreamURL(URL);
  27.  
  28. Console.Write(Environment.NewLine);
  29.  
  30. Console.ForegroundColor = ConsoleColor.White;
  31. Console.WriteLine("Download URL:");
  32. Console.ResetColor();
  33.  
  34. Console.WriteLine(URL);
  35.  
  36. Console.Write(Environment.NewLine);
  37.  
  38. Console.WriteLine("Press any key to exit...");
  39. Console.ReadKey();
  40. }
  41.  
  42. private static string GetStreamURL(string URL)
  43. {
  44. string HTML = HttpGet(URL);
  45. string NJs = HttpGet(NumbersJs);
  46.  
  47. string LinkImg = Regex.Match(HTML, "src=\"data:image/png;base64,([A-Za-z0-9+/=]+?)\"").Groups[1].Value;
  48. string SigNums = Regex.Match(NJs, "window\\.signatureNumbers='([a-z]+?)'").Groups[1].Value;
  49.  
  50. byte[] ImgData = Convert.FromBase64String(LinkImg);
  51.  
  52. string ImgNums = string.Empty;
  53.  
  54. using (MemoryStream MS = new MemoryStream(ImgData))
  55. {
  56. using (Bitmap Img = new Bitmap(MS))
  57. {
  58. for (int Y = 0; Y < Img.Height; Y++)
  59. {
  60. for (int X = 0; X < Img.Width; X++)
  61. {
  62. Color Col = Img.GetPixel(X, Y);
  63.  
  64. if (Col == Color.FromArgb(0, 0, 0))
  65. {
  66. //Black color = end of data
  67. Y = Img.Height;
  68. break;
  69. }
  70.  
  71. ImgNums += (char)Col.R;
  72. ImgNums += (char)Col.G;
  73. ImgNums += (char)Col.B;
  74. }
  75. }
  76. }
  77. }
  78.  
  79. string[,] ImgStr = new string[10, ImgNums.Length / 200];
  80. string[,] SigStr = new string[10, SigNums.Length / 260];
  81.  
  82. for (int i = 0; i < 10; i++)
  83. {
  84. //Fill Array of Image String
  85. for (int j = 0; j < ImgStr.GetLength(1); j++)
  86. {
  87. ImgStr[i, j] = ImgNums.Substring(i * ImgStr.GetLength(1) * 20 + j * 20, 20);
  88. }
  89.  
  90. //Fill Array of Signature Numbers
  91. for (int j = 0; j < SigStr.GetLength(1); j++)
  92. {
  93. SigStr[i, j] = SigNums.Substring(i * SigStr.GetLength(1) * 26 + j * 26, 26);
  94. }
  95. }
  96.  
  97. List<string> Parts = new List<string>();
  98.  
  99. int[] Primes = { 2, 3, 5, 7 };
  100.  
  101. foreach (int i in Primes)
  102. {
  103. string Str = string.Empty;
  104. float Sum = 99f; //c
  105.  
  106. for (int j = 0; j < SigStr.GetLength(1); j++)
  107. {
  108. for (int ChrIdx = 0; ChrIdx < ImgStr[i, j].Length; ChrIdx++)
  109. {
  110. if (Sum > 122f) Sum = 98f; //b
  111.  
  112. char Chr = (char)((int)Math.Floor(Sum));
  113.  
  114. if (SigStr[i, j][ChrIdx] == Chr && j >= Str.Length)
  115. {
  116. Str += ImgStr[i, j][ChrIdx];
  117. Sum += 2.5f;
  118. }
  119. }
  120. }
  121.  
  122. Parts.Add(Str.Replace(",", string.Empty));
  123. }
  124.  
  125. string StreamURL = "https://openload.co/stream/";
  126.  
  127. StreamURL += Parts[3] + "~";
  128. StreamURL += Parts[1] + "~";
  129. StreamURL += Parts[2] + "~";
  130. StreamURL += Parts[0];
  131.  
  132. return StreamURL;
  133. }
  134.  
  135. private static string HttpGet(string URL)
  136. {
  137. WebRequest Request = WebRequest.Create(URL);
  138. ((HttpWebRequest)Request).UserAgent = UserAgent;
  139.  
  140. WebResponse Response = Request.GetResponse();
  141. StreamReader Reader = new StreamReader(Response.GetResponseStream());
  142.  
  143. return Reader.ReadToEnd();
  144. }
  145. }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement