Files
Jan2021-Cpp2Il-Dump/Assembly-CSharp/BestHTTP/SecureProtocol/Org/BouncyCastle/Crypto/Engines/DesEngine.cs
T
2026-04-08 23:40:05 +02:00

305 lines
14 KiB
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
{
// Token: 0x020016B1 RID: 5809
[Token(Token = "0x20016B1")]
[StructLayout(3)]
public class DesEngine : IBlockCipher
{
// Token: 0x06009B8D RID: 39821 RVA: 0x00231998 File Offset: 0x0022FB98
[Token(Token = "0x6009B8D")]
[Address(RVA = "0x3C39A0", Offset = "0x3C23A0", VA = "0x1803C39A0", Slot = "10")]
public virtual int[] GetWorkingKey()
{
return this.workingKey;
}
// Token: 0x06009B8E RID: 39822 RVA: 0x002319AC File Offset: 0x0022FBAC
[Token(Token = "0x6009B8E")]
[Address(RVA = "0x22F23F0", Offset = "0x22F0DF0", VA = "0x1822F23F0", Slot = "11")]
public virtual void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (06009B8E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.DesEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_28:
stloc:ArgumentException(var_6_39, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to DES init - "), ldloc:string(var_5))))
}
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: 0x170018C7 RID: 6343
// (get) Token: 0x06009B8F RID: 39823 RVA: 0x002319F4 File Offset: 0x0022FBF4
[Token(Token = "0x170018C7")]
public virtual string AlgorithmName
{
[Token(Token = "0x6009B8F")]
[Address(RVA = "0x22F29E0", Offset = "0x22F13E0", VA = "0x1822F29E0", Slot = "12")]
get
{
return "DES";
}
}
// Token: 0x170018C8 RID: 6344
// (get) Token: 0x06009B90 RID: 39824 RVA: 0x00231A08 File Offset: 0x0022FC08
[Token(Token = "0x170018C8")]
public virtual bool IsPartialBlockOkay
{
[Token(Token = "0x6009B90")]
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "13")]
get
{
}
}
// Token: 0x06009B91 RID: 39825 RVA: 0x00231A18 File Offset: 0x0022FC18
[Token(Token = "0x6009B91")]
[Address(RVA = "0x56E570", Offset = "0x56CF70", VA = "0x18056E570", Slot = "14")]
public virtual int GetBlockSize()
{
return 8;
}
// Token: 0x06009B92 RID: 39826 RVA: 0x00231A28 File Offset: 0x0022FC28
[Token(Token = "0x6009B92")]
[Address(RVA = "0x22F25B0", Offset = "0x22F0FB0", VA = "0x1822F25B0", Slot = "15")]
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
{
/*
An exception occurred when decompiling this method (06009B92)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.DesEngine::ProcessBlock(System.Byte[],System.Int32,System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_21:
stloc:InvalidOperationException(var_4_2B, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("DES engine not initialised")))
}
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.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
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: 0x06009B93 RID: 39827 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009B93")]
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "16")]
public virtual void Reset()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009B94 RID: 39828 RVA: 0x00231A64 File Offset: 0x0022FC64
[Token(Token = "0x6009B94")]
[Address(RVA = "0x22F1CC0", Offset = "0x22F06C0", VA = "0x1822F1CC0")]
protected static int[] GenerateWorkingKey(bool encrypting, byte[] key)
{
int[] array = new int[32];
bool[] array2 = new bool[56];
bool[] array3 = new bool[56];
int num = 0;
byte[] array4 = DesEngine.pc1;
short[] array5 = DesEngine.bytebit;
num++;
array[0] = num;
array[0] = num;
byte[] array6 = DesEngine.totrot;
int length = array2.Length;
byte b = (byte)((int)b + num);
num++;
byte[] array7 = DesEngine.totrot;
int length2 = array2.Length;
uint num2;
byte b2 = (byte)((uint)b2 + num2);
num2 += (uint)1;
byte b3 = DesEngine.pc2[num];
if ("{il2cpp array field local7->}" != (ulong)0L)
{
int num3 = DesEngine.bigbyte[num];
array[0] = num3;
}
byte[] array8 = DesEngine.pc2;
if ("{il2cpp array field local7->}" != (ulong)0L)
{
int num4 = DesEngine.bigbyte[num];
array[0] = num4;
}
num++;
num++;
uint num5;
if (num5 > (uint)(-2))
{
}
int num6 = 0;
int num7 = array.Length;
int num8;
num7 = num8;
array[0] = num8;
num6 += 2;
array[0] = num7;
while (num6 != 32)
{
}
return array;
}
// Token: 0x06009B95 RID: 39829 RVA: 0x00231B8C File Offset: 0x0022FD8C
[Token(Token = "0x6009B95")]
[Address(RVA = "0x22F1670", Offset = "0x22F0070", VA = "0x1822F1670")]
internal static void DesFunc(int[] wKey, byte[] input, int inOff, byte[] outBytes, int outOff)
{
int num = 0;
uint[] sp = DesEngine.SP7;
uint[] sp2 = DesEngine.SP5;
uint[] sp3 = DesEngine.SP3;
uint[] sp4 = DesEngine.SP1;
uint[] sp5 = DesEngine.SP8;
uint[] sp6 = DesEngine.SP6;
uint[] sp7 = DesEngine.SP4;
uint[] sp8 = DesEngine.SP2;
num += 4;
}
// Token: 0x06009B96 RID: 39830 RVA: 0x00231BDC File Offset: 0x0022FDDC
[Token(Token = "0x6009B96")]
[Address(RVA = "0x3C1670", Offset = "0x3C0070", VA = "0x1803C1670")]
public DesEngine()
{
this.Reset();
}
// Token: 0x06009B97 RID: 39831 RVA: 0x00231BF0 File Offset: 0x0022FDF0
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009B97")]
[Address(RVA = "0x22F26E0", Offset = "0x22F10E0", VA = "0x1822F26E0")]
static DesEngine()
{
short[] array = new short[8];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.4FFC8339E09825A68B861995F9C660EB11DBF13D).FieldHandle);
DesEngine.bytebit = array;
int[] array2 = new int[24];
RuntimeHelpers.InitializeArray(array2, fieldof(<PrivateImplementationDetails>.C105B70BED997DB5D36E1D2E84C1EFCB445A428C).FieldHandle);
DesEngine.bigbyte = array2;
byte[] array3 = new byte[56];
RuntimeHelpers.InitializeArray(array3, fieldof(<PrivateImplementationDetails>.DC2B830D8CD59AD6A4E4332D21CA0DCA2821AD82).FieldHandle);
DesEngine.pc1 = array3;
byte[] array4 = new byte[16];
RuntimeHelpers.InitializeArray(array4, fieldof(<PrivateImplementationDetails>.B4FBD02AAB5B16E0F4BD858DA5D9E348F3CE501D).FieldHandle);
DesEngine.totrot = array4;
byte[] array5 = new byte[48];
RuntimeHelpers.InitializeArray(array5, fieldof(<PrivateImplementationDetails>.62BAB0F245E66C3EB982CF5A7015F0A7C3382283).FieldHandle);
DesEngine.pc2 = array5;
uint[] array6 = new uint[64];
RuntimeHelpers.InitializeArray(array6, fieldof(<PrivateImplementationDetails>.04B9E6B1364BBA4125AE2866E09C57C9E8CD6DA6).FieldHandle);
DesEngine.SP1 = array6;
uint[] array7 = new uint[64];
RuntimeHelpers.InitializeArray(array7, fieldof(<PrivateImplementationDetails>.3D6EB645BC212077C1B37A3A32CA2A62F7B39018).FieldHandle);
DesEngine.SP2 = array7;
uint[] array8 = new uint[64];
RuntimeHelpers.InitializeArray(array8, fieldof(<PrivateImplementationDetails>.821D1E62CD072AE9EC73D238C7DE19C5C5F3A7D8).FieldHandle);
DesEngine.SP3 = array8;
uint[] array9 = new uint[64];
RuntimeHelpers.InitializeArray(array9, fieldof(<PrivateImplementationDetails>.64354464C9074B5BB4369689AAA131961CD1EF19).FieldHandle);
DesEngine.SP4 = array9;
uint[] array10 = new uint[64];
RuntimeHelpers.InitializeArray(array10, fieldof(<PrivateImplementationDetails>.3F653EBF39CFCB2FD7FF335DC96E82F3CDFDF0C7).FieldHandle);
DesEngine.SP5 = array10;
uint[] array11 = new uint[64];
RuntimeHelpers.InitializeArray(array11, fieldof(<PrivateImplementationDetails>.6D7292FF64ED402BBFFF5E7534C0980BEBF0EEB1).FieldHandle);
DesEngine.SP6 = array11;
uint[] array12 = new uint[64];
RuntimeHelpers.InitializeArray(array12, fieldof(<PrivateImplementationDetails>.FC9EEBC457831129D4AF4FF84333B481F4BED60E).FieldHandle);
DesEngine.SP7 = array12;
uint[] array13 = new uint[64];
RuntimeHelpers.InitializeArray(array13, fieldof(<PrivateImplementationDetails>.4C44594E2C603D85EC6195B1A7A6C5876CBB58E2).FieldHandle);
DesEngine.SP8 = array13;
}
// Token: 0x04006608 RID: 26120
[Token(Token = "0x4006608")]
internal const int BLOCK_SIZE = 8;
// Token: 0x04006609 RID: 26121
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006609")]
private int[] workingKey;
// Token: 0x0400660A RID: 26122
[Token(Token = "0x400660A")]
private static readonly short[] bytebit;
// Token: 0x0400660B RID: 26123
[Token(Token = "0x400660B")]
private static readonly int[] bigbyte;
// Token: 0x0400660C RID: 26124
[Token(Token = "0x400660C")]
private static readonly byte[] pc1;
// Token: 0x0400660D RID: 26125
[Token(Token = "0x400660D")]
private static readonly byte[] totrot;
// Token: 0x0400660E RID: 26126
[Token(Token = "0x400660E")]
private static readonly byte[] pc2;
// Token: 0x0400660F RID: 26127
[Token(Token = "0x400660F")]
private static readonly uint[] SP1;
// Token: 0x04006610 RID: 26128
[Token(Token = "0x4006610")]
private static readonly uint[] SP2;
// Token: 0x04006611 RID: 26129
[Token(Token = "0x4006611")]
private static readonly uint[] SP3;
// Token: 0x04006612 RID: 26130
[Token(Token = "0x4006612")]
private static readonly uint[] SP4;
// Token: 0x04006613 RID: 26131
[Token(Token = "0x4006613")]
private static readonly uint[] SP5;
// Token: 0x04006614 RID: 26132
[Token(Token = "0x4006614")]
private static readonly uint[] SP6;
// Token: 0x04006615 RID: 26133
[Token(Token = "0x4006615")]
private static readonly uint[] SP7;
// Token: 0x04006616 RID: 26134
[Token(Token = "0x4006616")]
private static readonly uint[] SP8;
}
}