This commit is contained in:
niko
2026-04-08 23:40:05 +02:00
parent d6894bcbc7
commit 18dc73f922
7750 changed files with 1795369 additions and 0 deletions
+574
View File
@@ -0,0 +1,574 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using BestHTTP.Extensions;
using BestHTTP.Logger;
using Cpp2IlInjected;
namespace BestHTTP.Cookies
{
// Token: 0x020019E1 RID: 6625
[Token(Token = "0x20019E1")]
[StructLayout(3)]
public sealed class Cookie : IComparable<Cookie>, IEquatable<Cookie>
{
// Token: 0x17001CC3 RID: 7363
// (get) Token: 0x0600B225 RID: 45605 RVA: 0x0029DDF4 File Offset: 0x0029BFF4
// (set) Token: 0x0600B226 RID: 45606 RVA: 0x0029DE08 File Offset: 0x0029C008
[Token(Token = "0x17001CC3")]
public string Name
{
[Token(Token = "0x600B225")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0")]
get;
[Token(Token = "0x600B226")]
[Address(RVA = "0x3C39B0", Offset = "0x3C23B0", VA = "0x1803C39B0")]
private set;
}
// Token: 0x17001CC4 RID: 7364
// (get) Token: 0x0600B227 RID: 45607 RVA: 0x0029DE1C File Offset: 0x0029C01C
// (set) Token: 0x0600B228 RID: 45608 RVA: 0x0029DE30 File Offset: 0x0029C030
[Token(Token = "0x17001CC4")]
public string Value
{
[Token(Token = "0x600B227")]
[Address(RVA = "0x3C1240", Offset = "0x3BFC40", VA = "0x1803C1240")]
get;
[Token(Token = "0x600B228")]
[Address(RVA = "0x3C1280", Offset = "0x3BFC80", VA = "0x1803C1280")]
private set;
}
// Token: 0x17001CC5 RID: 7365
// (get) Token: 0x0600B229 RID: 45609 RVA: 0x0029DE44 File Offset: 0x0029C044
// (set) Token: 0x0600B22A RID: 45610 RVA: 0x0029DE58 File Offset: 0x0029C058
[Token(Token = "0x17001CC5")]
public DateTime Date
{
[Token(Token = "0x600B229")]
[Address(RVA = "0x3C1220", Offset = "0x3BFC20", VA = "0x1803C1220")]
get;
[Token(Token = "0x600B22A")]
[Address(RVA = "0x3C1260", Offset = "0x3BFC60", VA = "0x1803C1260")]
internal set;
}
// Token: 0x17001CC6 RID: 7366
// (get) Token: 0x0600B22B RID: 45611 RVA: 0x0029DE6C File Offset: 0x0029C06C
// (set) Token: 0x0600B22C RID: 45612 RVA: 0x0029DE80 File Offset: 0x0029C080
[Token(Token = "0x17001CC6")]
public DateTime LastAccess
{
[Token(Token = "0x600B22B")]
[Address(RVA = "0x3C1230", Offset = "0x3BFC30", VA = "0x1803C1230")]
get;
[Token(Token = "0x600B22C")]
[Address(RVA = "0x3C1270", Offset = "0x3BFC70", VA = "0x1803C1270")]
set;
}
// Token: 0x17001CC7 RID: 7367
// (get) Token: 0x0600B22D RID: 45613 RVA: 0x0029DE94 File Offset: 0x0029C094
// (set) Token: 0x0600B22E RID: 45614 RVA: 0x0029DEA8 File Offset: 0x0029C0A8
[Token(Token = "0x17001CC7")]
public DateTime Expires
{
[Token(Token = "0x600B22D")]
[Address(RVA = "0x3C1250", Offset = "0x3BFC50", VA = "0x1803C1250")]
get;
[Token(Token = "0x600B22E")]
[Address(RVA = "0x3C1290", Offset = "0x3BFC90", VA = "0x1803C1290")]
private set;
}
// Token: 0x17001CC8 RID: 7368
// (get) Token: 0x0600B22F RID: 45615 RVA: 0x0029DEBC File Offset: 0x0029C0BC
// (set) Token: 0x0600B230 RID: 45616 RVA: 0x0029DED0 File Offset: 0x0029C0D0
[Token(Token = "0x17001CC8")]
public long MaxAge
{
[Token(Token = "0x600B22F")]
[Address(RVA = "0x3EE8E0", Offset = "0x3ED2E0", VA = "0x1803EE8E0")]
get;
[Token(Token = "0x600B230")]
[Address(RVA = "0x421E00", Offset = "0x420800", VA = "0x180421E00")]
private set;
}
// Token: 0x17001CC9 RID: 7369
// (get) Token: 0x0600B231 RID: 45617 RVA: 0x0029DEE4 File Offset: 0x0029C0E4
// (set) Token: 0x0600B232 RID: 45618 RVA: 0x0029DEF8 File Offset: 0x0029C0F8
[Token(Token = "0x17001CC9")]
public bool IsSession
{
[Token(Token = "0x600B231")]
[Address(RVA = "0x421DE0", Offset = "0x4207E0", VA = "0x180421DE0")]
get;
[Token(Token = "0x600B232")]
[Address(RVA = "0x421DF0", Offset = "0x4207F0", VA = "0x180421DF0")]
private set;
}
// Token: 0x17001CCA RID: 7370
// (get) Token: 0x0600B233 RID: 45619 RVA: 0x0029DF0C File Offset: 0x0029C10C
// (set) Token: 0x0600B234 RID: 45620 RVA: 0x0029DF20 File Offset: 0x0029C120
[Token(Token = "0x17001CCA")]
public string Domain
{
[Token(Token = "0x600B233")]
[Address(RVA = "0x3EDEA0", Offset = "0x3EC8A0", VA = "0x1803EDEA0")]
get;
[Token(Token = "0x600B234")]
[Address(RVA = "0x3EDED0", Offset = "0x3EC8D0", VA = "0x1803EDED0")]
private set;
}
// Token: 0x17001CCB RID: 7371
// (get) Token: 0x0600B235 RID: 45621 RVA: 0x0029DF34 File Offset: 0x0029C134
// (set) Token: 0x0600B236 RID: 45622 RVA: 0x0029DF48 File Offset: 0x0029C148
[Token(Token = "0x17001CCB")]
public string Path
{
[Token(Token = "0x600B235")]
[Address(RVA = "0x462740", Offset = "0x461140", VA = "0x180462740")]
get;
[Token(Token = "0x600B236")]
[Address(RVA = "0x462750", Offset = "0x461150", VA = "0x180462750")]
private set;
}
// Token: 0x17001CCC RID: 7372
// (get) Token: 0x0600B237 RID: 45623 RVA: 0x0029DF5C File Offset: 0x0029C15C
// (set) Token: 0x0600B238 RID: 45624 RVA: 0x0029DF70 File Offset: 0x0029C170
[Token(Token = "0x17001CCC")]
public bool IsSecure
{
[Token(Token = "0x600B237")]
[Address(RVA = "0x566D70", Offset = "0x565770", VA = "0x180566D70")]
get;
[Token(Token = "0x600B238")]
[Address(RVA = "0x566E50", Offset = "0x565850", VA = "0x180566E50")]
private set;
}
// Token: 0x17001CCD RID: 7373
// (get) Token: 0x0600B239 RID: 45625 RVA: 0x0029DF84 File Offset: 0x0029C184
// (set) Token: 0x0600B23A RID: 45626 RVA: 0x0029DF98 File Offset: 0x0029C198
[Token(Token = "0x17001CCD")]
public bool IsHttpOnly
{
[Token(Token = "0x600B239")]
[Address(RVA = "0x566D80", Offset = "0x565780", VA = "0x180566D80")]
get;
[Token(Token = "0x600B23A")]
[Address(RVA = "0x566E70", Offset = "0x565870", VA = "0x180566E70")]
private set;
}
// Token: 0x0600B23B RID: 45627 RVA: 0x0029DFAC File Offset: 0x0029C1AC
[Token(Token = "0x600B23B")]
[Address(RVA = "0x1F059F0", Offset = "0x1F043F0", VA = "0x181F059F0")]
public Cookie(string name, string value)
{
string empty = string.Empty;
}
// Token: 0x0600B23C RID: 45628 RVA: 0x0029DFC0 File Offset: 0x0029C1C0
[Token(Token = "0x600B23C")]
[Address(RVA = "0x1F05CE0", Offset = "0x1F046E0", VA = "0x181F05CE0")]
public Cookie(string name, string value, string path)
{
string empty = string.Empty;
}
// Token: 0x0600B23D RID: 45629 RVA: 0x0029DFD4 File Offset: 0x0029C1D4
[Token(Token = "0x600B23D")]
[Address(RVA = "0x1F05C30", Offset = "0x1F04630", VA = "0x181F05C30")]
public Cookie(string name, string value, string path, string domain)
{
int num = 0;
base.FieldGetter(num, value, path);
this.IsSession = true;
this.MaxAge = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
this.LastAccess = utcNow;
this.Name = name;
this.Value = value;
this.Domain = 0;
this.Path = path;
}
// Token: 0x0600B23E RID: 45630 RVA: 0x0029E028 File Offset: 0x0029C228
[Token(Token = "0x600B23E")]
[Address(RVA = "0x1F05A70", Offset = "0x1F04470", VA = "0x181F05A70")]
public Cookie(Uri uri, string name, string value, DateTime expires, bool isSession = true)
{
string absolutePath = uri.AbsolutePath;
string host = uri.Host;
this.Expires = 0;
this.IsSession = false;
DateTime utcNow = DateTime.UtcNow;
this.Date = utcNow;
}
// Token: 0x0600B23F RID: 45631 RVA: 0x0029E068 File Offset: 0x0029C268
[Token(Token = "0x600B23F")]
[Address(RVA = "0x1F05B50", Offset = "0x1F04550", VA = "0x181F05B50")]
public Cookie(Uri uri, string name, string value, long maxAge = -1L, bool isSession = true)
{
string absolutePath = uri.AbsolutePath;
string host = uri.Host;
this.MaxAge = 0L;
this.IsSession = false;
DateTime utcNow = DateTime.UtcNow;
this.Date = utcNow;
}
// Token: 0x0600B240 RID: 45632 RVA: 0x0029E0A8 File Offset: 0x0029C2A8
[Token(Token = "0x600B240")]
[Address(RVA = "0x1F05D60", Offset = "0x1F04760", VA = "0x181F05D60")]
internal Cookie()
{
this.IsSession = true;
this.MaxAge = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
this.LastAccess = utcNow;
}
// Token: 0x0600B241 RID: 45633 RVA: 0x0029E0DC File Offset: 0x0029C2DC
[Token(Token = "0x600B241")]
[Address(RVA = "0x1F058E0", Offset = "0x1F042E0", VA = "0x181F058E0")]
public bool WillExpireInTheFuture()
{
if (!this.<IsSession>k__BackingField)
{
DateTime utcNow = DateTime.UtcNow;
DateTime dateTime = this.<Date>k__BackingField;
TimeSpan timeSpan = utcNow - dateTime;
int num = 0;
return Math.Max(0L, (long)num) < this.<MaxAge>k__BackingField;
}
return true;
}
// Token: 0x0600B242 RID: 45634 RVA: 0x0029E13C File Offset: 0x0029C33C
[Token(Token = "0x600B242")]
[Address(RVA = "0x1F04AA0", Offset = "0x1F034A0", VA = "0x181F04AA0")]
public uint GuessSize()
{
/*
An exception occurred when decompiling this method (0600B242)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.UInt32 BestHTTP.Cookies.Cookie::GuessSize()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_6C:
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldc.i4:int32(35)))
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldloc:int32(var_1_08)))
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldloc:int32(var_1_08)))
stloc:int32(var_8, add:int32(ldloc:int32(var_8), ldloc:int32(var_1_08)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600B243 RID: 45635 RVA: 0x0029E1D0 File Offset: 0x0029C3D0
[Token(Token = "0x600B243")]
[Address(RVA = "0x1F04E90", Offset = "0x1F03890", VA = "0x181F04E90")]
public static Cookie Parse(string header, Uri defaultDomain)
{
int num = 0;
Cookie cookie = new Cookie();
cookie.<IsSession>k__BackingField = true;
cookie.<MaxAge>k__BackingField = (long)((ulong)(-1L));
DateTime utcNow = DateTime.UtcNow;
cookie.<LastAccess>k__BackingField = utcNow;
List<HeaderValue> list = Cookie.ParseCookieHeader(header);
List.Enumerator enumerator;
if (enumerator != 0)
{
int stringLength = header.m_stringLength;
string text;
if (string.Equals(text, "path"))
{
if (!string.IsNullOrEmpty(text))
{
bool flag = text.StartsWith("/");
if (flag)
{
cookie.<Path>k__BackingField = flag;
}
}
cookie.<Path>k__BackingField = "/";
}
if (string.Equals(text, "domain") && !string.IsNullOrEmpty(text))
{
string text2;
if (text.StartsWith("."))
{
text2 = text.Substring(1);
}
cookie.<Domain>k__BackingField = text2;
}
if (string.Equals(text, "expires"))
{
DateTime dateTime = DateTime.FromBinary(0L);
DateTime dateTime2 = text.ToDateTime(dateTime);
cookie.<Expires>k__BackingField = dateTime2;
cookie.<IsSession>k__BackingField = false;
}
if (string.Equals(text, "max-age"))
{
long num2;
cookie.<MaxAge>k__BackingField = num2;
cookie.<IsSession>k__BackingField = false;
}
if (string.Equals(text, "secure"))
{
cookie.<IsSecure>k__BackingField = true;
}
bool flag2 = string.Equals(text, "httponly");
if (flag2)
{
cookie.<IsHttpOnly>k__BackingField = true;
}
cookie.<Name>k__BackingField = flag2;
cookie.<Value>k__BackingField = flag2;
}
if (num != -1)
{
if (header == (ulong)571L)
{
}
if (header == (ulong)403L)
{
goto IL_169;
}
}
if (num != 0)
{
throw new NullReferenceException();
}
IL_169:
cookie.<IsSession>k__BackingField = true;
string text3 = cookie.<Domain>k__BackingField;
string host = defaultDomain.Host;
cookie.<Domain>k__BackingField = host;
string text4 = cookie.<Path>k__BackingField;
if (host != 0)
{
string absolutePath = defaultDomain.AbsolutePath;
cookie.<Path>k__BackingField = absolutePath;
}
DateTime utcNow2 = DateTime.UtcNow;
cookie.<LastAccess>k__BackingField = utcNow2;
cookie.<Date>k__BackingField = utcNow2;
ILogger logger = HTTPManager.Logger;
string[] array = new string[6];
throw new ArrayTypeMismatchException();
}
// Token: 0x0600B244 RID: 45636 RVA: 0x0029E494 File Offset: 0x0029C694
[Token(Token = "0x600B244")]
[Address(RVA = "0x1F056A0", Offset = "0x1F040A0", VA = "0x181F056A0")]
internal void SaveTo(BinaryWriter stream)
{
stream.Write(1);
string text = this.<Name>k__BackingField;
if (text == 0)
{
}
stream.Write(text);
string empty;
if (this.<Value>k__BackingField == 0)
{
empty = string.Empty;
}
stream.Write(empty);
DateTime dateTime = this.<Date>k__BackingField;
DateTime dateTime2 = this.<LastAccess>k__BackingField;
DateTime dateTime3 = this.<Expires>k__BackingField;
long num = this.<MaxAge>k__BackingField;
stream.Write((uint)num);
stream.Flush();
string empty2;
if (this.<Domain>k__BackingField == 0)
{
empty2 = string.Empty;
}
stream.Write(empty2);
string empty3;
if (this.<Path>k__BackingField == 0)
{
empty3 = string.Empty;
}
stream.Write(empty3);
stream.Flush();
stream.Flush();
}
// Token: 0x0600B245 RID: 45637 RVA: 0x0029E540 File Offset: 0x0029C740
[Token(Token = "0x600B245")]
[Address(RVA = "0x1F04B00", Offset = "0x1F03500", VA = "0x181F04B00")]
internal void LoadFrom(BinaryReader stream)
{
ushort num = stream.ReadUInt16();
decimal num2 = stream.ReadDecimal();
this.<Name>k__BackingField = num2;
decimal num3 = stream.ReadDecimal();
this.<Value>k__BackingField = num3;
DateTime dateTime = DateTime.FromBinary((long)stream.ReadUInt32());
this.<Date>k__BackingField = dateTime;
DateTime dateTime2 = DateTime.FromBinary((long)stream.ReadUInt32());
this.<LastAccess>k__BackingField = dateTime2;
DateTime dateTime3 = DateTime.FromBinary((long)stream.ReadUInt32());
this.<Expires>k__BackingField = dateTime3;
uint num4 = stream.ReadUInt32();
this.<MaxAge>k__BackingField = (long)num4;
int num5 = stream.Read();
this.<IsSession>k__BackingField = num5 != 0;
decimal num6 = stream.ReadDecimal();
this.<Domain>k__BackingField = num6;
decimal num7 = stream.ReadDecimal();
this.<Path>k__BackingField = num7;
int num8 = stream.Read();
this.<IsSecure>k__BackingField = num8 != 0;
int num9 = stream.Read();
this.<IsHttpOnly>k__BackingField = num9 != 0;
}
// Token: 0x0600B246 RID: 45638 RVA: 0x0029E614 File Offset: 0x0029C814
[Token(Token = "0x600B246")]
[Address(RVA = "0x1F058A0", Offset = "0x1F042A0", VA = "0x181F058A0", Slot = "3")]
public override string ToString()
{
string text = this.<Value>k__BackingField;
return this.<Name>k__BackingField + "=" + text;
}
// Token: 0x0600B247 RID: 45639 RVA: 0x0029E63C File Offset: 0x0029C83C
[Token(Token = "0x600B247")]
[Address(RVA = "0x1F04A30", Offset = "0x1F03430", VA = "0x181F04A30", Slot = "0")]
public override bool Equals(object obj)
{
if (obj != 0)
{
bool flag;
return flag;
}
}
// Token: 0x0600B248 RID: 45640 RVA: 0x0029E650 File Offset: 0x0029C850
[Token(Token = "0x600B248")]
[Address(RVA = "0x1F04970", Offset = "0x1F03370", VA = "0x181F04970", Slot = "5")]
public bool Equals(Cookie cookie)
{
if (cookie != 0)
{
if (this != cookie)
{
string text = this.<Name>k__BackingField;
string text2 = cookie.<Name>k__BackingField;
if (!text.Equals(text2, StringComparison.Ordinal))
{
goto IL_76;
}
string text3 = this.<Domain>k__BackingField;
if (text3 != 0 || cookie.<Domain>k__BackingField != text3)
{
string text4 = cookie.<Domain>k__BackingField;
if (!text3.Equals(text4, StringComparison.Ordinal))
{
goto IL_76;
}
}
string text5 = this.<Path>k__BackingField;
if (text5 != 0 || cookie.<Path>k__BackingField != text5)
{
string text6 = cookie.<Path>k__BackingField;
return text5.Equals(text6, StringComparison.Ordinal);
}
}
return true;
}
IL_76:
throw new NullReferenceException();
}
// Token: 0x0600B249 RID: 45641 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B249")]
[Address(RVA = "0x6878E0", Offset = "0x6862E0", VA = "0x1806878E0", Slot = "2")]
public override int GetHashCode()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B24A RID: 45642 RVA: 0x0029E6DC File Offset: 0x0029C8DC
[Token(Token = "0x600B24A")]
[Address(RVA = "0x1F05610", Offset = "0x1F04010", VA = "0x181F05610")]
private static string ReadValue(string str, ref int pos)
{
string empty = string.Empty;
if (str != 0)
{
}
return empty;
}
// Token: 0x0600B24B RID: 45643 RVA: 0x0029E6F4 File Offset: 0x0029C8F4
[Token(Token = "0x600B24B")]
[Address(RVA = "0x1F04CA0", Offset = "0x1F036A0", VA = "0x181F04CA0")]
private static List<HeaderValue> ParseCookieHeader(string str)
{
List<HeaderValue> list = new List();
if (str != 0)
{
int num = 0;
if (num < str.m_stringLength)
{
Func<char, bool> <>9__61_ = Cookie.<>c.<>9__61_0;
if (<>9__61_ == 0)
{
Cookie.<>c.<>9__61_0 = delegate(char ch)
{
bool flag;
return flag;
};
}
HeaderValue headerValue = new HeaderValue(Extensions.Read(str, num, <>9__61_, true).Trim());
if (num < str.m_stringLength)
{
char c = str[num];
string text = Cookie.ReadValue(str, num);
headerValue.<Value>k__BackingField = text;
}
list.Add(headerValue);
}
}
return list;
}
// Token: 0x0600B24C RID: 45644 RVA: 0x0029E77C File Offset: 0x0029C97C
[Token(Token = "0x600B24C")]
[Address(RVA = "0x1F04940", Offset = "0x1F03340", VA = "0x181F04940", Slot = "4")]
public int CompareTo(Cookie other)
{
DateTime dateTime = this.<LastAccess>k__BackingField;
throw new NullReferenceException();
}
// Token: 0x04007597 RID: 30103
[Token(Token = "0x4007597")]
private const int Version = 1;
}
}
@@ -0,0 +1,601 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using BestHTTP.Logger;
using BestHTTP.PlatformSupport.FileSystem;
using Cpp2IlInjected;
namespace BestHTTP.Cookies
{
// Token: 0x020019E3 RID: 6627
[Token(Token = "0x20019E3")]
[StructLayout(3)]
public static class CookieJar
{
// Token: 0x17001CCE RID: 7374
// (get) Token: 0x0600B250 RID: 45648 RVA: 0x0029E7D4 File Offset: 0x0029C9D4
[Token(Token = "0x17001CCE")]
public static bool IsSavingSupported
{
[Token(Token = "0x600B250")]
[Address(RVA = "0x1F04510", Offset = "0x1F02F10", VA = "0x181F04510")]
get
{
int num;
do
{
num = 0;
IIOService ioservice = HTTPManager.IOService;
string rootCacheFolder = HTTPManager.GetRootCacheFolder();
ILogger logger = HTTPManager.Logger;
num++;
if (num != -1)
{
}
}
while (num != 0);
return CookieJar._isSavingSupported;
}
}
// Token: 0x17001CCF RID: 7375
// (get) Token: 0x0600B251 RID: 45649 RVA: 0x0029E820 File Offset: 0x0029CA20
// (set) Token: 0x0600B252 RID: 45650 RVA: 0x0029E834 File Offset: 0x0029CA34
[Token(Token = "0x17001CCF")]
private static string CookieFolder
{
[Token(Token = "0x600B251")]
[Address(RVA = "0x1F04450", Offset = "0x1F02E50", VA = "0x181F04450")]
get;
[Token(Token = "0x600B252")]
[Address(RVA = "0x1F04880", Offset = "0x1F03280", VA = "0x181F04880")]
set;
}
// Token: 0x17001CD0 RID: 7376
// (get) Token: 0x0600B253 RID: 45651 RVA: 0x0029E848 File Offset: 0x0029CA48
// (set) Token: 0x0600B254 RID: 45652 RVA: 0x0029E85C File Offset: 0x0029CA5C
[Token(Token = "0x17001CD0")]
private static string LibraryPath
{
[Token(Token = "0x600B253")]
[Address(RVA = "0x1F047C0", Offset = "0x1F031C0", VA = "0x181F047C0")]
get;
[Token(Token = "0x600B254")]
[Address(RVA = "0x1F048E0", Offset = "0x1F032E0", VA = "0x181F048E0")]
set;
}
// Token: 0x0600B255 RID: 45653 RVA: 0x0029E870 File Offset: 0x0029CA70
[Token(Token = "0x600B255")]
[Address(RVA = "0x1F040E0", Offset = "0x1F02AE0", VA = "0x181F040E0")]
internal static void SetupFolder()
{
if (CookieJar.IsSavingSupported)
{
bool flag = string.IsNullOrEmpty(CookieJar.<CookieFolder>k__BackingField);
if (flag || flag)
{
CookieJar.<CookieFolder>k__BackingField = Path.Combine(HTTPManager.GetRootCacheFolder(), "Cookies");
CookieJar.<LibraryPath>k__BackingField = Path.Combine(CookieJar.<CookieFolder>k__BackingField, "Library");
}
}
}
// Token: 0x0600B256 RID: 45654 RVA: 0x0029E8C4 File Offset: 0x0029CAC4
[Token(Token = "0x600B256")]
[Address(RVA = "0x1F03C50", Offset = "0x1F02650", VA = "0x181F03C50")]
internal static void Set(HTTPResponse response)
{
while (response != 0)
{
object locker = CookieJar.Locker;
CookieJar.Maintain();
List<Cookie> list = new List();
if (response.GetHeaderValues("set-cookie") != 0)
{
List.Enumerator enumerator;
if (enumerator != 0)
{
Uri currentUri = response.baseRequest.CurrentUri;
Cookie cookie;
if (cookie == 0)
{
goto IL_8D;
}
if (!string.IsNullOrEmpty(cookie.<Value>k__BackingField))
{
int num = 0;
if (cookie.WillExpireInTheFuture())
{
Cookie cookie2;
if (cookie2 != 0)
{
DateTime <Date>k__BackingField = cookie2.<Date>k__BackingField;
cookie.<Date>k__BackingField = <Date>k__BackingField;
CookieJar.Cookies[num] = cookie;
list.Add(cookie);
goto IL_8D;
}
goto IL_8D;
}
}
IL_99:
while (cookie == (ulong)(-1L))
{
}
List<Cookie> cookies = CookieJar.Cookies;
goto IL_A7;
IL_8D:
CookieJar.Cookies.Add(cookie);
goto IL_99;
}
IL_A7:
int num2 = 0;
if (num2 != -1)
{
response.<Cookies>k__BackingField = list;
num2++;
}
if (response != 0)
{
continue;
}
}
int num3 = 0;
num3++;
Monitor.Exit(response);
if (num3 != -1)
{
}
if (response == 0)
{
break;
}
}
}
// Token: 0x0600B257 RID: 45655 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600B257")]
[Address(RVA = "0x1F02B90", Offset = "0x1F01590", VA = "0x181F02B90")]
internal static void Maintain()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600B258 RID: 45656 RVA: 0x0029E9E0 File Offset: 0x0029CBE0
[Token(Token = "0x600B258")]
[Address(RVA = "0x1F03080", Offset = "0x1F01A80", VA = "0x181F03080")]
internal static void Persist()
{
for (;;)
{
int num = 0;
if (!CookieJar.IsSavingSupported)
{
break;
}
object locker = CookieJar.Locker;
CookieJar.Maintain();
IIOService ioservice = HTTPManager.IOService;
IIOService ioservice2 = HTTPManager.IOService;
IIOService ioservice3 = HTTPManager.IOService;
BinaryWriter binaryWriter;
binaryWriter.Write(1);
int num2 = 0;
List<Cookie> cookies = CookieJar.Cookies;
List.Enumerator enumerator;
if (enumerator != 0)
{
num2++;
}
int num3 = 0;
if (num3 == -1)
{
goto IL_6B;
}
binaryWriter.Write((ushort)num2);
List<Cookie> cookies2 = CookieJar.Cookies;
List.Enumerator enumerator2;
if (enumerator2 != 0)
{
goto IL_6B;
}
IL_72:
num3++;
if (num3 != -1)
{
num3++;
}
if (num != 0)
{
goto IL_E1;
}
if (binaryWriter != 0)
{
}
if (num3 != -1)
{
num3++;
}
if (num != 0)
{
goto IL_F9;
}
int num4;
if (num3 != 0)
{
num4 = 0;
}
if (num3 != -1)
{
num3++;
}
if (num != 0)
{
goto IL_FF;
}
num3++;
int num5 = 0;
Monitor.Exit(num4);
if (num5 != -1)
{
}
if (num == 0)
{
break;
}
continue;
IL_6B:
if (num == 0)
{
goto IL_72;
}
goto IL_DB;
}
return;
IL_DB:
throw new NullReferenceException();
IL_E1:
throw new NullReferenceException();
IL_F9:
throw new NullReferenceException();
IL_FF:
throw new NullReferenceException();
}
// Token: 0x0600B259 RID: 45657 RVA: 0x0029EAF4 File Offset: 0x0029CCF4
[Token(Token = "0x600B259")]
[Address(RVA = "0x1F024A0", Offset = "0x1F00EA0", VA = "0x181F024A0")]
internal static void Load()
{
for (;;)
{
int num = 0;
if (!CookieJar.IsSavingSupported)
{
break;
}
object locker = CookieJar.Locker;
CookieJar.SetupFolder();
CookieJar.Cookies.Clear();
IIOService ioservice = HTTPManager.IOService;
IIOService ioservice2 = HTTPManager.IOService;
IIOService ioservice3 = HTTPManager.IOService;
IIOService ioservice4 = HTTPManager.IOService;
BinaryReader binaryReader;
ushort num2 = binaryReader.ReadUInt16();
ushort num3 = binaryReader.ReadUInt16();
int num4 = 0;
if (num4 < (int)num3)
{
Cookie cookie = new Cookie();
cookie.LoadFrom(binaryReader);
if (cookie.WillExpireInTheFuture())
{
CookieJar.Cookies.Add(cookie);
}
num4++;
}
int num5 = 0;
if (binaryReader != 0)
{
}
if (num5 != -1)
{
num5++;
}
if (num != 0)
{
goto IL_F2;
}
if (num5 != -1)
{
num5++;
}
if (num != 0)
{
goto IL_F8;
}
int num6 = 0;
CookieJar.Cookies.Clear();
num6++;
if (num6 != -1)
{
}
if (num == 0)
{
if (0 != -1)
{
}
if (num == 0)
{
break;
}
}
}
return;
IL_F2:
throw new NullReferenceException();
IL_F8:
throw new NullReferenceException();
}
// Token: 0x0600B25A RID: 45658 RVA: 0x0029EC10 File Offset: 0x0029CE10
[Token(Token = "0x600B25A")]
[Address(RVA = "0x1F021E0", Offset = "0x1F00BE0", VA = "0x181F021E0")]
public static List<Cookie> Get(Uri uri)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
if (flag)
{
int num2 = 0;
if (uri.Host.IndexOf(num2) != -1)
{
int num3 = 0;
if (uri.AbsolutePath.StartsWith(num3) && num == 0)
{
List<Cookie> list = new List();
}
}
}
num++;
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
throw new NullReferenceException();
}
// Token: 0x0600B25B RID: 45659 RVA: 0x0029ECAC File Offset: 0x0029CEAC
[Token(Token = "0x600B25B")]
[Address(RVA = "0x1F03A10", Offset = "0x1F02410", VA = "0x181F03A10")]
public static void Set(Uri uri, Cookie cookie)
{
CookieJar.Set(cookie);
}
// Token: 0x0600B25C RID: 45660 RVA: 0x0029ECC0 File Offset: 0x0029CEC0
[Token(Token = "0x600B25C")]
[Address(RVA = "0x1F03A70", Offset = "0x1F02470", VA = "0x181F03A70")]
public static void Set(Cookie cookie)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
CookieJar.Cookies.Add(cookie);
CookieJar.Cookies[num] = cookie;
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600B25D RID: 45661 RVA: 0x0029ED10 File Offset: 0x0029CF10
[Token(Token = "0x600B25D")]
[Address(RVA = "0x1F020A0", Offset = "0x1F00AA0", VA = "0x181F020A0")]
public static List<Cookie> GetAll()
{
int num;
List<Cookie> cookies;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
cookies = CookieJar.Cookies;
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
return cookies;
}
// Token: 0x0600B25E RID: 45662 RVA: 0x0029ED44 File Offset: 0x0029CF44
[Token(Token = "0x600B25E")]
[Address(RVA = "0x1F01960", Offset = "0x1F00360", VA = "0x181F01960")]
public static void Clear()
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
CookieJar.Cookies.Clear();
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600B25F RID: 45663 RVA: 0x0029ED80 File Offset: 0x0029CF80
[Token(Token = "0x600B25F")]
[Address(RVA = "0x1F01AA0", Offset = "0x1F004A0", VA = "0x181F01AA0")]
public static void Clear(TimeSpan olderThan)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
if (flag)
{
object locker2 = CookieJar.Locker;
DateTime utcNow = DateTime.UtcNow;
DateTime dateTime;
if (!(dateTime < utcNow))
{
num++;
}
}
CookieJar.Cookies.RemoveAt(num);
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600B260 RID: 45664 RVA: 0x0029EE00 File Offset: 0x0029D000
[Token(Token = "0x600B260")]
[Address(RVA = "0x1F01D30", Offset = "0x1F00730", VA = "0x181F01D30")]
public static void Clear(string domain)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
int num2;
if (flag && num2 == -1)
{
num++;
}
CookieJar.Cookies.RemoveAt(num);
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600B261 RID: 45665 RVA: 0x0029EE70 File Offset: 0x0029D070
[Token(Token = "0x600B261")]
[Address(RVA = "0x1F03770", Offset = "0x1F02170", VA = "0x181F03770")]
public static void Remove(Uri uri, string name)
{
int num;
do
{
num = 0;
object locker = CookieJar.Locker;
CookieJar.Load();
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
if (CookieJar.<CookieFolder>k__BackingField.Equals(name, StringComparison.OrdinalIgnoreCase))
{
int num2 = 0;
if (uri.Host.IndexOf(num2) != -1)
{
CookieJar.Cookies.RemoveAt(num);
}
}
num++;
Monitor.Exit(locker);
if (num != -1)
{
}
}
while (num != 0);
}
// Token: 0x0600B262 RID: 45666 RVA: 0x0029EF04 File Offset: 0x0029D104
[Token(Token = "0x600B262")]
[Address(RVA = "0x1F01F90", Offset = "0x1F00990", VA = "0x181F01F90")]
private static Cookie Find(Cookie cookie, out int idx)
{
int num = 0;
List<Cookie> cookies = CookieJar.Cookies;
List<Cookie> cookies2 = CookieJar.Cookies;
bool flag;
if (!flag)
{
num++;
}
idx.m_value = num;
return typeof(CookieJar).TypeHandle;
}
// Token: 0x0600B263 RID: 45667 RVA: 0x0029EF3C File Offset: 0x0029D13C
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600B263")]
[Address(RVA = "0x1F04390", Offset = "0x1F02D90", VA = "0x181F04390")]
static CookieJar()
{
TimeSpan timeSpan;
CookieJar.AccessThreshold = timeSpan;
CookieJar.Cookies = new List();
CookieJar.Locker = new object();
}
// Token: 0x040075A5 RID: 30117
[Token(Token = "0x40075A5")]
private const int Version = 1;
// Token: 0x040075A6 RID: 30118
[Token(Token = "0x40075A6")]
public static TimeSpan AccessThreshold;
// Token: 0x040075A7 RID: 30119
[Token(Token = "0x40075A7")]
private static List<Cookie> Cookies;
// Token: 0x040075AA RID: 30122
[Token(Token = "0x40075AA")]
private static object Locker;
// Token: 0x040075AB RID: 30123
[Token(Token = "0x40075AB")]
private static bool _isSavingSupported;
// Token: 0x040075AC RID: 30124
[Token(Token = "0x40075AC")]
private static bool IsSupportCheckDone;
// Token: 0x040075AD RID: 30125
[Token(Token = "0x40075AD")]
private static bool Loaded;
}
}