using System;
using System.Collections.Generic;
using System.IO;
using System.Management;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using LeWell.Api;
namespace https_limited
{
// Token: 0x02000002 RID: 2
public class LocoyPluginClass : ISuperJob, ICloneable, IDisposable, ILocoySpider
{
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
public void ChangeWebRequest(int level, ref HttpWebRequest request)
{
bool flag = request.RequestUri.ToString().StartsWith("https", StringComparison.OrdinalIgnoreCase);
if (flag)
{
string path = AppDomain.CurrentDomain.BaseDirectory + "\Plugins\httpsPluginRegistCode.key";
bool flag2 = File.Exists(path);
if (flag2)
{
bool flag3 = LocoyPluginClass.var_haerui779BY3 % 40 == 0;
if (flag3)
{
object obj = LocoyPluginClass.dll_HFYib7dg4e;
lock (obj)
{
bool flag4 = LocoySpiderHelper.IsStringNullOrWhiteSpace(LocoyPluginClass.var_GIgbi8eHL);
if (flag4)
{
string text = "";
ManagementClass managementClass = new ManagementClass("Win32_Processor");
ManagementObjectCollection instances = managementClass.GetInstances();
foreach (ManagementBaseObject managementBaseObject in instances)
{
ManagementObject managementObject = (ManagementObject)managementBaseObject;
text = managementObject.Properties["ProcessorId"].Value.ToString();
}
LocoyPluginClass.var_GIgbi8eHL = text;
}
}
object obj2 = LocoyPluginClass.dll_fgyggd67ebn;
lock (obj2)
{
bool flag5 = LocoySpiderHelper.IsStringNullOrWhiteSpace(LocoyPluginClass.registerCode);
if (flag5)
{
LocoyPluginClass.registerCode = File.ReadAllText(path);
}
}
string text2 = "<RSAKeyValue><Modulus>naG0cE2Ori93faCaerIEAWHadm/TmR+MlijcAptMxsPUju84sWXcWrdEMQ7dU/rk50vYSFtX5ADYXk3yC+f26U14sO0TS50J94LJFHTPXaYOc7qWFp93PpzdVT15CL2dtpVOVN9cerI24AFdgSvSGR1avd2/BKSP4AYucQfFJCM6b4F+g4h5QKgJNe08BZmijFXms38nHmoCE79DpodtsjWsJ9IyRPTU7XAjPkE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
LocoySpiderHelper locoySpiderHelper = new LocoySpiderHelper();
string strHashbyteDeformatter = "";
locoySpiderHelper.GetHash(LocoyPluginClass.var_GIgbi8eHL, ref strHashbyteDeformatter);
bool flag6 = locoySpiderHelper.SignatureDeformatter(string.Concat(new string[]
{
text2.Substring(0, 48),
text2.Substring(64, 15),
text2.Substring(94, 58),
text2.Substring(164, 27),
text2.Substring(208, 95)
}), strHashbyteDeformatter, LocoyPluginClass.registerCode);
if (flag6)
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.CheckValidationResult);
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
}
else
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.CheckValidationResult2);
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
this.Dispose();
}
catch
{
throw;
}
}
}
else
{
bool flag7 = LocoyPluginClass.var_haerui779BY3 > 15 && ServicePointManager.SecurityProtocol != (SecurityProtocolType)3072;
if (flag7)
{
object obj3 = LocoyPluginClass.dll_HFYib7dg4e;
lock (obj3)
{
bool flag8 = LocoySpiderHelper.IsStringNullOrWhiteSpace(LocoyPluginClass.var_GIgbi8eHL);
if (flag8)
{
string text3 = "";
ManagementClass managementClass2 = new ManagementClass("Win32_Processor");
ManagementObjectCollection instances2 = managementClass2.GetInstances();
foreach (ManagementBaseObject managementBaseObject2 in instances2)
{
ManagementObject managementObject2 = (ManagementObject)managementBaseObject2;
text3 = managementObject2.Properties["ProcessorId"].Value.ToString();
}
LocoyPluginClass.var_GIgbi8eHL = text3;
}
}
object obj4 = LocoyPluginClass.dll_fgyggd67ebn;
lock (obj4)
{
bool flag9 = LocoySpiderHelper.IsStringNullOrWhiteSpace(LocoyPluginClass.registerCode);
if (flag9)
{
LocoyPluginClass.registerCode = File.ReadAllText(path);
}
}
string text4 = "<RSAKeyValue><Modulus>naG0cE2Ori93faCaerIEAWHadm/TmR+MlijcAptMxsPUju84sWXcWrdEMQ7dU/rk50vYSFtX5ADYXk3yC+f26U14sO0TS50J94LJFHTPXaYOc7qWFp93PpzdVT15CL2dtpVOVN9cerI24AFdgSvSGR1avd2/BKSP4AYucQfFJCM6b4F+g4h5QKgJNe08BZmijFXms38nHmoCE79DpodtsjWsJ9IyRPTU7XAjPkE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
LocoySpiderHelper locoySpiderHelper2 = new LocoySpiderHelper();
string strHashbyteDeformatter2 = "";
locoySpiderHelper2.GetHash(LocoyPluginClass.var_GIgbi8eHL, ref strHashbyteDeformatter2);
bool flag10 = locoySpiderHelper2.SignatureDeformatter(string.Concat(new string[]
{
text4.Substring(0, 48),
text4.Substring(64, 15),
text4.Substring(94, 58),
text4.Substring(164, 27),
text4.Substring(208, 95)
}), strHashbyteDeformatter2, LocoyPluginClass.registerCode);
if (flag10)
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.CheckValidationResult);
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
}
else
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.CheckValidationResult2);
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
this.Dispose();
}
catch
{
throw;
}
}
}
}
}
else
{
bool flag11 = LocoyPluginClass.var_haerui779BY3 <= 15;
if (flag11)
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.CheckValidationResult);
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
}
else
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(this.CheckValidationResult2);
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
this.Dispose();
}
catch
{
throw;
}
}
}
object obj5 = LocoyPluginClass.dll_HDUYIByfg6;
lock (obj5)
{
LocoyPluginClass.var_haerui779BY3++;
}
}
}
// Token: 0x06000002 RID: 2 RVA: 0x00002554 File Offset: 0x00000754
public virtual void ChangeArticle(int level, Dictionary<string, List<string>> dic, string pageurl, string html)
{
}
// Token: 0x17000001 RID: 1
// (get) Token: 0x06000003 RID: 3 RVA: 0x00002558 File Offset: 0x00000758
public bool UseChangeWebRequest
{
get
{
return true;
}
}
// Token: 0x06000004 RID: 4 RVA: 0x0000256C File Offset: 0x0000076C
public virtual string ChangeHtml(int level, string originalHtml, WebHeaderCollection request, WebHeaderCollection response, string pageurl)
{
return originalHtml;
}
// Token: 0x06000005 RID: 5 RVA: 0x00002580 File Offset: 0x00000780
public bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
// Token: 0x06000006 RID: 6 RVA: 0x00002594 File Offset: 0x00000794
public bool CheckValidationResult2(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return false;
}
// Token: 0x06000007 RID: 7 RVA: 0x000025A8 File Offset: 0x000007A8
public virtual string GetMultPageUrl(string multPageName, string pageurl, string html, string multPageStyle, string multPageCombine)
{
return html;
}
// Token: 0x06000008 RID: 8 RVA: 0x000025BC File Offset: 0x000007BC
public virtual List<string> GetPagesUrl(int level, string pageurl, string html, string pagesStyle, string pagesCombine)
{
return null;
}
// Token: 0x17000002 RID: 2
// (get) Token: 0x06000009 RID: 9 RVA: 0x000025D0 File Offset: 0x000007D0
public virtual bool UseGetMultPageUrl
{
get
{
return false;
}
}
// Token: 0x17000003 RID: 3
// (get) Token: 0x0600000A RID: 10 RVA: 0x000025E4 File Offset: 0x000007E4
public virtual bool UseGetPagesUrl
{
get
{
return false;
}
}
// Token: 0x0600000B RID: 11 RVA: 0x000025F8 File Offset: 0x000007F8
public object Clone()
{
return base.MemberwiseClone();
}
// Token: 0x0600000C RID: 12 RVA: 0x00002610 File Offset: 0x00000810
public void Dispose()
{
throw new NotImplementedException();
}
// Token: 0x0600000D RID: 13 RVA: 0x00002618 File Offset: 0x00000818
public void ChangeResultDic(Dictionary<string, string> dic)
{
bool flag = dic.ContainsKey("插件临时标签-机器码");
if (flag)
{
string encryptString = "";
ManagementClass managementClass = new ManagementClass("Win32_Processor");
ManagementObjectCollection instances = managementClass.GetInstances();
foreach (ManagementBaseObject managementBaseObject in instances)
{
ManagementObject managementObject = (ManagementObject)managementBaseObject;
encryptString = managementObject.Properties["ProcessorId"].Value.ToString();
}
string xmlPublicKey = "<RSAKeyValue><Modulus>pyeJuxVL9/Av/fBsHxiHON0XzMmDHMMWUHw9Efl3DRH2kmGQTklWUZ5omSGW9wrzGspGlt1ti4KgD/k24K/T4ztxEWRo07HXyDPQTZFQC+ClYRNXTfp1fBCArfu+XTNwdpfnmjyW3OcurKi++MYuZ6OqS2rEbqzL7FmW/s0ae2k=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
LocoySpiderHelper locoySpiderHelper = new LocoySpiderHelper();
string value = locoySpiderHelper.RSAEncrypt(xmlPublicKey, encryptString);
dic["插件临时标签-机器码"] = value;
}
bool flag2 = LocoyPluginClass.var_haerui779BY3 > 15;
if (flag2)
{
string path = AppDomain.CurrentDomain.BaseDirectory + "\\Plugins\\httpsPluginRegistCode.key";
bool flag3 = !File.Exists(path);
if (flag3)
{
Dictionary<int, string> dictionary = new Dictionary<int, string>();
int num = 0;
foreach (string value2 in dic.Keys)
{
dictionary.Add(num, value2);
num++;
}
foreach (KeyValuePair<int, string> keyValuePair in dictionary)
{
bool flag4 = keyValuePair.Value != "插件临时标签-机器码";
if (flag4)
{
dic[keyValuePair.Value] = "---您好!您使用的是免费版 HTTPS 插件,只有 15次 测试机会,如要使用无限制版请联系 xxxxx 购买!";
}
}
}
else
{
bool flag5 = LocoyPluginClass.var_haerui779BY3 % 40 == 0;
if (flag5)
{
string text = "<RSAKeyValue><Modulus>naG0cE2Ori93faCaerIEAWHadmFe4+7Gboh6RyENe3PUju84sWXcWrdEM5ADYXk3yC+f26LTHUrKwqr3wU14sO0TS50J94LJFHTPXaYOc7qWFp93XOX8RRTI6PpzdVT15CL2dtpFdgSvSGR1avd2/BKSP4i7ILHOAYucQfFJ08BZmijFXms38nHmoCE79DpodtsjWsJ9IyRPTU7XAjPkE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
LocoySpiderHelper locoySpiderHelper2 = new LocoySpiderHelper();
string strHashbyteDeformatter = "";
locoySpiderHelper2.GetHash(LocoyPluginClass.var_GIgbi8eHL, ref strHashbyteDeformatter);
bool flag6 = !locoySpiderHelper2.SignatureDeformatter(string.Concat(new string[]
{
text.Substring(0, 48),
text.Substring(64, 28),
text.Substring(103, 31),
text.Substring(143, 33),
text.Substring(182, 103)
}), strHashbyteDeformatter, LocoyPluginClass.registerCode);
if (flag6)
{
Dictionary<int, string> dictionary2 = new Dictionary<int, string>();
int num2 = 0;
foreach (string value3 in dic.Keys)
{
dictionary2.Add(num2, value3);
num2++;
}
foreach (KeyValuePair<int, string> keyValuePair2 in dictionary2)
{
bool flag7 = keyValuePair2.Value != "插件临时标签-机器码";
if (flag7)
{
dic[keyValuePair2.Value] = "---您好!您使用的是免费版 HTTPS 插件,只有 15次 测试机会,如要使用无限制版请联系 xxxxx 购买!";
}
}
}
}
else
{
bool flag8 = ServicePointManager.SecurityProtocol != (SecurityProtocolType)3072;
if (flag8)
{
string text2 = "<RSAKeyValue><Modulus>naG0cE2Ori93faCaerIEAWHadmFe4+7Gboh6RyENe3PUju84sWXcWrdEM5ADYXk3yC+f26LTHUrKwqr3wU14sO0TS50J94LJFHTPXaYOc7qWFp93XOX8RRTI6PpzdVT15CL2dtpFdgSvSGR1avd2/BKSP4i7ILHOAYucQfFJ08BZmijFXms38nHmoCE79DpodtsjWsJ9IyRPTU7XAjPkE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
LocoySpiderHelper locoySpiderHelper3 = new LocoySpiderHelper();
string strHashbyteDeformatter2 = "";
locoySpiderHelper3.GetHash(LocoyPluginClass.var_GIgbi8eHL, ref strHashbyteDeformatter2);
bool flag9 = !locoySpiderHelper3.SignatureDeformatter(string.Concat(new string[]
{
text2.Substring(0, 48),
text2.Substring(64, 28),
text2.Substring(103, 31),
text2.Substring(143, 33),
text2.Substring(182, 103)
}), strHashbyteDeformatter2, LocoyPluginClass.registerCode);
if (flag9)
{
Dictionary<int, string> dictionary3 = new Dictionary<int, string>();
int num3 = 0;
foreach (string value4 in dic.Keys)
{
dictionary3.Add(num3, value4);
num3++;
}
foreach (KeyValuePair<int, string> keyValuePair3 in dictionary3)
{
bool flag10 = keyValuePair3.Value != "插件临时标签-机器码";
if (flag10)
{
dic[keyValuePair3.Value] = "---您好!您使用的是免费版 HTTPS 插件,只有 15次 测试机会,如要使用无限制版请联系 xxxxx 购买!";
}
}
}
}
}
}
}
}
// Token: 0x0600000E RID: 14 RVA: 0x00002AD0 File Offset: 0x00000CD0
public void ChangeStepRequest(ref HttpWebRequest request)
{
bool flag = request.RequestUri.ToString().StartsWith("https", StringComparison.OrdinalIgnoreCase);
if (flag)
{
throw new Exception("您使用的是免费测试版 https插件,仅支持测试内容页,不支持采集https列表页!如需无限制版本请联系xxxxx购买!\r\n");
}
}
// Token: 0x0600000F RID: 15 RVA: 0x00002B05 File Offset: 0x00000D05
public virtual void ChangeSaveFiles(Dictionary<string, Dictionary<string, KeyValuePair<string, string>>> fieldandfiles, Dictionary<string, string> dic)
{
}
// Token: 0x06000010 RID: 16 RVA: 0x00002B08 File Offset: 0x00000D08
public virtual string ChangeStepHtml(string pageurl, string html, WebHeaderCollection request, WebHeaderCollection response)
{
return html;
}
// Token: 0x06000011 RID: 17 RVA: 0x00002B1C File Offset: 0x00000D1C
public virtual string EndJob(bool handstop, string jobname, string jobid, int url, int content, int post, object job)
{
return null;
}
// Token: 0x06000012 RID: 18 RVA: 0x00002B30 File Offset: 0x00000D30
public virtual List<KeyValuePair<string, Dictionary<string, string>>> GetStepUrls(string html, string areaStart, string areaEnd, string urlStyle, string urlCombine, string allow, string forbidden)
{
return null;
}
// Token: 0x06000013 RID: 19 RVA: 0x00002B44 File Offset: 0x00000D44
public virtual List<string> MakeStartAddress(string urlData, string useragent, string refer, CookieCollection cookie)
{
return null;
}
// Token: 0x06000014 RID: 20 RVA: 0x00002B58 File Offset: 0x00000D58
public virtual string StartJob()
{
return null;
}
// Token: 0x17000004 RID: 4
// (get) Token: 0x06000015 RID: 21 RVA: 0x00002B6C File Offset: 0x00000D6C
public virtual bool UseChangeSaveFiles
{
get
{
return false;
}
}
// Token: 0x17000005 RID: 5
// (get) Token: 0x06000016 RID: 22 RVA: 0x00002B80 File Offset: 0x00000D80
public virtual bool UseGetStepUrls
{
get
{
return false;
}
}
// Token: 0x17000006 RID: 6
// (get) Token: 0x06000017 RID: 23 RVA: 0x00002B94 File Offset: 0x00000D94
public virtual bool UseMakeStartAddress
{
get
{
return false;
}
}
// Token: 0x04000001 RID: 1
private static int var_haerui779BY3 = 0;
// Token: 0x04000002 RID: 2
private static object dll_HDUYIByfg6 = new object();
// Token: 0x04000003 RID: 3
private static int var_GHUYGI78 = 0;
// Token: 0x04000004 RID: 4
private static object dll_fhuherasbh = new object();
// Token: 0x04000005 RID: 5
private static string var_GIgbi8eHL = "";
// Token: 0x04000006 RID: 6
private static object dll_HFYib7dg4e = new object();
// Token: 0x04000007 RID: 7
private static string registerCode = "";
// Token: 0x04000008 RID: 8
private static object dll_fgyggd67ebn = new object();
}
}